Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

94 lines
4.6 KiB

  1. /*++
  2. Copyright(c) 1998,99 Microsoft Corporation
  3. Module Name:
  4. log.h
  5. Abstract:
  6. Windows Load Balancing Service (WLBS)
  7. Driver - event logging support
  8. Author:
  9. kyrilf
  10. --*/
  11. #ifndef _Log_h_
  12. #define _Log_h_
  13. #include <ndis.h>
  14. #include "log_msgs.h"
  15. /* CONSTANTS */
  16. #define LOG_NUMBER_DUMP_DATA_ENTRIES 4
  17. /* module IDs */
  18. #define LOG_MODULE_INIT 1
  19. #define LOG_MODULE_UNLOAD 2
  20. #define LOG_MODULE_NIC 3
  21. #define LOG_MODULE_PROT 4
  22. #define LOG_MODULE_MAIN 5
  23. #define LOG_MODULE_LOAD 6
  24. #define LOG_MODULE_UTIL 7
  25. #define LOG_MODULE_PARAMS 8
  26. #define LOG_MODULE_TCPIP 9
  27. #define MSG_NONE L""
  28. /* MACROS */
  29. // Summary of logging function:
  30. // Log_event (MSG_NAME from log_msgs.mc, "WLBS..." (hardcoded string %2), message 1 (%3), message 2 (%4), message 3 (%5),
  31. // module location (hardcoded first dump data entry), dump data 1, dump data 2, dump data 3, dump data 4);
  32. #define __LOG_MSG(code,msg1) Log_event (code, CVY_NAME, msg1, MSG_NONE, MSG_NONE, __LINE__ | (log_module_id << 16), 0, 0, 0, 0)
  33. #define __LOG_MSG1(code,msg1,d1) Log_event (code, CVY_NAME, msg1, MSG_NONE, MSG_NONE, __LINE__ | (log_module_id << 16), (ULONG)(d1), 0, 0, 0)
  34. #define __LOG_MSG2(code,msg1,d1,d2) Log_event (code, CVY_NAME, msg1, MSG_NONE, MSG_NONE, __LINE__ | (log_module_id << 16), (ULONG)(d1), (ULONG)(d2), 0, 0)
  35. #define LOG_MSG(code,msg1) Log_event (code, ctxtp->log_msg_str, msg1, MSG_NONE, MSG_NONE, __LINE__ | (log_module_id << 16), 0, 0, 0, 0)
  36. #define LOG_MSGS(code,msg1,msg2) Log_event (code, ctxtp->log_msg_str, msg1, msg2, MSG_NONE, __LINE__ | (log_module_id << 16), 0, 0, 0, 0)
  37. #define LOG_MSGS3(code,msg1,msg2,msg3) Log_event (code, ctxtp->log_msg_str, msg1, msg2, msg3, __LINE__ | (log_module_id << 16), 0, 0, 0, 0)
  38. #define LOG_MSG1(code,msg1,d1) Log_event (code, ctxtp->log_msg_str, msg1, MSG_NONE, MSG_NONE, __LINE__ | (log_module_id << 16), (ULONG)(d1), 0, 0, 0)
  39. #define LOG_MSG2(code,msg1,d1,d2) Log_event (code, ctxtp->log_msg_str, msg1, MSG_NONE, MSG_NONE, __LINE__ | (log_module_id << 16), (ULONG)(d1), (ULONG)(d2), 0, 0)
  40. #define LOG_MSG3(code,msg1,d1,d2,d3) Log_event (code, ctxtp->log_msg_str, msg1, MSG_NONE, MSG_NONE, __LINE__ | (log_module_id << 16), (ULONG)(d1), (ULONG)(d2), (ULONG)(d3), 0)
  41. #define LOG_MSG4(code,msg1,d1,d2,d3,d4) Log_event (code, ctxtp->log_msg_str, msg1, MSG_NONE, MSG_NONE, __LINE__ | (log_module_id << 16), (ULONG)(d1), (ULONG)(d2), (ULONG)(d3), (ULONG)(d4))
  42. #define LOG_INFO(msg1) Log_event (MSG_INFO, ctxtp->log_msg_str, msg1, MSG_NONE, MSG_NONE, __LINE__ | (log_module_id << 16), 0, 0, 0, 0)
  43. #define LOG_INFO4(msg1,d1,d2,d3,d4) Log_event (MSG_INFO, ctxtp->log_msg_str, msg1, MSG_NONE, MSG_NONE, __LINE__ | (log_module_id << 16), (ULONG)(d1), (ULONG)(d2), (ULONG)(d3), (ULONG)(d4))
  44. #define LOG_WARN(msg1) Log_event (MSG_WARN, ctxtp->log_msg_str, msg1, MSG_NONE, MSG_NONE, __LINE__ | (log_module_id << 16), 0, 0, 0, 0)
  45. #define LOG_WARN4(msg1,d1,d2,d3,d4) Log_event (MSG_WARN, ctxtp->log_msg_str, msg1, MSG_NONE, MSG_NONE, __LINE__ | (log_module_id << 16), (ULONG)(d1), (ULONG)(d2), (ULONG)(d3), (ULONG)(d4))
  46. #define LOG_ERROR(msg1) Log_event (MSG_ERROR, ctxtp->log_msg_str, msg1, MSG_NONE, MSG_NONE, __LINE__ | (log_module_id << 16), 0, 0, 0, 0)
  47. #define LOG_ERROR4(msg1,d1,d2,d3,d4) Log_event (MSG_ERROR, ctxtp->log_msg_str, msg1, MSG_NONE, MSG_NONE, __LINE__ | (log_module_id << 16), (ULONG)(d1), (ULONG)(d2), (ULONG)(d3), (ULONG)(d4))
  48. /* PROCEDURES */
  49. extern BOOLEAN Log_event (
  50. NTSTATUS code, /* status code */
  51. PWSTR str1, /* message string */
  52. PWSTR str2, /* message string */
  53. PWSTR str3, /* message string */
  54. PWSTR str4, /* message string */
  55. ULONG loc, /* message location identifier */
  56. ULONG d1, /* dump data to enter into the log */
  57. ULONG d2,
  58. ULONG d3,
  59. ULONG d4);
  60. /*
  61. Log system event
  62. returns NTSTATUS:
  63. function:
  64. */
  65. #endif /* _Log_h_ */