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.

400 lines
14 KiB

  1. // (c) 1998-1999 Microsoft Corporation. All rights reserved.
  2. #pragma autorecover
  3. #pragma classflags("forceupdate")
  4. Qualifier Description : ToSubClass Amended;
  5. Qualifier Values : ToSubClass Amended;
  6. Qualifier DisplayName : Amended;
  7. Qualifier BitValues:ToSubClass Amended ;
  8. Qualifier Aggregate : ToSubClass ;
  9. Qualifier ValueMap : ToSubClass ;
  10. Qualifier Aggregation : ToSubClass ;
  11. Qualifier ArrayType : ToSubClass ;
  12. Qualifier Association : ToInstance ToSubClass DisableOverride ;
  13. Qualifier BitMap : ToSubClass ;
  14. Qualifier CIM_Key : ToSubClass ;
  15. Qualifier CIMTYPE : ToSubClass ;
  16. Qualifier Deprecated : ToSubClass ;
  17. Qualifier Enumeration : ToSubClass ;
  18. Qualifier EnumPrivileges : ToSubClass ;
  19. Qualifier Fixed : ToSubclass;
  20. Qualifier ImplementationSource : ToSubClass ;
  21. Qualifier Key : ToInstance ToSubClass DisableOverride ;
  22. Qualifier Locale : ToInstance ;
  23. Qualifier MappingStrings : ToSubClass ;
  24. Qualifier Max : ToSubClass ;
  25. Qualifier MaxLen : ToSubClass ;
  26. Qualifier Min : ToSubClass ;
  27. Qualifier ModelCorrespondence : ToSubClass ;
  28. Qualifier Not_Null : ToSubClass ;
  29. Qualifier Override : Restricted ;
  30. Qualifier Privileges : ToSubClass ;
  31. Qualifier Propagated : ToSubClass ;
  32. Qualifier provider : ToInstance ;
  33. Qualifier Range : ToSubClass ;
  34. Qualifier Read : ToSubClass ;
  35. Qualifier Schema : ToInstance ;
  36. Qualifier Singleton : ToSubClass ToInstance ;
  37. Qualifier SUBTYPE : ToSubClass ;
  38. Qualifier Units : ToSubClass ;
  39. Qualifier UUID : ToInstance ;
  40. Qualifier Volatile : ToSubClass ;
  41. Qualifier Weak : ToSubClass ;
  42. Qualifier Write : ToSubClass ;
  43. Qualifier WritePrivileges : ToSubClass ;
  44. #pragma namespace ("\\\\.\\Root\\CIMV2")
  45. [singleton,
  46. Locale (0x409), UUID ("{8502C57A-5FBB-11D2-AAC1-006008C78BC7}")]
  47. class NTEventlogProviderConfig
  48. {
  49. datetime LastBootUpTime;
  50. };
  51. instance of __Win32Provider as $DataProv
  52. {
  53. Name = "MS_NT_EVENTLOG_PROVIDER";
  54. ClsId = "{FD4F53E0-65DC-11d1-AB64-00C04FD9159E}";
  55. ImpersonationLevel = 1;
  56. PerUserInitialization = "TRUE";
  57. HostingModel = "NetworkServiceHost";
  58. };
  59. instance of __MethodProviderRegistration
  60. {
  61. Provider = $DataProv;
  62. };
  63. instance of __InstanceProviderRegistration
  64. {
  65. Provider = $DataProv;
  66. SupportsPut = TRUE;
  67. SupportsGet = TRUE;
  68. SupportsDelete = FALSE;
  69. SupportsEnumeration = TRUE;
  70. QuerySupportLevels = {"WQL:UnarySelect"};
  71. };
  72. [dynamic,
  73. provider("MS_NT_EVENTLOG_PROVIDER"), SupportsUpdate,
  74. Locale (0x409), UUID ("{8502C57B-5FBB-11D2-AAC1-006008C78BC7}")]
  75. class Win32_NTEventlogFile : CIM_DataFile
  76. {
  77. [Fixed, Description("The LogFileName property indicates name of the log file."),
  78. read]
  79. string LogfileName;
  80. [Description("The MaxFileSize property indicates the maximum size "
  81. "(in bytes) permitted for the log file. If "
  82. "the file exceeds its maximum size, its contents are moved to "
  83. "another file and the primary file is emptied. A value of zero "
  84. "indicates no size limit. "),
  85. read,
  86. write]
  87. uint32 MaxFileSize;
  88. [Description("Number of records in the log file. This value is determined "
  89. "by calling the Win32 function GetNumberOfEventLogRecords."),
  90. read]
  91. uint32 NumberOfRecords;
  92. [Description("Current overwrite policy the Windows NT/Windows 2000 "
  93. "Event Log service employs for this log file. The possible values "
  94. "of the property are: \n"
  95. "WhenNeeded - This corresponds to OverWriteOutdated = 0.\n"
  96. "OutDated - This corresponds to OverWriteOutdated of 1 to 365.\n"
  97. "Never - This corresponds to OverWriteOutdated = 4294967295. \n"
  98. "There is an interdependence between the OverWriteOutDated property "
  99. "(which is writable) value and the OverWritePolicy property "
  100. "(which is not writable) value.\n"
  101. "If one changes the OverWriteOutDated property value to 0, "
  102. "the OverWritePolicy property value will be 'henNeeded' \n"
  103. "If one changes the OverWriteOutDated property value to 1-365, "
  104. "the OverWritePolicy property value will be 'outDated' \n"
  105. "If one changes the OverWriteOutDated property value to 4294967295, "
  106. "the OverWritePolicy property value will be 'Never'."),
  107. read,
  108. volatile,
  109. ValueMap {"0", "1..365", "4294967295"} ,
  110. Values {"WhenNeeded", "OutDated", "Never"} ]
  111. string OverWritePolicy;
  112. [Description("Number of days after which an event can be overwritten. "
  113. "Values are:\n"
  114. "0 = Any entry can be overwritten when necessary."
  115. "1..365 = Events that have been in the log file for one "
  116. "year (365 days) or less can be overwritten."
  117. "4294967295 = Nothing can be ever be overwritten. \n"
  118. "There is an interdependence between the OverWriteOutDated property "
  119. "(which is writable) value and the OverWritePolicy property "
  120. "(which is not writable) value.\n"
  121. "If one changes the OverWriteOutDated property value to 0, "
  122. "the OverWritePolicy property value will be 'henNeeded' \n"
  123. "If one changes the OverWriteOutDated property value to 1-365, "
  124. "the OverWritePolicy property value will be 'outDated' \n"
  125. "If one changes the OverWriteOutDated property value to 4294967295, "
  126. "the OverWritePolicy property value will be 'Never'."),
  127. read,
  128. write,
  129. Units("Days"),
  130. Range("0-365 | 4294967295")]
  131. uint32 OverwriteOutDated;
  132. [Description("The Sources property indicates the applications "
  133. "that are registered to log into this log file."),
  134. read]
  135. string Sources[];
  136. //Methods
  137. [Description("Clears the specified event log, and optionally "
  138. "saves the current copy of the logfile to a backup file. "
  139. "The method returns an integer value that can be "
  140. "interpretted as follows: \n"
  141. "0 - Successful completion.\n"
  142. "8 - The user does not have adequate privileges.\n"
  143. "21 - Invalid parameter.\n"
  144. "Other - For integer values other than those listed above, "
  145. "refer to Win32 error code documentation."): ToSubClass,
  146. Values{ "Success",
  147. "Privilege missing",
  148. "Invalid parameter",
  149. "Other" },
  150. ValueMap{ "0", "8", "21", ".." },
  151. implemented,
  152. Privileges{"SeSecurityPrivilege", "SeBackupPrivilege"}]
  153. uint32 ClearEventlog(
  154. [Description("String specifying the name of a "
  155. "file in which a current copy of the event logfile will be placed. "
  156. "If this file already exists, the function fails. "),
  157. in]
  158. string ArchiveFileName
  159. );
  160. [Description("Saves the specified event log to a backup file. "
  161. "The method returns an integer value that can be "
  162. "interpretted as follows: \n"
  163. "0 - Successful completion.\n"
  164. "8 - The user does not have adequate privileges.\n"
  165. "21 - Invalid parameter.\n"
  166. "183 - Archive file name already exists. Cannot create file. \n"
  167. "Other - For integer values other than those listed above, "
  168. "refer to Win32 error code documentation."): ToSubClass,
  169. Values{ "Success",
  170. "Privilege missing",
  171. "Invalid parameter",
  172. "Archive file name already exists.",
  173. "Other" },
  174. ValueMap{ "0", "8", "21", "183", ".." },
  175. implemented,
  176. Privileges{"SeSecurityPrivilege", "SeBackupPrivilege"}]
  177. uint32 BackupEventlog(
  178. [Description("String specifying the name of the backup file."),
  179. in]
  180. string ArchiveFileName
  181. );
  182. };
  183. [DisplayName("NT Log Events"), Privileges{"SeSecurityPrivilege"},
  184. Dynamic, Provider("MS_NT_EVENTLOG_PROVIDER"), EnumPrivileges{"SeSecurityPrivilege"},
  185. Description("This class is used to translate instances from the NT Eventlog."),
  186. Locale (0x409), UUID ("{8502C57C-5FBB-11D2-AAC1-006008C78BC7}")]
  187. class Win32_NTLogEvent
  188. {
  189. [DisplayName ("Record Number"), Key,
  190. Description ("Identifies the event within the NT Eventlog logfile. This "
  191. "is specific to the logfile and is used together with the logfile name to "
  192. "uniquely identify an instance of this class.")
  193. ]
  194. uint32 RecordNumber;
  195. [DisplayName ("Log File"), Key,
  196. Description ("The name of NT Eventlog logfile. This is used together with "
  197. "the RecordNumber to uniquely identify an instance of this class.")
  198. ]
  199. string Logfile;
  200. [Fixed, DisplayName("Event Identifier"), Description("Identifies the event. "
  201. "This is specific to the source that generated the event log entry, and "
  202. "is used, together with SourceName, to uniquely identify an NT event type.")
  203. ]
  204. uint32 EventIdentifier;
  205. [DisplayName("Event Code"), Description("This property has the value of "
  206. "the lower 16-bits of the EventIdentifier property. It is present to match "
  207. "the value displayed in the NT Event Viewer. NOTE: Two events from the same "
  208. "source may have the same value for this property but may have different "
  209. "severity and EventIdentifier values")
  210. ]
  211. uint16 EventCode;
  212. [Fixed, DisplayName("Source Name"), Description("The variable-length null-terminated "
  213. "string specifying the name of the source (application, service, driver, "
  214. "subsystem) that generated the entry. It is used, together with the "
  215. "EventIdentifier, to uniquely identify an NT event type.")
  216. ]
  217. string SourceName;
  218. [Fixed, DisplayName("Type"), Description("Specifies the type of event. This "
  219. "is an enumerated string"),
  220. ValueMap {"0", "1", "2", "4", "8", "16"},
  221. Values {"Success", "Error", "Warning", "Information", "Audit Success", "Audit Failure"}
  222. ]
  223. string Type;
  224. [DisplayName("Category"), Description("Specifies a subcategory for "
  225. "this event. This subcategory is source specific.")
  226. ]
  227. uint16 Category;
  228. [DisplayName("Category String"), Description("Specifies the translation "
  229. "of the subcategory. The translation is source specific.")
  230. ]
  231. string CategoryString;
  232. [Fixed, DisplayName("Time Generated"), Description("Specifies the time at "
  233. "which the source generated the event.")
  234. ]
  235. datetime TimeGenerated;
  236. [Fixed, DisplayName("Time Written"), Description("Specifies the time at which "
  237. "the event was written to the logfile.")
  238. ]
  239. datetime TimeWritten;
  240. [Fixed, DisplayName("Computer Name"), Description("The variable-length "
  241. "null-terminated string specifying the name of the computer that "
  242. "generated this event.")
  243. ]
  244. string ComputerName;
  245. [DisplayName("User Name"), Description("The user name of the logged on "
  246. "user when the event ocurred. If the user name cannot be determined "
  247. "this will be NULL")
  248. ]
  249. string User;
  250. [DisplayName("Message"), Description("The event message as it appears "
  251. "in the NT Eventlog. This is a standard message with zero or more "
  252. "insertion strings supplied by the source of the NT event. The "
  253. "insertion strings are inserted into the standard message in a "
  254. "predefined format. If there are no insertion strings or there is a "
  255. "problem inserting the insertion strings, only the standard message "
  256. "will be present in this field.")
  257. ]
  258. string Message;
  259. [DisplayName("Insertion Strings"), Description("The insertion strings "
  260. "that accompanied the report of the NT event.")
  261. ]
  262. string InsertionStrings[ ];
  263. [DisplayName("Binary Data"), Description("The binary data that "
  264. "accompanied the report of the NT event.")
  265. ]
  266. Uint8 Data[ ];
  267. [Fixed, Description ("The Type property specifies the type of event."),
  268. DisplayName("Type Event"),
  269. ValueMap {"0", "1", "2", "3","4","5"},
  270. Values {"Success", "Error", "Warning", "Information",
  271. "Security Audit Success","Security Audit Failure"}]
  272. uint8 EventType;
  273. };
  274. // RuleBased("Select * From "
  275. // "Win32_NTLogEvent As A "
  276. // "Join "
  277. // "Win32_NTEventLogFile As B "
  278. // "On A.LogFile = B.LogFileName")
  279. [Description("The Win32_NTLogEventLog class represents an association "
  280. "between an NT log event and the log file that contains the event."),
  281. dynamic,
  282. provider("MS_NT_EVENTLOG_PROVIDER"),
  283. EnumPrivileges{"SeSecurityPrivilege"},
  284. Privileges{"SeSecurityPrivilege"},
  285. Locale (0x409),
  286. UUID ("{8502C57D-5FBB-11D2-AAC1-006008C78BC7}"),
  287. Association: ToInstance]
  288. class Win32_NTLogEventLog
  289. {
  290. [Description("The Log property references the log file that "
  291. "contains the NT log event."),
  292. Key,
  293. read]
  294. Win32_NTEventlogFile ref Log;
  295. [Description("The Record property references an NT log event."),
  296. Key,
  297. read]
  298. Win32_NTLogEvent ref Record;
  299. };
  300. [Description("The Win32_NTLogEventUser class represents an association "
  301. "between an NT log event and the active user at the time the "
  302. "event was logged. "),
  303. dynamic,
  304. provider("MS_NT_EVENTLOG_PROVIDER"),
  305. EnumPrivileges{"SeSecurityPrivilege"},
  306. Privileges{"SeSecurityPrivilege"},
  307. Locale (0x409),
  308. UUID ("{8502C57E-5FBB-11D2-AAC1-006008C78BC7}"),
  309. Association: ToInstance]
  310. class Win32_NTLogEventUser
  311. {
  312. [Description("The User property references the active user "
  313. "at the time the event was logged."),
  314. Key,
  315. read]
  316. Win32_UserAccount ref User;
  317. [Description("The Record property references an NT log event."),
  318. Key,
  319. read]
  320. Win32_NTLogEvent ref Record;
  321. };
  322. //RuleBased("Select * From "
  323. // "Win32_ComputerSystem As A "
  324. // "Join "
  325. // "Win32_NTLogEvent As B "
  326. // "On A.Name = B.ComputerName")
  327. [Description("The Win32_NTLogEventComputer class represents an association "
  328. "between an NT log event and the computer from which the event "
  329. "was generated."),
  330. dynamic,
  331. provider("MS_NT_EVENTLOG_PROVIDER"),
  332. EnumPrivileges{"SeSecurityPrivilege"},
  333. Privileges{"SeSecurityPrivilege"},
  334. Locale (0x409),
  335. UUID ("{8502C57F-5FBB-11D2-AAC1-006008C78BC7}"),
  336. Association: ToInstance]
  337. class Win32_NTLogEventComputer
  338. {
  339. [Description("The Computer property references the computer from which "
  340. "the event was generated."),
  341. Key,
  342. read]
  343. Win32_ComputerSystem ref Computer;
  344. [Description("The Record property references an NT log event."),
  345. Key,
  346. read]
  347. Win32_NTLogEvent ref Record;
  348. };
  349. instance of __Win32Provider as $EventProv
  350. {
  351. Name = "MS_NT_EVENTLOG_EVENT_PROVIDER";
  352. ClsId = "{F55C5B4C-517D-11d1-AB57-00C04FD9159E}";
  353. HostingModel = "LocalSystemHost";
  354. };
  355. instance of __EventProviderRegistration
  356. {
  357. Provider = $EventProv;
  358. EventQueryList = {"select * from __InstanceCreationEvent where TargetInstance isa \"Win32_NTLogEvent\""};
  359. };