jwawmistr.pas 22 KB

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