jwawmistr.pas 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603
  1. {******************************************************************************}
  2. { }
  3. { WMI Structure Definitions API interface Unit for Object Pascal }
  4. { }
  5. { Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft }
  6. { Corporation. All Rights Reserved. }
  7. { }
  8. { The original file is: wmistr.h, released November 2002. The original Pascal }
  9. { code is: WmiStr.pas, released April 2002. The initial developer of the }
  10. { Pascal code is Marcel van Brakel (brakelm att chello dott nl). }
  11. { }
  12. { Portions created by Marcel van Brakel are Copyright (C) 1999-2001 }
  13. { Marcel van Brakel. All Rights Reserved. }
  14. { }
  15. { Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI) }
  16. { }
  17. { You may retrieve the latest version of this file at the Project JEDI }
  18. { APILIB home page, located at http://jedi-apilib.sourceforge.net }
  19. { }
  20. { The contents of this file are used with permission, subject to the Mozilla }
  21. { Public License Version 1.1 (the "License"); you may not use this file except }
  22. { in compliance with the License. You may obtain a copy of the License at }
  23. { http://www.mozilla.org/MPL/MPL-1.1.html }
  24. { }
  25. { Software distributed under the License is distributed on an "AS IS" basis, }
  26. { WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
  27. { the specific language governing rights and limitations under the License. }
  28. { }
  29. { Alternatively, the contents of this file may be used under the terms of the }
  30. { GNU Lesser General Public License (the "LGPL License"), in which case the }
  31. { provisions of the LGPL License are applicable instead of those above. }
  32. { If you wish to allow use of your version of this file only under the terms }
  33. { of the LGPL License and not to allow others to use your version of this file }
  34. { under the MPL, indicate your decision by deleting the provisions above and }
  35. { replace them with the notice and other provisions required by the LGPL }
  36. { License. If you do not delete the provisions above, a recipient may use }
  37. { your version of this file under either the MPL or the LGPL License. }
  38. { }
  39. { For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
  40. { }
  41. {******************************************************************************}
  42. unit JwaWmiStr;
  43. {$WEAKPACKAGEUNIT}
  44. {$HPPEMIT ''}
  45. {$HPPEMIT '#include "wmistr.h"'}
  46. {$HPPEMIT ''}
  47. {$I jediapilib.inc}
  48. interface
  49. uses
  50. JwaWinType, JwaWinNT;
  51. //
  52. // WNODE definition
  53. type
  54. _WNODE_HEADER = record
  55. BufferSize: ULONG; // Size of entire buffer inclusive of this ULONG
  56. ProviderId: ULONG; // Provider Id of driver returning this buffer
  57. U1: record
  58. case Integer of
  59. 0: (
  60. HistoricalContext: ULONG64); // Logger use
  61. 1: (
  62. Version: ULONG; // Reserved
  63. Linkage: ULONG); // Linkage field reserved for WMI
  64. end;
  65. u2: record
  66. case Integer of
  67. 0: (CountLost: ULONG); // Reserved
  68. 1: (KernelHandle: HANDLE); // Kernel handle for data block
  69. 2: (TimeStamp: LARGE_INTEGER); // Timestamp as returned in units of 100ns
  70. // since 1/1/1601
  71. end;
  72. Guid: GUID; // Guid for data block returned with results
  73. ClientContext: ULONG;
  74. Flags: ULONG; // Flags, see below
  75. end;
  76. {$EXTERNALSYM _WNODE_HEADER}
  77. WNODE_HEADER = _WNODE_HEADER;
  78. {$EXTERNALSYM WNODE_HEADER}
  79. PWNODE_HEADER = ^WNODE_HEADER;
  80. {$EXTERNALSYM PWNODE_HEADER}
  81. TWNodeHeader = WNODE_HEADER;
  82. PWNodeHeader = PWNODE_HEADER;
  83. //
  84. // WNODE_HEADER flags are defined as follows
  85. const
  86. WNODE_FLAG_ALL_DATA = $00000001; // set for WNODE_ALL_DATA
  87. {$EXTERNALSYM WNODE_FLAG_ALL_DATA}
  88. WNODE_FLAG_SINGLE_INSTANCE = $00000002; // set for WNODE_SINGLE_INSTANCE
  89. {$EXTERNALSYM WNODE_FLAG_SINGLE_INSTANCE}
  90. WNODE_FLAG_SINGLE_ITEM = $00000004; // set for WNODE_SINGLE_ITEM
  91. {$EXTERNALSYM WNODE_FLAG_SINGLE_ITEM}
  92. WNODE_FLAG_EVENT_ITEM = $00000008; // set for WNODE_EVENT_ITEM
  93. {$EXTERNALSYM WNODE_FLAG_EVENT_ITEM}
  94. // Set if data block size is
  95. // identical for all instances
  96. // (used with WNODE_ALL_DATA
  97. // only)
  98. WNODE_FLAG_FIXED_INSTANCE_SIZE = $00000010;
  99. {$EXTERNALSYM WNODE_FLAG_FIXED_INSTANCE_SIZE}
  100. WNODE_FLAG_TOO_SMALL = $00000020; // set for WNODE_TOO_SMALL
  101. {$EXTERNALSYM WNODE_FLAG_TOO_SMALL}
  102. // Set when a data provider returns a
  103. // WNODE_ALL_DATA in which the number of
  104. // instances and their names returned
  105. // are identical to those returned from the
  106. // previous WNODE_ALL_DATA query. Only data
  107. // blocks registered with dynamic instance
  108. // names should use this flag.
  109. WNODE_FLAG_INSTANCES_SAME = $00000040;
  110. {$EXTERNALSYM WNODE_FLAG_INSTANCES_SAME}
  111. // Instance names are not specified in
  112. // WNODE_ALL_DATA; values specified at
  113. // registration are used instead. Always
  114. // set for guids registered with static
  115. // instance names
  116. WNODE_FLAG_STATIC_INSTANCE_NAMES = $00000080;
  117. {$EXTERNALSYM WNODE_FLAG_STATIC_INSTANCE_NAMES}
  118. WNODE_FLAG_INTERNAL = $00000100; // Used internally by WMI
  119. {$EXTERNALSYM WNODE_FLAG_INTERNAL}
  120. // timestamp should not be modified by
  121. // a historical logger
  122. WNODE_FLAG_USE_TIMESTAMP = $00000200;
  123. {$EXTERNALSYM WNODE_FLAG_USE_TIMESTAMP}
  124. WNODE_FLAG_PERSIST_EVENT = $00000400;
  125. {$EXTERNALSYM WNODE_FLAG_PERSIST_EVENT}
  126. WNODE_FLAG_EVENT_REFERENCE = $00002000;
  127. {$EXTERNALSYM WNODE_FLAG_EVENT_REFERENCE}
  128. // Set if Instance names are ansi. Only set when returning from
  129. // WMIQuerySingleInstanceA and WMIQueryAllDataA
  130. WNODE_FLAG_ANSI_INSTANCENAMES = $00004000;
  131. {$EXTERNALSYM WNODE_FLAG_ANSI_INSTANCENAMES}
  132. // Set if WNODE is a method call
  133. WNODE_FLAG_METHOD_ITEM = $00008000;
  134. {$EXTERNALSYM WNODE_FLAG_METHOD_ITEM}
  135. // Set if instance names originated from a PDO
  136. WNODE_FLAG_PDO_INSTANCE_NAMES = $00010000;
  137. {$EXTERNALSYM WNODE_FLAG_PDO_INSTANCE_NAMES}
  138. // The second byte, except the first bit is used exclusively for tracing
  139. WNODE_FLAG_TRACED_GUID = $00020000; // denotes a trace
  140. {$EXTERNALSYM WNODE_FLAG_TRACED_GUID}
  141. WNODE_FLAG_LOG_WNODE = $00040000; // request to log Wnode
  142. {$EXTERNALSYM WNODE_FLAG_LOG_WNODE}
  143. WNODE_FLAG_USE_GUID_PTR = $00080000; // Guid is actually a pointer
  144. {$EXTERNALSYM WNODE_FLAG_USE_GUID_PTR}
  145. WNODE_FLAG_USE_MOF_PTR = $00100000; // MOF data are dereferenced
  146. {$EXTERNALSYM WNODE_FLAG_USE_MOF_PTR}
  147. WNODE_FLAG_NO_HEADER = $00200000; // Trace without header
  148. {$EXTERNALSYM WNODE_FLAG_NO_HEADER}
  149. // Set for events that are WNODE_EVENT_REFERENCE
  150. // Mask for event severity level. Level 0xff is the most severe type of event
  151. WNODE_FLAG_SEVERITY_MASK = DWORD($ff000000);
  152. {$EXTERNALSYM WNODE_FLAG_SEVERITY_MASK}
  153. //
  154. // This structure is used within the WNODE_ALL_DATA when the data blocks
  155. // for the different instances are different lengths. If the data blocks
  156. // for the different instances are identical lengths then
  157. // WNODE_FLAG_FIXED_INSTANCE_SIZE should be set and FixedInstanceSize
  158. // set to the common data block size.
  159. type
  160. OFFSETINSTANCEDATAANDLENGTH = record
  161. OffsetInstanceData: ULONG; // Offset from beginning of WNODE_ALL_DATA
  162. // to Data block for instance
  163. LengthInstanceData: ULONG; // Length of data block for instance
  164. end;
  165. {$EXTERNALSYM OFFSETINSTANCEDATAANDLENGTH}
  166. POFFSETINSTANCEDATAANDLENGTH = ^OFFSETINSTANCEDATAANDLENGTH;
  167. {$EXTERNALSYM POFFSETINSTANCEDATAANDLENGTH}
  168. TOffsetInstanceDataAndLength = OFFSETINSTANCEDATAANDLENGTH;
  169. PWNODE_ALL_DATA = ^WNODE_ALL_DATA;
  170. {$EXTERNALSYM PWNODE_ALL_DATA}
  171. tagWNODE_ALL_DATA = record
  172. WnodeHeader: WNODE_HEADER;
  173. DataBlockOffset: ULONG; // Offset from begin of WNODE to first data block
  174. InstanceCount: ULONG; // Count of instances whose data follows.
  175. // Offset to an array of offsets to the instance names
  176. OffsetInstanceNameOffsets: ULONG;
  177. // If WNODE_FLAG_FIXED_INSTANCE_SIZE is set in Flags then
  178. // FixedInstanceSize specifies the size of each data block. In this case
  179. // there is one ULONG followed by the data blocks.
  180. // If WNODE_FLAG_FIXED_INSTANCE_SIZE is not set
  181. // then OffsetInstanceDataAndLength
  182. // is an array of OFFSETINSTANCEDATAANDLENGTH that specifies the
  183. // offsets and lengths of the data blocks for each instance.
  184. case Integer of
  185. 0: (FixedInstanceSize: ULONG);
  186. 1: (OffsetInstanceDataAndLength: POFFSETINSTANCEDATAANDLENGTH);
  187. // [InstanceCount]
  188. // padding so that first data block begins on a 8 byte boundry
  189. // data blocks and instance names for all instances
  190. end;
  191. {$EXTERNALSYM tagWNODE_ALL_DATA}
  192. WNODE_ALL_DATA = tagWNODE_ALL_DATA;
  193. {$EXTERNALSYM WNODE_ALL_DATA}
  194. TWNodeAllData = WNODE_ALL_DATA;
  195. PWNodeAllData = PWNODE_ALL_DATA;
  196. PWNODE_SINGLE_INSTANCE = ^WNODE_SINGLE_INSTANCE;
  197. {$EXTERNALSYM PWNODE_SINGLE_INSTANCE}
  198. tagWNODE_SINGLE_INSTANCE = record
  199. WnodeHeader: _WNODE_HEADER;
  200. // Offset from beginning of WNODE_SINGLE_INSTANCE
  201. // to instance name. Use when
  202. // WNODE_FLAG_STATIC_INSTANCE_NAMES is reset
  203. // (Dynamic instance names)
  204. OffsetInstanceName: ULONG;
  205. // Instance index when
  206. // WNODE_FLAG_STATIC_INSTANCE_NAME is set
  207. InstanceIndex: ULONG; // (Static Instance Names)
  208. DataBlockOffset: ULONG; // offset from beginning of WNODE to data block
  209. SizeDataBlock: ULONG; // Size of data block for instance
  210. VariableData: PUCHAR;
  211. // instance names and padding so data block begins on 8 byte boundry
  212. // data block
  213. end;
  214. {$EXTERNALSYM tagWNODE_SINGLE_INSTANCE}
  215. WNODE_SINGLE_INSTANCE = tagWNODE_SINGLE_INSTANCE;
  216. {$EXTERNALSYM WNODE_SINGLE_INSTANCE}
  217. TWNodeSingleInstance = WNODE_SINGLE_INSTANCE;
  218. PWNodeSingleInstance = PWNODE_SINGLE_INSTANCE;
  219. PWNODE_SINGLE_ITEM = ^WNODE_SINGLE_ITEM;
  220. {$EXTERNALSYM PWNODE_SINGLE_ITEM}
  221. tagWNODE_SINGLE_ITEM = record
  222. WnodeHeader: WNODE_HEADER;
  223. // Offset from beginning of WNODE_SINGLE_INSTANCE
  224. // to instance name. Examine when
  225. // WNODE_FLAG_STATIC_INSTANCE_NAME is reset
  226. // (Dynamic instance names)
  227. OffsetInstanceName: ULONG;
  228. // Instance index when
  229. // WNODE_FLAG_STATIC_INSTANCE_NAME
  230. InstanceIndex: ULONG; // set (Static Instance Names)
  231. ItemId: ULONG; // Item Id for data item being set
  232. DataBlockOffset: ULONG; // offset from WNODE begin to data item value
  233. SizeDataItem: ULONG; // Size of data item
  234. VariableData: PUCHAR;
  235. // instance names and padding so data value begins on 8 byte boundry
  236. // data item value
  237. end;
  238. {$EXTERNALSYM tagWNODE_SINGLE_ITEM}
  239. WNODE_SINGLE_ITEM = tagWNODE_SINGLE_ITEM;
  240. {$EXTERNALSYM WNODE_SINGLE_ITEM}
  241. TWNodeSingleItem = WNODE_SINGLE_ITEM;
  242. PWNodeSingleItem = PWNODE_SINGLE_ITEM;
  243. PWNODE_METHOD_ITEM = ^WNODE_METHOD_ITEM;
  244. {$EXTERNALSYM PWNODE_METHOD_ITEM}
  245. tagWNODE_METHOD_ITEM = record
  246. WnodeHeader: WNODE_HEADER;
  247. // Offset from beginning of WNODE_METHOD_ITEM
  248. // to instance name. Examine when
  249. // WNODE_FLAG_STATIC_INSTANCE_NAME is reset
  250. // (Dynamic instance names)
  251. OffsetInstanceName: ULONG;
  252. // Instance index when
  253. // WNODE_FLAG_STATIC_INSTANCE_NAME
  254. InstanceIndex: ULONG; // set (Static Instance Names)
  255. MethodId: ULONG; // Method id of method being called
  256. DataBlockOffset: ULONG; // On Entry: offset from WNODE to input data
  257. // On Return: offset from WNODE to input and
  258. // output data blocks
  259. SizeDataBlock: ULONG; // On Entry: Size of input data, 0 if no input
  260. // data
  261. // On Return: Size of output data, 0 if no output
  262. // data
  263. VariableData: PUCHAR;
  264. // instance names and padding so data value begins on 8 byte boundry
  265. // data item value
  266. end;
  267. {$EXTERNALSYM tagWNODE_METHOD_ITEM}
  268. WNODE_METHOD_ITEM = tagWNODE_METHOD_ITEM;
  269. {$EXTERNALSYM WNODE_METHOD_ITEM}
  270. TWNodeMethodItem = WNODE_METHOD_ITEM;
  271. PWNodeMethodItem = PWNODE_METHOD_ITEM;
  272. PWNODE_EVENT_ITEM = ^WNODE_EVENT_ITEM;
  273. {$EXTERNALSYM PWNODE_EVENT_ITEM}
  274. tagWNODE_EVENT_ITEM = record
  275. WnodeHeader: WNODE_HEADER;
  276. // Different data could be here depending upon the flags set in the
  277. // WNODE_HEADER above. If the WNODE_FLAG_ALL_DATA flag is set then the
  278. // contents of a WNODE_ALL_DATA (excluding WNODE_HEADER) is here. If the
  279. // WNODE_FLAG_SINGLE_INSTANCE flag is set then a WNODE_SINGLE_INSTANCE
  280. // (excluding WNODE_HEADER) is here. Lastly if the WNODE_FLAG_SINGLE_ITEM
  281. // flag is set then a WNODE_SINGLE_ITEM (excluding WNODE_HEADER) is here.
  282. end;
  283. {$EXTERNALSYM tagWNODE_EVENT_ITEM}
  284. WNODE_EVENT_ITEM = tagWNODE_EVENT_ITEM;
  285. {$EXTERNALSYM WNODE_EVENT_ITEM}
  286. TWNodeEventItem = WNODE_EVENT_ITEM;
  287. PWNodeEventItem = PWNODE_EVENT_ITEM;
  288. //
  289. // If a KM data provider needs to fire an event that is larger than the
  290. // maximum size that WMI allows then it should fire a WNODE_EVENT_REFERENCE
  291. // that specifies which guid and instance name to query for the actual data
  292. // that should be part of the event.
  293. PWNODE_EVENT_REFERENCE = ^WNODE_EVENT_REFERENCE;
  294. {$EXTERNALSYM PWNODE_EVENT_REFERENCE}
  295. tagWNODE_EVENT_REFERENCE = record
  296. WnodeHeader: _WNODE_HEADER;
  297. TargetGuid: GUID;
  298. TargetDataBlockSize: ULONG;
  299. case Integer of
  300. 0: (TargetInstanceIndex: ULONG);
  301. 1: (TargetInstanceName: PWCHAR);
  302. end;
  303. {$EXTERNALSYM tagWNODE_EVENT_REFERENCE}
  304. WNODE_EVENT_REFERENCE = tagWNODE_EVENT_REFERENCE;
  305. {$EXTERNALSYM WNODE_EVENT_REFERENCE}
  306. TWNodeEventReference = WNODE_EVENT_REFERENCE;
  307. PWNodeEventReference = PWNODE_EVENT_REFERENCE;
  308. PWNODE_TOO_SMALL = ^WNODE_TOO_SMALL;
  309. {$EXTERNALSYM PWNODE_TOO_SMALL}
  310. tagWNODE_TOO_SMALL = record
  311. WnodeHeader: _WNODE_HEADER;
  312. SizeNeeded: ULONG; // Size needed to build WNODE result
  313. end;
  314. {$EXTERNALSYM tagWNODE_TOO_SMALL}
  315. WNODE_TOO_SMALL = tagWNODE_TOO_SMALL;
  316. {$EXTERNALSYM WNODE_TOO_SMALL}
  317. TWNodeTooSmall = WNODE_TOO_SMALL;
  318. PWNodeTooSmall = PWNODE_TOO_SMALL;
  319. WMIREGGUIDW = record
  320. Guid: GUID; // Guid of data block being registered or updated
  321. Flags: ULONG; // Flags
  322. InstanceCount: ULONG; // Count of static instances names for the guid
  323. case Integer of
  324. // If WMIREG_FLAG_INSTANCE_LIST then this has the offset
  325. // to a list of InstanceCount counted UNICODE
  326. // strings placed end to end.
  327. 0: (InstanceNameList: ULONG);
  328. // If WMIREG_FLAG_INSTANCE_BASENAME then this has the
  329. // offset to a single counted UNICODE string that
  330. // has the basename for the instance names.
  331. 1: (BaseNameOffset: ULONG);
  332. // If WMIREG_FLAG_INSTANCE_PDO is set then InstanceInfo
  333. // has the PDO whose device instance path will
  334. // become the instance name
  335. 2: (Pdo: ULONG_PTR);
  336. // If WMIREG_FLAG_INSTANCE_REFERENCE then this points to
  337. // a WMIREGINSTANCEREF structure.
  338. 3: (InstanceInfo: ULONG_PTR);// Offset from beginning of the WMIREGINFO structure to
  339. end;
  340. {$EXTERNALSYM WMIREGGUIDW}
  341. PWMIREGGUIDW = ^WMIREGGUIDW;
  342. {$EXTERNALSYM PWMIREGGUIDW}
  343. TWmiRegGuidW = WMIREGGUIDW;
  344. WMIREGGUID = WMIREGGUIDW;
  345. {$EXTERNALSYM WMIREGGUID}
  346. PWMIREGGUID = PWMIREGGUIDW;
  347. {$EXTERNALSYM PWMIREGGUID}
  348. TWmiRegGuid = WMIREGGUID;
  349. // Set if collection must be enabled for the guid before the data provider
  350. // can be queried for data.
  351. const
  352. WMIREG_FLAG_EXPENSIVE = $00000001;
  353. {$EXTERNALSYM WMIREG_FLAG_EXPENSIVE}
  354. // Set if instance names for this guid are specified in a static list within
  355. // the WMIREGINFO
  356. WMIREG_FLAG_INSTANCE_LIST = $00000004;
  357. {$EXTERNALSYM WMIREG_FLAG_INSTANCE_LIST}
  358. // Set if instance names are to be static and generated by WMI using a
  359. // base name in the WMIREGINFO and an index
  360. WMIREG_FLAG_INSTANCE_BASENAME = $00000008;
  361. {$EXTERNALSYM WMIREG_FLAG_INSTANCE_BASENAME}
  362. // Set if WMI should do automatic mapping of a PDO to device instance name
  363. // as the instance name for the guid. This flag should only be used by
  364. // kernel mode data providers.
  365. WMIREG_FLAG_INSTANCE_PDO = $00000020;
  366. {$EXTERNALSYM WMIREG_FLAG_INSTANCE_PDO}
  367. // Note the flags WMIREG_FLAG_INSTANCE_LIST, WMIREG_FLAG_INSTANCE_BASENAME,
  368. // WMIREG_FLAG_INSTANCE_REFERENCE and WMIREG_FLAG_INSTANCE_PDO are mutually
  369. // exclusive.
  370. //
  371. // These flags are only valid in a response to WMI_GUID_REGUPDATE
  372. WMIREG_FLAG_REMOVE_GUID = $00010000; // Remove support for guid
  373. {$EXTERNALSYM WMIREG_FLAG_REMOVE_GUID}
  374. WMIREG_FLAG_RESERVED1 = $00020000; // Reserved by WMI
  375. {$EXTERNALSYM WMIREG_FLAG_RESERVED1}
  376. WMIREG_FLAG_RESERVED2 = $00040000; // Reserved by WMI
  377. {$EXTERNALSYM WMIREG_FLAG_RESERVED2}
  378. // Set if guid is one that is written to trace log.
  379. // This guid cannot be queried directly via WMI, but must be read using
  380. // logger apis.
  381. WMIREG_FLAG_TRACED_GUID = $00080000;
  382. {$EXTERNALSYM WMIREG_FLAG_TRACED_GUID}
  383. //
  384. // Only those Trace Guids that have this bit set can receive
  385. // Enable/Disable Notifications.
  386. //
  387. WMIREG_FLAG_TRACE_CONTROL_GUID = $00001000;
  388. {$EXTERNALSYM WMIREG_FLAG_TRACE_CONTROL_GUID}
  389. //
  390. // Set if the guid is only used for firing events. Guids that can be queried
  391. // and that fire events should not have this bit set.
  392. WMIREG_FLAG_EVENT_ONLY_GUID = $00000040;
  393. {$EXTERNALSYM WMIREG_FLAG_EVENT_ONLY_GUID}
  394. type
  395. WMIREGINFOW = record
  396. // Size of entire WMIREGINFO structure including this ULONG
  397. // and any static instance names that follow
  398. BufferSize: ULONG;
  399. NextWmiRegInfo: ULONG; // Offset to next WMIREGINFO structure
  400. RegistryPath: ULONG; // Offset from beginning of WMIREGINFO structure to a
  401. // counted Unicode string containing
  402. // the driver registry path (under HKLM\CCS\Services)
  403. // This must be filled only by kernel mode data
  404. // providers
  405. // Offset from beginning of WMIREGINFO structure to a
  406. // counted Unicode string containing
  407. // the name of resource in driver file containing MOF info
  408. MofResourceName: ULONG;
  409. // Count of WMIREGGUID structures immediately following
  410. GuidCount: ULONG;
  411. WmiRegGuid: PWMIREGGUIDW; // array of GuidCount WMIREGGUID structures
  412. // Variable length data including :
  413. // Instance Names
  414. end;
  415. {$EXTERNALSYM WMIREGINFOW}
  416. PWMIREGINFOW = ^WMIREGINFOW;
  417. {$EXTERNALSYM PWMIREGINFOW}
  418. TWmiRegInfoW = WMIREGINFOW;
  419. WMIREGINFO = WMIREGINFOW;
  420. {$EXTERNALSYM WMIREGINFOW}
  421. PWMIREGINFO = PWMIREGINFOW;
  422. {$EXTERNALSYM PWMIREGINFOW}
  423. TWmiRegInfo = WMIREGINFOW;
  424. //
  425. // WMI request codes
  426. WMIDPREQUESTCODE = (
  427. WMI_GET_ALL_DATA,
  428. WMI_GET_SINGLE_INSTANCE,
  429. WMI_SET_SINGLE_INSTANCE,
  430. WMI_SET_SINGLE_ITEM,
  431. WMI_ENABLE_EVENTS,
  432. WMI_DISABLE_EVENTS,
  433. WMI_ENABLE_COLLECTION,
  434. WMI_DISABLE_COLLECTION,
  435. WMI_REGINFO,
  436. WMI_EXECUTE_METHOD);
  437. {$EXTERNALSYM WMIDPREQUESTCODE}
  438. TWmiDpRequestCode = WMIDPREQUESTCODE;
  439. //
  440. // WMI guid objects have the following rights
  441. // WMIGUID_QUERY
  442. // WMIGUID_SET
  443. // WMIGUID_NOTIFICATION
  444. // WMIGUID_READ_DESCRIPTION
  445. // WMIGUID_EXECUTE
  446. // TRACELOG_CREATE_REALTIME
  447. // TRACELOG_CREATE_ONDISK
  448. // TRACELOG_GUID_ENABLE
  449. // TRACELOG_ACCESS_KERNEL_LOGGER
  450. // TRACELOG_CREATE_INPROC
  451. // TRACELOG_ACCESS_REALTIME
  452. //
  453. // GuidTypes
  454. //
  455. //#ifndef _WMIKM_
  456. const
  457. WMI_GUIDTYPE_TRACECONTROL = 0;
  458. {$EXTERNALSYM WMI_GUIDTYPE_TRACECONTROL}
  459. WMI_GUIDTYPE_TRACE = 1;
  460. {$EXTERNALSYM WMI_GUIDTYPE_TRACE}
  461. WMI_GUIDTYPE_DATA = 2;
  462. {$EXTERNALSYM WMI_GUIDTYPE_DATA}
  463. WMI_GUIDTYPE_EVENT = 3;
  464. {$EXTERNALSYM WMI_GUIDTYPE_EVENT}
  465. //#endif
  466. //
  467. // Specific rights for WMI guid objects. These are available from 0x0001 to
  468. // 0xffff (ie up to 16 rights)
  469. //
  470. WMIGUID_QUERY = $0001;
  471. {$EXTERNALSYM WMIGUID_QUERY}
  472. WMIGUID_SET = $0002;
  473. {$EXTERNALSYM WMIGUID_SET}
  474. WMIGUID_NOTIFICATION = $0004;
  475. {$EXTERNALSYM WMIGUID_NOTIFICATION}
  476. WMIGUID_READ_DESCRIPTION = $0008;
  477. {$EXTERNALSYM WMIGUID_READ_DESCRIPTION}
  478. WMIGUID_EXECUTE = $0010;
  479. {$EXTERNALSYM WMIGUID_EXECUTE}
  480. TRACELOG_CREATE_REALTIME = $0020;
  481. {$EXTERNALSYM TRACELOG_CREATE_REALTIME}
  482. TRACELOG_CREATE_ONDISK = $0040;
  483. {$EXTERNALSYM TRACELOG_CREATE_ONDISK}
  484. TRACELOG_GUID_ENABLE = $0080;
  485. {$EXTERNALSYM TRACELOG_GUID_ENABLE}
  486. TRACELOG_ACCESS_KERNEL_LOGGER = $0100;
  487. {$EXTERNALSYM TRACELOG_ACCESS_KERNEL_LOGGER}
  488. TRACELOG_CREATE_INPROC = $0200;
  489. {$EXTERNALSYM TRACELOG_CREATE_INPROC}
  490. TRACELOG_ACCESS_REALTIME = $0400;
  491. {$EXTERNALSYM TRACELOG_ACCESS_REALTIME}
  492. TRACELOG_REGISTER_GUIDS = $0800;
  493. {$EXTERNALSYM TRACELOG_REGISTER_GUIDS}
  494. WMIGUID_ALL_ACCESS = (
  495. STANDARD_RIGHTS_READ or
  496. SYNCHRONIZE or
  497. WMIGUID_QUERY or
  498. WMIGUID_SET or
  499. WMIGUID_NOTIFICATION or
  500. WMIGUID_READ_DESCRIPTION or
  501. WMIGUID_EXECUTE or
  502. TRACELOG_CREATE_REALTIME or
  503. TRACELOG_CREATE_ONDISK or
  504. TRACELOG_GUID_ENABLE or
  505. TRACELOG_ACCESS_KERNEL_LOGGER or
  506. TRACELOG_CREATE_INPROC or
  507. TRACELOG_ACCESS_REALTIME or
  508. TRACELOG_REGISTER_GUIDS);
  509. {$EXTERNALSYM WMIGUID_ALL_ACCESS}
  510. WMI_GLOBAL_LOGGER_ID = $0001;
  511. {$EXTERNALSYM WMI_GLOBAL_LOGGER_ID}
  512. implementation
  513. end.