Leaked source code of windows server 2003
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.

75 lines
3.0 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. shouse
  11. --*/
  12. #ifndef _Log_h_
  13. #define _Log_h_
  14. #include <ndis.h>
  15. #include "log_msgs.h"
  16. /* CONSTANTS */
  17. #define LOG_NUMBER_DUMP_DATA_ENTRIES 2
  18. /* Module IDs */
  19. #define LOG_MODULE_INIT 1
  20. #define LOG_MODULE_UNLOAD 2
  21. #define LOG_MODULE_NIC 3
  22. #define LOG_MODULE_PROT 4
  23. #define LOG_MODULE_MAIN 5
  24. #define LOG_MODULE_LOAD 6
  25. #define LOG_MODULE_UTIL 7
  26. #define LOG_MODULE_PARAMS 8
  27. #define LOG_MODULE_TCPIP 9
  28. #define LOG_MODULE_LOG 10
  29. #define MSG_NONE L""
  30. // Summary of logging function:
  31. // Log_event (MSG_NAME from log_msgs.mc, cluster IP address (hardcoded string %2), message 1 (%3), message 2 (%4),
  32. // module location (hardcoded first dump data entry), dump data 1, dump data 2);
  33. /* For logging a single message (string) and up to two ULONGs. */
  34. #define __LOG_MSG(code,msg1) Log_event (code, MSG_NONE, msg1, MSG_NONE, __LINE__ | (log_module_id << 16), 0, 0 )
  35. #define LOG_MSG(code,msg1) Log_event (code, ctxtp->log_msg_str, msg1, MSG_NONE, __LINE__ | (log_module_id << 16), 0, 0 )
  36. #define __LOG_MSG1(code,msg1,d1) Log_event (code, MSG_NONE, msg1, MSG_NONE, __LINE__ | (log_module_id << 16), (ULONG)(d1), 0 )
  37. #define LOG_MSG1(code,msg1,d1) Log_event (code, ctxtp->log_msg_str, msg1, MSG_NONE, __LINE__ | (log_module_id << 16), (ULONG)(d1), 0 )
  38. #define __LOG_MSG2(code,msg1,d1,d2) Log_event (code, MSG_NONE, msg1, MSG_NONE, __LINE__ | (log_module_id << 16), (ULONG)(d1), (ULONG)(d2))
  39. #define LOG_MSG2(code,msg1,d1,d2) Log_event (code, ctxtp->log_msg_str, msg1, MSG_NONE, __LINE__ | (log_module_id << 16), (ULONG)(d1), (ULONG)(d2))
  40. /* For logging up to 2 messages (strings) and up to two ULONGs. */
  41. #define LOG_MSGS(code,msg1,msg2) Log_event (code, ctxtp->log_msg_str, msg1, msg2, __LINE__ | (log_module_id << 16), 0, 0 )
  42. #define LOG_MSGS1(code,msg1,msg2,d1) Log_event (code, ctxtp->log_msg_str, msg1, msg2, __LINE__ | (log_module_id << 16), (ULONG)(d1), 0 )
  43. #define LOG_MSGS2(code,msg1,msg2,d1,d2) Log_event (code, ctxtp->log_msg_str, msg1, msg2, __LINE__ | (log_module_id << 16), (ULONG)(d1), (ULONG)(d2))
  44. extern BOOLEAN Log_event
  45. (
  46. NTSTATUS code, /* Status code. */
  47. PWSTR str1, /* Cluster identifier. */
  48. PWSTR str2, /* Message string. */
  49. PWSTR str3, /* Message string. */
  50. ULONG loc, /* Message location identifier. */
  51. ULONG d1, /* Dump data 1. */
  52. ULONG d2 /* Dump data 2. */
  53. );
  54. #endif /* _Log_h_ */