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.

624 lines
18 KiB

  1. [uuid(226c9290-dd96-11d3-a120-00105a1f515a)]
  2. library WbemUtilities_v1
  3. {
  4. importlib("stdole32.tlb");
  5. typedef [v1_enum] enum tag_WBEM_PATH_STATUS_FLAG
  6. {
  7. WBEMPATH_INFO_ANON_LOCAL_MACHINE = 0x1, // <path has \\. as server name>
  8. WBEMPATH_INFO_HAS_MACHINE_NAME = 0x2, // <not a dot>
  9. WBEMPATH_INFO_IS_CLASS_REF = 0x4, // <a path to a classs, not a path to an instance>
  10. WBEMPATH_INFO_IS_INST_REF = 0x8, // <a path to an instance>
  11. WBEMPATH_INFO_HAS_SUBSCOPES = 0x10, // <true if a subscope is present>
  12. WBEMPATH_INFO_IS_COMPOUND = 0x20, // <true if compound key is used>
  13. WBEMPATH_INFO_HAS_V2_REF_PATHS = 0x40, // <true if V2-style ref paths are used>
  14. WBEMPATH_INFO_HAS_IMPLIED_KEY = 0x80, // <true if keynames are missing somewhere>
  15. WBEMPATH_INFO_CONTAINS_SINGLETON = 0x100, // <true if one or more singletons>
  16. WBEMPATH_INFO_V1_COMPLIANT = 0x200, // <true if path is WBEM-V1-compliant>
  17. WBEMPATH_INFO_V2_COMPLIANT = 0x400, // <true if path is WBEM-V2-compliant>
  18. WBEMPATH_INFO_CIM_COMPLIANT = 0x800, // <true if path is CIM-compliant>
  19. WBEMPATH_INFO_IS_SINGLETON = 0x1000, // <a path to a singleton>
  20. WBEMPATH_INFO_IS_PARENT = 0x2000, // <path is just "..">
  21. WBEMPATH_INFO_SERVER_NAMESPACE_ONLY = 0x4000, // <path is just "..">
  22. } tag_WBEM_PATH_STATUS_FLAG;
  23. typedef [v1_enum] enum tag_WBEM_PATH_CREATE_FLAG
  24. {
  25. WBEMPATH_CREATE_ACCEPT_RELATIVE = 0x1,
  26. WBEMPATH_CREATE_ACCEPT_ABSOLUTE = 0x2,
  27. WBEMPATH_CREATE_ACCEPT_ALL = 0x4,
  28. WBEMPATH_TREAT_SINGLE_IDENT_AS_NS = 0x8,
  29. } tag_WBEM_PATH_CREATE_FLAG;
  30. typedef [v1_enum] enum tag_WBEM_GET_TEXT_FLAGS
  31. {
  32. WBEMPATH_COMPRESSED = 0x1,
  33. WBEMPATH_GET_RELATIVE_ONLY = 0X2,
  34. WBEMPATH_GET_SERVER_TOO = 0X4,
  35. WBEMPATH_GET_SERVER_AND_NAMESPACE_ONLY = 0X8,
  36. } tag_WBEM_GET_TEXT_FLAGS;
  37. typedef [v1_enum] enum tag_WBEM_GET_KEY_FLAGS
  38. {
  39. WBEMPATH_TEXT = 0x1,
  40. WBEMPATH_QUOTEDTEXT = 0X2
  41. } tag_WBEM_GET_KEY_FLAGS;
  42. //*******************************************************************
  43. // NOT CoCreatable; get this from IWbemPath
  44. [local, object, uuid(9AE62877-7544-4bb0-AA26-A13824659ED6)]
  45. interface IWbemPathKeyList : IUnknown
  46. {
  47. HRESULT GetCount(
  48. [out] ULONG * puKeyCount
  49. );
  50. HRESULT SetKey(
  51. [in, string] LPCWSTR wszName,
  52. [in] ULONG uFlags, // Add flag for SINGLETON
  53. [in] ULONG uCimType, // Implies the size
  54. [in] LPVOID pKeyVal
  55. );
  56. HRESULT SetKey2(
  57. [in, string] LPCWSTR wszName,
  58. [in] ULONG uFlags, // Add flag for SINGLETON
  59. [in] ULONG uCimType,
  60. [in] VARIANT * pKeyVal
  61. );
  62. HRESULT GetKey(
  63. [in] ULONG uKeyIx,
  64. [in] ULONG uFlags, // Add flag for SINGLETON
  65. [in,out] ULONG * puNameBufSize, // In bytes; must be large enough for UNICODE null
  66. [in,out] LPWSTR pszKeyName, // May be NULL for implicit keys
  67. [in,out] ULONG * puKeyValBufSize, // In Bytes, includes double NULL
  68. [in,out] LPVOID pKeyVal, // Key Val
  69. [out] ULONG *puApparentCimType // One of CIM_SINT32, CIM_SINT64, CIM_STRING, etc.
  70. );
  71. HRESULT GetKey2(
  72. [in] ULONG uKeyIx,
  73. [in] ULONG uFlags, // Add flag for SINGLETON
  74. [in,out] ULONG * puNameBufSize, // In bytes; must be large enough for UNICODE null
  75. [in,out] LPWSTR pszKeyName, // May be NULL for implicit keys
  76. [in,out] VARIANT * pKeyValue, // In Bytes, includes double NULL
  77. [out] ULONG *puApparentCimType // One of CIM_SINT32, CIM_SINT64, CIM_STRING, etc.
  78. );
  79. HRESULT RemoveKey(
  80. [in, string] LPCWSTR wszName,
  81. [in] ULONG uFlags
  82. );
  83. HRESULT RemoveAllKeys(
  84. [in] ULONG uFlags
  85. );
  86. HRESULT MakeSingleton([in] boolean bSet);
  87. // WBEMPATH_INFO_IS_COMPOUND <true if compound key is used
  88. // WBEMPATH_INFO_HAS_V2_REF_PATHS <true if V2-style ref paths are used
  89. // WBEMPATH_INFO_HAS_IMPLIED_KEY <true if keynames are missing somewhere
  90. // WBEMPATH_INFO_CONTAINS_SINGLETON <true if one or more singletons
  91. HRESULT GetInfo(
  92. [in] ULONG uRequestedInfo,
  93. [out] ULONGLONG *puResponse
  94. );
  95. HRESULT GetText(
  96. [in] long lFlags, // tag_WBEM_GET_KEY_FLAGS
  97. [in,out] ULONG * puBuffLength,
  98. [in, out, string] LPWSTR pszText
  99. );
  100. };
  101. //*******************************************************************
  102. // CoCreatable
  103. [local, object, uuid(3BC15AF2-736C-477e-9E51-238AF8667DCC)]
  104. interface IWbemPath : IUnknown
  105. {
  106. HRESULT SetText(
  107. [in] ULONG uMode, // see tag_WBEM_PATH_CREATE_FLAG
  108. [in] LPCWSTR pszPath
  109. );
  110. HRESULT GetText(
  111. [in] long lFlags, // see tag_WBEM_GET_TEXT_FLAGS
  112. [in,out] ULONG * puBuffLength,
  113. [in, out, string] LPWSTR pszText
  114. );
  115. // Path tests
  116. // ==========
  117. HRESULT GetInfo(
  118. [in] ULONG uRequestedInfo, // zero for now
  119. [out] ULONGLONG *puResponse // see tag_WBEM_PATH_STATUS_FLAG
  120. );
  121. // Server access
  122. // =============
  123. HRESULT SetServer(
  124. [in, string] LPCWSTR Name
  125. );
  126. HRESULT GetServer(
  127. [in,out] ULONG * puNameBufLength,
  128. [in, out, string] LPWSTR pName
  129. );
  130. // Namespace access. Example, root\default, root is 0, 1 is def
  131. // =============================================================
  132. HRESULT GetNamespaceCount(
  133. [out] ULONG* puCount
  134. );
  135. HRESULT SetNamespaceAt(
  136. [in] ULONG uIndex,
  137. [in, string] LPCWSTR pszName
  138. );
  139. HRESULT GetNamespaceAt(
  140. [in] ULONG uIndex,
  141. [in,out] ULONG * puNameBufLength,
  142. [in, out, string] LPWSTR pName
  143. );
  144. HRESULT RemoveNamespaceAt(
  145. [in] ULONG uIndex
  146. );
  147. HRESULT RemoveAllNamespaces(
  148. );
  149. //
  150. // Scope manipulators. The leftmost scope is 0
  151. // ============================================
  152. HRESULT GetScopeCount(
  153. [out] ULONG *puCount
  154. );
  155. HRESULT SetScope(
  156. [in] ULONG uIndex,
  157. [in] LPWSTR pszClass
  158. );
  159. HRESULT SetScopeFromText(
  160. [in] ULONG uIndex,
  161. [in] LPWSTR pszText
  162. );
  163. HRESULT GetScope(
  164. [in] ULONG uIndex,
  165. [in,out] ULONG * puClassNameBufSize,
  166. [in,out] LPWSTR pszClass,
  167. [out] IWbemPathKeyList **pKeyList
  168. );
  169. HRESULT GetScopeAsText(
  170. [in] ULONG uIndex,
  171. [in,out] ULONG * puTextBufSize,
  172. [in,out] LPWSTR pszText
  173. );
  174. HRESULT RemoveScope(
  175. [in] ULONG uIndex
  176. );
  177. HRESULT RemoveAllScopes(
  178. );
  179. // General class and key access routines
  180. // =====================================
  181. HRESULT SetClassName(
  182. [in, string] LPCWSTR Name
  183. );
  184. HRESULT GetClassName(
  185. [in,out] ULONG * puBuffLength,
  186. [in, out, string] LPWSTR pszName
  187. );
  188. HRESULT GetKeyList(
  189. [out] IWbemPathKeyList ** pOut
  190. );
  191. HRESULT CreateClassPart(
  192. [in] long lFlags,
  193. [in, string] LPCWSTR Name
  194. );
  195. HRESULT DeleteClassPart(
  196. [in] long lFlags
  197. );
  198. };
  199. //***********************************************************************
  200. //
  201. [restricted, uuid(cf4cc405-e2c5-4ddd-b3ce-5e7582d8c9fa)]
  202. coclass WbemDefPath
  203. {
  204. interface IWbemPath;
  205. };
  206. interface IWbemQuery;
  207. [uuid(EAC8A024-21E2-4523-AD73-A71A0AA2F56A)]
  208. coclass WbemQuery
  209. {
  210. interface IWbemQuery;
  211. };
  212. };
  213. //*******************************************************************
  214. // Query parser & analysis interfaces
  215. typedef enum
  216. {
  217. WMIQ_ANALYSIS_RPN_SEQUENCE = 0x1,
  218. WMIQ_ANALYSIS_ASSOC_QUERY = 0x2,
  219. WMIQ_ANALYSIS_PROP_ANALYSIS_MATRIX = 0x3
  220. } WMIQ_ANALYSIS_TYPE;
  221. typedef enum
  222. {
  223. // Group 1
  224. // Returned by GetNodeType
  225. WMIQ_RPN_TOKEN_EXPRESSION = 1,
  226. WMIQ_RPN_TOKEN_AND = 2,
  227. WMIQ_RPN_TOKEN_OR = 3,
  228. WMIQ_RPN_TOKEN_NOT = 4,
  229. // Group 2
  230. WMIQ_RPN_OP_EQ = 1,
  231. WMIQ_RPN_OP_NE = 2,
  232. WMIQ_RPN_OP_EQGT = 3,
  233. WMIQ_RPN_OP_EQLT = 4,
  234. WMIQ_RPN_OP_LT = 5,
  235. WMIQ_RPN_OP_GT = 6,
  236. WMIQ_RPN_OP_LIKE = 7,
  237. WMIQ_RPN_OP_ISA = 8,
  238. WMIQ_RPN_OP_ISNOTA = 9,
  239. // Group 3
  240. WMIQ_RPN_LEFT_PROPERTY_NAME = 0x1,
  241. WMIQ_RPN_RIGHT_PROPERTY_NAME = 0x2,
  242. WMIQ_RPN_LEFT_CONST = 0x4,
  243. WMIQ_RPN_RIGHT_CONST = 0x8,
  244. WMIQ_RPN_RELOP = 0x10,
  245. WMIQ_RPN_LEFT_FUNCTION = 0x20,
  246. WMIQ_RPN_RIGHT_FUNCTION = 0x30,
  247. // Group 4
  248. WMIQ_RPN_GET_TOKEN_TYPE = 1, // Returns Group 1 ULONG value
  249. WMIQ_RPN_GET_EXPR_SHAPE = 2, // Returns Group 3 ULONG mask
  250. WMIQ_RPN_GET_LEFT_FUNCTION = 3, // Returns LPWSTR
  251. WMIQ_RPN_GET_RIGHT_FUNCTION = 4, // Returns LPWSTR
  252. WMIQ_RPN_GET_RELOP = 5, // Returns a Group 2 ULONG
  253. // Group 5
  254. WMIQ_RPN_NEXT_TOKEN = 1
  255. } WMIQ_RPN_TOKEN_FLAGS;
  256. typedef enum
  257. {
  258. WMIQ_ASSOCQ_ASSOCIATORS = 0x1,
  259. WMIQ_ASSOCQ_REFERENCES = 0x2,
  260. WMIQ_ASSOCQ_RESULTCLASS = 0x4,
  261. WMIQ_ASSOCQ_ROLE = 0x8,
  262. WMIQ_ASSOCQ_RESULTROLE = 0x10,
  263. WMIQ_ASSOCQ_REQUIREDQUALIFIER = 0x20,
  264. WMIQ_ASSOCQ_REQUIREDASSOCQUALIFIER = 0x40,
  265. WMIQ_ASSOCQ_CLASSDEFSONLY = 0x80,
  266. WMIQ_ASSOCQ_KEYSONLY = 0x100,
  267. WMIQ_ASSOCQ_SCHEMAONLY = 0x200,
  268. WMIQ_ASSOCQ_CLASSREFSONLY = 0x400
  269. } WMIQ_ASSOCQ_FLAGS;
  270. // **********************************************************************
  271. //
  272. typedef struct tag_SWmiQueryQualifiedName
  273. {
  274. ULONG m_uVersion;
  275. ULONG m_uTokenType;
  276. ULONG m_uNameCount;
  277. LPCWSTR *m_pszNameList;
  278. BOOL m_bArraysUsed;
  279. BOOL *m_bArrayUsed;
  280. ULONG *m_uArrayIndex;
  281. } SWmiQueryQualifiedName;
  282. // **********************************************************************
  283. // RPN token for normal queries
  284. typedef struct tag_SWbemRpnQueryToken
  285. {
  286. ULONG m_uVersion;
  287. ULONG m_uTokenType;
  288. ULONG m_uSubexpressionShape;
  289. ULONG m_uOperator;
  290. SWmiQueryQualifiedName *m_pRightIdent;
  291. SWmiQueryQualifiedName *m_pLeftIdent;
  292. ULONG m_uRightConstApparentType; // CIM_ type
  293. LPVOID m_pRightConst;
  294. LPVOID m_pLeftConst;
  295. ULONG m_uLeftConstApparentType; // CIM_ type
  296. LPCWSTR pszLeftFunc;
  297. LPCWSTR pszRightFunc;
  298. } SWbemRpnQueryToken;
  299. typedef struct tag_SWbemRpnTokenList
  300. {
  301. ULONG m_uVersion;
  302. ULONG m_uTokenType;
  303. ULONG m_uNumTokens;
  304. SWbemRpnQueryToken *m_pTokens;
  305. } SWbemRpnTokenList;
  306. typedef enum tag_WMIQ_LANGUAGE_FEATURES
  307. {
  308. // The LF1 corresponds to the integer value. Do not alter!
  309. WMIQ_LF1_BASIC_SELECT = 1, // *
  310. WMIQ_LF2_CLASS_NAME_IN_QUERY = 2, // *
  311. WMIQ_LF3_STRING_CASE_FUNCTIONS = 3, // *
  312. WMIQ_LF4_PROP_TO_PROP_TESTS = 4, // *
  313. WMIQ_LF5_COUNT_STAR = 5,
  314. WMIQ_LF6_ORDER_BY = 6, // *
  315. WMIQ_LF7_DISTINCT = 7,
  316. WMIQ_LF8_ISA = 8, // *
  317. WMIQ_LF9_THIS = 9, // *
  318. WMIQ_LF10_COMPEX_SUBEXPRESSIONS = 10,
  319. WMIQ_LF11_ALIASING = 11,
  320. WMIQ_LF12_GROUP_BY_HAVING = 12, // *
  321. WMIQ_LF13_WMI_WITHIN = 13, // *
  322. WMIQ_LF14_SQL_WRITE_OPERATIONS = 14,
  323. WMIQ_LF15_GO = 15,
  324. WMIQ_LF16_SINGLE_LEVEL_TRANSACTIONS = 16,
  325. WMIQ_LF17_QUALIFIED_NAMES = 17, // *
  326. WMIQ_LF18_ASSOCIATONS = 18, // *
  327. WMIQ_LF19_SYSTEM_PROPERTIES = 19,
  328. WMIQ_LF20_EXTENDED_SYSTEM_PROPERTIES = 20,
  329. WMIQ_LF21_SQL89_JOINS = 21,
  330. WMIQ_LF22_SQL92_JOINS = 22,
  331. WMIQ_LF23_SUBSELECTS = 23,
  332. WMIQ_LF24_UMI_EXTENSIONS = 24,
  333. WMIQ_LF25_DATEPART = 25, // *
  334. WMIQ_LF26_LIKE = 26, // *
  335. WMIQ_LF27_CIM_TEMPORAL_CONSTRUCTS = 27, // *
  336. WMIQ_LF28_STANDARD_AGGREGATES = 28,
  337. WMIQ_LF29_MULTI_LEVEL_ORDER_BY = 29,
  338. WMIQ_LF30_WMI_PRAGMAS = 30,
  339. WMIQ_LF31_QUALIFIER_TESTS = 31,
  340. WMIQ_LF32_SP_EXECUTE = 32,
  341. WMIQ_LF33_ARRAY_ACCESS = 33, // *
  342. WMIQ_LF34_UNION = 34,
  343. WMIQ_LF35_COMPLEX_SELECT_TARGET = 35,
  344. WMIQ_LF36_REFERENCE_TESTS = 36,
  345. WMIQ_LF37_SELECT_INTO = 37,
  346. WMIQ_LF38_BASIC_DATETIME_TESTS = 38,
  347. WMIQ_LF_LAST = 39
  348. } WMIQ_LANGUAGE_FEATURES;
  349. typedef enum tag_WMIQ_RPNQ_FEATURE
  350. {
  351. WMIQ_RPNF_WHERE_CLAUSE_PRESENT = 0x1,
  352. WMIQ_RPNF_QUERY_IS_CONJUNCTIVE = 0x2,
  353. WMIQ_RPNF_QUERY_IS_DISJUNCTIVE = 0x4,
  354. WMIQ_RPNF_PROJECTION = 0x8,
  355. WMIQ_RPNF_FEATURE_SELECT_STAR = 0x10,
  356. WMIQ_RPNF_EQUALITY_TESTS_ONLY = 0x20,
  357. WMIQ_RPNF_COUNT_STAR = 0x40,
  358. WMIQ_RPNF_QUALIFIED_NAMES_IN_SELECT = 0x80,
  359. WMIQ_RPNF_QUALIFIED_NAMES_IN_WHERE = 0x100,
  360. WMIQ_RPNF_PROP_TO_PROP_TESTS = 0x200,
  361. WMIQ_RPNF_ORDER_BY = 0x400,
  362. WMIQ_RPNF_ISA_USED = 0x800,
  363. WMIQ_RPNF_ISNOTA_USED = 0x1000,
  364. WMIQ_RPNF_GROUP_BY_HAVING = 0x2000,
  365. WMIQ_RPNF_WITHIN_INTERVAL = 0x4000,
  366. WMIQ_RPNF_WITHIN_AGGREGATE = 0x8000,
  367. WMIQ_RPNF_SYSPROP_CLASS = 0x10000,
  368. WMIQ_RPNF_REFERENCE_TESTS = 0x20000,
  369. WMIQ_RPNF_DATETIME_TESTS = 0x40000,
  370. WMIQ_RPNF_ARRAY_ACCESS = 0x80000,
  371. WMIQ_RPNF_QUALIFIER_FILTER = 0x100000,
  372. } WMIQ_RPNF_FEATURE;
  373. typedef struct tag_SWbemRpnEncodedQuery
  374. {
  375. ULONG m_uVersion;
  376. ULONG m_uTokenType;
  377. // General query features
  378. ULONGLONG m_uParsedFeatureMask; // 64-bit WMIQ_RPNF_ mask
  379. // Overall language features encountered
  380. ULONG m_uDetectedArraySize;
  381. ULONG *m_puDetectedFeatures; // Array of LFn_ constants
  382. // Values being selected if WMIQ_RPNF_PROJECTION is set
  383. ULONG m_uSelectListLength;
  384. SWmiQueryQualifiedName **m_pSelectList;
  385. // Class being selected from
  386. ULONG m_uSelectTargetType;
  387. LPCWSTR m_pszSelectTarget;
  388. // Where clause
  389. SWbemRpnTokenList *m_pRpnWhereClause;
  390. // WITHIN value
  391. double m_dblWithinValue;
  392. // ORDER BY
  393. ULONG m_uOrderByListLength;
  394. LPCWSTR *m_pszOrderByList;
  395. } SWbemRpnEncodedQuery;
  396. // **********************************************************************
  397. typedef struct tag_SWbemAnalysisMatrix
  398. {
  399. ULONG m_uVersion;
  400. ULONG m_uMatrixType;
  401. LPCWSTR m_pszProperty;
  402. ULONG m_uPropertyType;
  403. ULONG m_uEntries;
  404. LPVOID *m_pValues;
  405. BOOL *m_pbTruthTable;
  406. } SWbemAnalysisMatrix;
  407. typedef struct tag_SWbemAnalysisMatrixList
  408. {
  409. ULONG m_uVersion;
  410. ULONG m_uMatrixType;
  411. ULONG m_uNumMatrices;
  412. SWbemAnalysisMatrix *m_pMatrices;
  413. } SWbemAnalysisMatrixList;
  414. // **********************************************************************
  415. // Associators/ References queries
  416. typedef struct tag_SWbemAssocQueryInf
  417. {
  418. ULONG m_uVersion;
  419. ULONG m_uAnalysisType;
  420. ULONG m_uFeatureMask;
  421. IWbemPath *m_pPath;
  422. LPWSTR m_pszPath;
  423. LPWSTR m_pszQueryText;
  424. LPWSTR m_pszResultClass;
  425. LPWSTR m_pszAssocClass;
  426. LPWSTR m_pszRole;
  427. LPWSTR m_pszResultRole;
  428. LPWSTR m_pszRequiredQualifier;
  429. LPWSTR m_pszRequiredAssocQualifier;
  430. } SWbemAssocQueryInf;
  431. [local, object, uuid(81166f58-dd98-11d3-a120-00105a1f515a)]
  432. interface IWbemQuery : IUnknown
  433. {
  434. HRESULT Empty();
  435. HRESULT SetLanguageFeatures(
  436. [in] long lFlags,
  437. [in] ULONG uArraySize,
  438. [in] ULONG *puFeatures
  439. );
  440. HRESULT TestLanguageFeatures(
  441. [in,out] ULONG *uArraySize,
  442. [out] ULONG *puFeatures
  443. );
  444. HRESULT Parse(
  445. [in] LPCWSTR pszLang,
  446. [in] LPCWSTR pszQuery,
  447. [in] ULONG uFlags
  448. );
  449. HRESULT GetAnalysis(
  450. [in] ULONG uAnalysisType,
  451. [in] ULONG uFlags,
  452. [out] LPVOID *pAnalysis
  453. );
  454. HRESULT FreeMemory(
  455. [in] LPVOID pMem
  456. );
  457. HRESULT GetQueryInfo(
  458. [in] ULONG uAnalysisType,
  459. [in] ULONG uInfoId,
  460. [in] ULONG uBufSize,
  461. [out] LPVOID pDestBuf
  462. );
  463. HRESULT AttachClassDef(
  464. [in] REFIID riid,
  465. [in, iid_is(riid)] LPVOID pClassDef
  466. );
  467. HRESULT TestObject(
  468. [in] ULONG uTestType,
  469. [in] ULONG uFlags,
  470. [in] REFIID riid,
  471. [in, iid_is(riid)] LPVOID pObj
  472. );
  473. HRESULT StringTest(
  474. [in] ULONG uTestType,
  475. [in] LPCWSTR pszTestStr,
  476. [in] LPCWSTR pszExpr
  477. );
  478. };
  479.