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.

188 lines
6.8 KiB

  1. //***************************************************************************
  2. //
  3. // NTEVTDEFS.H
  4. //
  5. // Module: WBEM NT EVENT PROVIDER
  6. //
  7. // Copyright (c) 1996-2001 Microsoft Corporation, All Rights Reserved
  8. //
  9. //***************************************************************************
  10. #ifndef _NT_EVT_PROV_NTEVTDEFS_H
  11. #define _NT_EVT_PROV_NTEVTDEFS_H
  12. #define ELF_LOGFILE_READ 0x0001
  13. #define ELF_LOGFILE_WRITE 0x0002
  14. #define ELF_LOGFILE_CLEAR 0x0004
  15. #define ELF_LOGFILE_START 0x0008
  16. #define ELF_LOGFILE_STOP 0x000C
  17. #define ELF_LOGFILE_CONFIGURE 0x0010
  18. #define ELF_LOGFILE_BACKUP 0x0020
  19. #define ELF_LOGFILE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | \
  20. ELF_LOGFILE_READ | \
  21. ELF_LOGFILE_WRITE | \
  22. ELF_LOGFILE_CLEAR | \
  23. ELF_LOGFILE_START | \
  24. ELF_LOGFILE_STOP | \
  25. ELF_LOGFILE_CONFIGURE)
  26. #define ELF_LOGFILE_OBJECT_ACES 12 // Number of ACEs in this DACL
  27. #define NT_EVTLOG_MAX_CLASSES 7
  28. #define SECURITY_MUTEX_NAME L"Cimom NT Security API protector"
  29. #define PERFORMANCE_MUTEX_NAME L"WbemPerformanceDataMutex"
  30. #define EVENTTHREADNAME L"Eventlog Monitor"
  31. BOOL ObtainedSerialAccess(CMutex* pLock);
  32. void ReleaseSerialAccess(CMutex* pLock);
  33. #define HKEYCLASSES L"SOFTWARE\\Classes\\"
  34. #define TYPE_ARRAY_LEN 6
  35. #define RETENTION_ARRAY_LEN 3
  36. typedef ULONG (*GetIndexFunc)(const wchar_t*, BOOL*);
  37. #define WBEM_QUERY_LANGUAGE_SQL1 L"WQL"
  38. #define LOGON_EVTID 2147489653
  39. #define LOGON_SOURCE L"eventlog"
  40. #define LOGON_TIME 1800 //30 MINS
  41. #define SYSTEM_PROPERTY_CLASS L"__CLASS"
  42. #define SYSTEM_PROPERTY_SUPERCLASS L"__SUPERCLASS"
  43. #define SYSTEM_PROPERTY_DYNASTY L"__DYNASTY"
  44. #define SYSTEM_PROPERTY_DERIVATION L"__DERIVATION"
  45. #define SYSTEM_PROPERTY_GENUS L"__GENUS"
  46. #define SYSTEM_PROPERTY_NAMESPACE L"__NAMESPACE"
  47. #define SYSTEM_PROPERTY_PROPERTY_COUNT L"__PROPERTY_COUNT"
  48. #define SYSTEM_PROPERTY_SERVER L"__SERVER"
  49. #define SYSTEM_PROPERTY_RELPATH L"__RELPATH"
  50. #define SYSTEM_PROPERTY_PATH L"__PATH"
  51. #define EVENT_CLASS L"__InstanceCreationEvent"
  52. #define SD_PROP L"SECURITY_DESCRIPTOR"
  53. #define TARGET_PROP L"TargetInstance"
  54. #define NTEVT_CLASS L"Win32_NTLogEvent"
  55. #define RECORD_PROP L"RecordNumber"
  56. #define LOGFILE_PROP L"Logfile"
  57. #define EVTID_PROP L"EventIdentifier"
  58. #define EVTID2_PROP L"EventCode"
  59. #define SOURCE_PROP L"SourceName"
  60. #define TYPE_PROP L"Type"
  61. #define EVTTYPE_PROP L"EventType"
  62. #define CATEGORY_PROP L"Category"
  63. #define CATSTR_PROP L"CategoryString"
  64. #define GENERATED_PROP L"TimeGenerated"
  65. #define WRITTEN_PROP L"TimeWritten"
  66. #define COMPUTER_PROP L"ComputerName"
  67. #define USER_PROP L"User"
  68. #define MESSAGE_PROP L"Message"
  69. #define INSSTRS_PROP L"InsertionStrings"
  70. #define DATA_PROP L"Data"
  71. #define EVT_ENUM_QUAL L"Values"
  72. #define EVT_MAP_QUAL L"ValueMap"
  73. #define EVENTLOG_BASE L"SYSTEM\\CurrentControlSet\\Services\\Eventlog"
  74. #define MSG_MODULE L"EventMessageFile"
  75. #define PARAM_MODULE L"ParameterMessageFile"
  76. #define PRIM_MODULE L"PrimaryModule"
  77. #define CAT_MODULE L"CategoryMessageFile"
  78. #define GUEST_ACCESS L"RestrictGuestAccess"
  79. #define SYSTEM_LOG L"System"
  80. #define SECURITY_LOG L"Security"
  81. // {F55C5B4C-517D-11d1-AB57-00C04FD9159E}
  82. DEFINE_GUID(CLSID_CNTEventProviderClassFactory,
  83. 0xf55c5b4c, 0x517d, 0x11d1, 0xab, 0x57, 0x0, 0xc0, 0x4f, 0xd9, 0x15, 0x9e);
  84. #define WBEM_PROPERTY_STATUSCODE L"StatusCode"
  85. #define WBEM_PROPERTY_PROVSTATUSCODE L"ProvStatusCode"
  86. #define WBEM_PROPERTY_PROVSTATUSMESSAGE L"Description"
  87. #define WBEM_PROPERTY_PRIVNOTHELD L"PrivilegesNotHeld"
  88. #define WBEM_PROPERTY_PRIVREQUIRED L"PrivilegesRequired"
  89. #define CLASS_PROP L"__CLASS"
  90. #define EVTLOG_REG_FILE_VALUE L"File"
  91. #define EVTLOG_REG_RETENTION_VALUE L"Retention"
  92. #define EVTLOG_REG_MAXSZ_VALUE L"MaxSize"
  93. #define EVTLOG_REG_SOURCES_VALUE L"Sources"
  94. #define NTEVTLOG_CLASS L"Win32_NTEventlogFile"
  95. #define PROP_MAXSZ L"MaxFileSize"
  96. #define PROP_RETENTION L"OverWriteOutDated"
  97. #define PROP_LOGNAME L"LogfileName"
  98. #define PROP_NUMRECS L"NumberOfRecords"
  99. #define PROP_RETENTION_STR L"OverWritePolicy"
  100. #define PROP_SOURCES L"Sources"
  101. #define PROP_NAME L"Name"
  102. #define PROP_CS_CRE_CLASS L"CSCreationClassName"
  103. #define PROP_CRE_CLASS L"CreationClassName"
  104. #define PROP_FS_CRE_CLASS L"FSCreationClassName"
  105. #define PROP_FS_NAME L"FSName"
  106. #define VAL_FS_CRE_CLASS L"Win32_FileSystem"
  107. #ifdef VERSION_ISA_PROPERTY
  108. #define PROP_VERSION L"Version"
  109. #endif
  110. #define METHOD_RESOBJ L"__Parameters"
  111. #define METHOD_CLEAR L"ClearEventlog"
  112. #define METHOD_BACKUP L"BackupEventlog"
  113. #define METHOD_PARAM L"ArchiveFileName"
  114. #define METHOD_RESULT_PARAM L"ReturnValue"
  115. #define FILE_CHUNK_SZ 0x00010000
  116. #define MAX_EVT_LOG_SZ 0xffff0000
  117. #define MAX_EVT_AGE 365
  118. #define EVT_NEVER_AGE 0xffffffff
  119. #define EVT_UNITS_FROM_DAYS (60*60*24) //from days to seconds
  120. #define CONFIG_CLASS L"NTEventlogProviderConfig"
  121. #define CONFIG_INSTANCE L"NTEventlogProviderConfig=@"
  122. #define COMP_CLASS L"Win32_ComputerSystem"
  123. #define LAST_BOOT_PROP L"LastBootUpTime"
  124. #define USER_CLASS L"Win32_UserAccount"
  125. #define ASSOC_LOGRECORD L"Win32_NTLogEventLog"
  126. #define ASSOC_USERRECORD L"Win32_NTLogEventUser"
  127. #define ASSOC_COMPRECORD L"Win32_NTLogEventComputer"
  128. #define REF_LOG L"Log"
  129. #define REF_REC L"Record"
  130. #define REF_USER L"User"
  131. #define REF_COMP L"Computer"
  132. #define PROP_DOMAIN L"Domain"
  133. #define PROP_START_LOG CStringW(CStringW(NTEVTLOG_CLASS) + CStringW(L'.') + CStringW(PROP_NAME) + CStringW(L"=\""))
  134. #define PROP_START_REC CStringW(CStringW(NTEVT_CLASS) + CStringW(L'.') + CStringW(LOGFILE_PROP) + CStringW(L"=\""))
  135. #define PROP_MID_REC CStringW(CStringW(L"\",") + CStringW(RECORD_PROP) + CStringW(L'='))
  136. #define PROP_START_COMP CStringW(CStringW(COMP_CLASS) + CStringW(L".Name=\""))
  137. #define PROP_START_USER CStringW(CStringW(USER_CLASS) + CStringW(L".Domain=\""))
  138. #define PROP_MID_USER CStringW(L"\",Name=\"")
  139. #define ENUM_INST_QUERY_START CStringW(L"select * from ")
  140. #define ENUM_INST_QUERY_MID CStringW(L" where __CLASS = \"")
  141. #define PROP_END_QUOTE CStringW(L"\"")
  142. // {D2E4F828-65E4-11d1-AB64-00C04FD9159E}
  143. DEFINE_GUID(CLSID_CNTEventLocatorClassFactory,
  144. 0xd2e4f828, 0x65e4, 0x11d1, 0xab, 0x64, 0x0, 0xc0, 0x4f, 0xd9, 0x15, 0x9e);
  145. // {FD4F53E0-65DC-11d1-AB64-00C04FD9159E}
  146. DEFINE_GUID(CLSID_CNTEventInstanceProviderClassFactory,
  147. 0xfd4f53e0, 0x65dc, 0x11d1, 0xab, 0x64, 0x0, 0xc0, 0x4f, 0xd9, 0x15, 0x9e);
  148. #endif //_NT_EVT_PROV_NTEVTDEFS_H