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.

168 lines
5.8 KiB

  1. /*++
  2. Copyright (C) 1998-1999 Microsoft Corporation
  3. Module Name:
  4. common.h
  5. Abstract:
  6. SMONLOG common definitions
  7. --*/
  8. #ifndef _SMONLOG_COMMON_H_
  9. #define _SMONLOG_COMMON_H_
  10. #include <wtypes.h>
  11. #define _CONFIG_DLL_NAME_W_ L"SmLogCfg.dll"
  12. #define _SERVICE_EXE_NAME_W_ L"SmLogSvc.exe"
  13. // Communication between smlogcfg and smlogsvc
  14. #define SERVICE_CONTROL_SYNCHRONIZE 128
  15. #define SLQ_QUERY_STOPPED ((DWORD)0x00000000)
  16. #define SLQ_QUERY_RUNNING ((DWORD)0x00000001)
  17. #define SLQ_QUERY_START_PENDING ((DWORD)0x00000002)
  18. #define SLQ_NEW_LOG ((DWORD)0xFFFFFFFF)
  19. #define SLQ_FIRST_LOG_TYPE ((DWORD)0x00000000)
  20. #define SLQ_COUNTER_LOG ((DWORD)0x00000000)
  21. #define SLQ_TRACE_LOG ((DWORD)0x00000001)
  22. #define SLQ_ALERT ((DWORD)0x00000002)
  23. #define SLQ_LAST_LOG_TYPE ((DWORD)0x00000002)
  24. #define SLQ_NUM_LOG_TYPES ((DWORD)0x00000003)
  25. // Sysmon log output file configuration definitions
  26. #define SLF_FIRST_FILE_TYPE ((DWORD)0x00000000)
  27. #define SLF_CSV_FILE ((DWORD)0x00000000)
  28. #define SLF_TSV_FILE ((DWORD)0x00000001)
  29. #define SLF_BIN_FILE ((DWORD)0x00000002)
  30. #define SLF_BIN_CIRC_FILE ((DWORD)0x00000003)
  31. #define SLF_CIRC_TRACE_FILE ((DWORD)0x00000004)
  32. #define SLF_SEQ_TRACE_FILE ((DWORD)0x00000005)
  33. #define SLF_SQL_LOG ((DWORD)0x00000006)
  34. #define SLF_FILE_OVERWRITE ((DWORD)0x00010000)
  35. #define SLF_NUM_FILE_TYPES ((DWORD)0x00000007)
  36. #define SLF_NAME_NONE ((DWORD)0xFFFFFFFF)
  37. #define SLF_NAME_FIRST_AUTO ((DWORD)0x00000000)
  38. #define SLF_NAME_MMDDHH ((DWORD)0x00000000)
  39. #define SLF_NAME_NNNNNN ((DWORD)0x00000001)
  40. #define SLF_NAME_YYYYDDD ((DWORD)0x00000002)
  41. #define SLF_NAME_YYYYMM ((DWORD)0x00000003)
  42. #define SLF_NAME_YYYYMMDD ((DWORD)0x00000004)
  43. #define SLF_NAME_YYYYMMDDHH ((DWORD)0x00000005)
  44. #define SLF_NAME_MMDDHHMM ((DWORD)0x00000006)
  45. #define SLF_NUM_AUTO_NAME_TYPES ((DWORD)0x00000007)
  46. // Sysmon log query types and constants
  47. // Constants
  48. #define SLQ_DISK_MAX_SIZE ((DWORD)-1)
  49. #define SLQ_TLI_ENABLE_BUFFER_FLUSH ((DWORD)0x00000001)
  50. #define SLQ_TLI_ENABLE_KERNEL_TRACE ((DWORD)0x00000002)
  51. #define SLQ_TLI_ENABLE_MEMMAN_TRACE ((DWORD)0x00000004)
  52. #define SLQ_TLI_ENABLE_FILEIO_TRACE ((DWORD)0x00000008)
  53. #define SLQ_TLI_ENABLE_PROCESS_TRACE ((DWORD)0x00000010)
  54. #define SLQ_TLI_ENABLE_THREAD_TRACE ((DWORD)0x00000020)
  55. #define SLQ_TLI_ENABLE_DISKIO_TRACE ((DWORD)0x00000040)
  56. #define SLQ_TLI_ENABLE_NETWORK_TCPIP_TRACE ((DWORD)0x00000080)
  57. #define SLQ_TLI_ENABLE_MASK ((DWORD)0x000000FF)
  58. #define SLQ_TLI_ENABLE_KERNEL_MASK ((DWORD)0x000000FE)
  59. // dwMode values
  60. #define SLQ_AUTO_MODE_NONE ((DWORD)0x00000000) // Manual
  61. #define SLQ_AUTO_MODE_SIZE ((DWORD)0x00000001) // Size
  62. #define SLQ_AUTO_MODE_AT ((DWORD)0x00000002) // Time
  63. #define SLQ_AUTO_MODE_AFTER ((DWORD)0x00000003) // Value & unit type
  64. // wDataType values
  65. #define SLQ_TT_DTYPE_DATETIME ((WORD)0x0001)
  66. #define SLQ_TT_DTYPE_UNITS ((WORD)0x0002)
  67. // wTimeType values
  68. #define SLQ_TT_TTYPE_START ((WORD)0x0001)
  69. #define SLQ_TT_TTYPE_STOP ((WORD)0x0002)
  70. #define SLQ_TT_TTYPE_RESTART ((WORD)0x0003)
  71. #define SLQ_TT_TTYPE_SAMPLE ((WORD)0x0004)
  72. #define SLQ_TT_TTYPE_LAST_MODIFIED ((WORD)0x0005)
  73. // dwUnitType values
  74. #define SLQ_TT_UTYPE_SECONDS ((DWORD)0x00000001)
  75. #define SLQ_TT_UTYPE_MINUTES ((DWORD)0x00000002)
  76. #define SLQ_TT_UTYPE_HOURS ((DWORD)0x00000003)
  77. #define SLQ_TT_UTYPE_DAYS ((DWORD)0x00000004)
  78. #pragma warning ( disable : 4201 )
  79. typedef struct _SLQ_TIME_INFO {
  80. WORD wDataType;
  81. WORD wTimeType;
  82. DWORD dwAutoMode;
  83. union {
  84. LONGLONG llDateTime; // filetime stored as a LONGLONG
  85. struct {
  86. DWORD dwValue;
  87. DWORD dwUnitType;
  88. };
  89. };
  90. } SLQ_TIME_INFO, *PSLQ_TIME_INFO;
  91. #pragma warning ( default : 4201 )
  92. // alert action flags
  93. #define ALRT_ACTION_LOG_EVENT ((DWORD)0x00000001)
  94. #define ALRT_ACTION_SEND_MSG ((DWORD)0x00000002)
  95. #define ALRT_ACTION_EXEC_CMD ((DWORD)0x00000004)
  96. #define ALRT_ACTION_START_LOG ((DWORD)0x00000008)
  97. #define ALRT_ACTION_MASK ((DWORD)0x0000000F)
  98. #define ALRT_CMD_LINE_SINGLE ((DWORD)0x00000100)
  99. #define ALRT_CMD_LINE_A_NAME ((DWORD)0x00000200)
  100. #define ALRT_CMD_LINE_C_NAME ((DWORD)0x00000400)
  101. #define ALRT_CMD_LINE_D_TIME ((DWORD)0x00000800)
  102. #define ALRT_CMD_LINE_L_VAL ((DWORD)0x00001000)
  103. #define ALRT_CMD_LINE_M_VAL ((DWORD)0x00002000)
  104. #define ALRT_CMD_LINE_U_TEXT ((DWORD)0x00004000)
  105. #define ALRT_CMD_LINE_MASK ((DWORD)0x00007F00)
  106. #define ALRT_DEFAULT_ACTION ((DWORD)0x00000001) // log event is default
  107. #define AIBF_UNDER 0L
  108. #define AIBF_OVER ((DWORD)0x00000001) // true when "over" limit is selected
  109. #define AIBF_SEEN ((DWORD)0x00000002) // set when the user has seen this value
  110. #define AIBF_SAVED ((DWORD)0x00000004) // true when user has saved this entry in an edit box
  111. #ifdef __cplusplus
  112. extern "C" {
  113. #endif
  114. typedef struct _ALERT_INFO_BLOCK {
  115. DWORD dwSize;
  116. LPTSTR szCounterPath;
  117. DWORD dwFlags;
  118. double dLimit;
  119. } ALERT_INFO_BLOCK, *PALERT_INFO_BLOCK;
  120. // functions found in utils.c
  121. // Replace spaces with underscores.
  122. void __stdcall ReplaceBlanksWithUnderscores ( LPWSTR szString);
  123. BOOL __stdcall MakeInfoFromString (LPCTSTR szBuffer, PALERT_INFO_BLOCK pInfo, LPDWORD pdwBufferSize);
  124. BOOL __stdcall MakeStringFromInfo (PALERT_INFO_BLOCK pInfo, LPTSTR szBuffer, LPDWORD pcchBufferLength);
  125. BOOL __stdcall GetLocalFileTime (LONGLONG *pFileTime );
  126. DWORD __stdcall ParseFolderPath (LPCTSTR szOrigPath, LPTSTR szBuffer, INT* piBufLen );
  127. void __stdcall TimeInfoToMilliseconds ( SLQ_TIME_INFO* pTimeInfo, LONGLONG* pllmsecs );
  128. #ifdef __cplusplus
  129. }
  130. #endif
  131. #endif //_SMONLOG_COMMON_H_