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.

1034 lines
37 KiB

  1. import "objidl.idl";
  2. import "oleidl.idl";
  3. import "oaidl.idl";
  4. import "wbemsvc.idl";
  5. typedef VARIANT WBEM_VARIANT;
  6. typedef [string] WCHAR* WBEM_WSTR;
  7. enum _tag_ExtraErrorCodes
  8. {
  9. WBEM_S_ACCEPTS_NOTHING = 0x50001,
  10. WBEM_S_ACCEPTS_EVERYTHING,
  11. };
  12. enum
  13. {
  14. WBEM_FLAG_NECESSARY = 0x1,
  15. WBEM_FLAG_SUFFICIENT = 0x2,
  16. };
  17. enum
  18. {
  19. WBEM_FLAG_MAY_WEAKEN = 0x1,
  20. WBEM_FLAG_MAY_STRNGTHEN = 0x2
  21. };
  22. enum
  23. {
  24. WBEM_FLAG_COMPLETE = 0,
  25. WBEM_FLAG_LAZY = 1
  26. };
  27. //==============================================================================
  28. //
  29. // IWbemPropertySource
  30. //
  31. // Makes the object look like a property set to enable condition testing
  32. // (see IWbemCondition below). It is useful when a provider wants to test a
  33. // a condition without the expense of constructing IWbemClassObject.
  34. //
  35. // Used: by WBEMOM inside standard IWbemCondition implementation
  36. // Implemented: by providers who wish to check if their objects satisfy a
  37. // condition without constructing IWbemClassObjects.
  38. //
  39. //==============================================================================
  40. //
  41. // GetPropertyValue
  42. //
  43. // Retrieves the value of a property by name. In the case where embedded
  44. // objects may be present, the name can be a complex one, e.g.
  45. // "OldVersion.Manufacturer".
  46. //
  47. // PARAMETERS:
  48. //
  49. // WCHAR wszPropertyName The name of the property to retrieve
  50. // long lFlags Reserved. For future compatibility, use 0.
  51. // WBEM_VARIANT* pvValue Destination for the value of the property. The
  52. // caller must VariantClear it on success.
  53. // RETURNS:
  54. //
  55. // WBEM_S_NO_ERROR On Success
  56. // WBEM_E_NOT_FOUND No such property
  57. // WBEM_E_NOT_AVAILABLE The value is not available. Condition
  58. // evaluators should attempt to evaluate the
  59. // condition without it.
  60. // WBEM_E_FAILED Other critical error.
  61. //
  62. //==============================================================================
  63. typedef enum
  64. {
  65. WBEM_NAME_ELEMENT_TYPE_PROPERTY = 0,
  66. WBEM_NAME_ELEMENT_TYPE_INDEX = 1
  67. } WBEM_NAME_ELEMENT_TYPE;
  68. typedef [switch_type(short)] union tag_NameElementUnion
  69. {
  70. [case(WBEM_NAME_ELEMENT_TYPE_PROPERTY)] WBEM_WSTR m_wszPropertyName;
  71. [case(WBEM_NAME_ELEMENT_TYPE_INDEX)] long m_lArrayIndex;
  72. } WBEM_NAME_ELEMENT_UNION;
  73. typedef struct tag_NameElement
  74. {
  75. short m_nType;
  76. [switch_is(m_nType)] WBEM_NAME_ELEMENT_UNION Element;
  77. } WBEM_NAME_ELEMENT;
  78. typedef struct _tag_WbemPropertyName
  79. {
  80. long m_lNumElements;
  81. [size_is(m_lNumElements)] WBEM_NAME_ELEMENT* m_aElements;
  82. } WBEM_PROPERTY_NAME;
  83. [object, uuid(e2451054-b06e-11d0-ad61-00c04fd8fdff)]
  84. interface IWbemPropertySource : IUnknown
  85. {
  86. HRESULT GetPropertyValue(
  87. [in] WBEM_PROPERTY_NAME* pName,
  88. [in] long lFlags,
  89. [in, unique, out] WBEM_WSTR* pwszCimType,
  90. [out] WBEM_VARIANT* pvValue);
  91. HRESULT InheritsFrom([in] WBEM_WSTR wszClassName);
  92. };
  93. //==============================================================================
  94. //
  95. // Projection
  96. //
  97. //==============================================================================
  98. [uuid(d36b512a-c03a-11d0-ad64-00c04fd8fdff), pointer_default(unique)]
  99. interface IWbemPropertyList : IUnknown
  100. {
  101. HRESULT GetList(
  102. [in] long lFlags,
  103. [out] long* plNumProps,
  104. [out, size_is(, *plNumProps)] WBEM_WSTR **pawszProps);
  105. HRESULT IsSelected([in] WBEM_WSTR wszPropertyName);
  106. };
  107. [uuid(d36b512b-c03a-11d0-ad64-00c04fd8fdff)]
  108. interface IConfigureWbemProjector : IUnknown
  109. {
  110. HRESULT RemoveAllProperties();
  111. HRESULT AddProperties(
  112. [in] long lNumProps,
  113. [in, size_is(lNumProps)] WBEM_WSTR* awszProps);
  114. };
  115. //==============================================================================
  116. //
  117. // IWbemFilter
  118. //
  119. // Exported by "filter" objects and allows other to test if a given object
  120. // (property set) satisfies this condition. The tests can be applied to
  121. // IWbemClassObject pointers or to IWbemPropertySetRO pointers.
  122. //
  123. // Used: by providers to perform filtering; by WBEMOM inside IWbemEventSink to
  124. // perform filtering.
  125. // Implemented: by WBEMOM on standard query objects. No plans for user-defined
  126. // query languages at this time.
  127. //
  128. //==============================================================================
  129. //
  130. // CheckObject
  131. //
  132. // Attempts to verify if a given objects satisfies the condition represented
  133. // by this interface pointer.
  134. //
  135. // PARAMETERS:
  136. //
  137. // IN IUnknown* pObject The object to test. Must implement
  138. // IWbemClassObject or IWbemPropertySetRO.
  139. // OUT IUnknown** ppHint If not NULL and the call is successful,
  140. // a pointer to a "hint" object may be placed
  141. // here, or NULL. If the out-pointer is not
  142. // NULL, the caller may use it in
  143. // IWbemCondition::IndicateWithHint later. In
  144. // any case, the caller is responsible for
  145. // Releasing the pointer that is returned.
  146. // RETURNS:
  147. //
  148. // WBEM_S_NO_ERROR The object matches the condition.
  149. // WBEM_S_FALSE The object does not match the condition.
  150. // WBEM_S_INCONCLUSIVE Unavailability of certain properties in
  151. // the object made it impossible to check the
  152. // condition at this time. TBD: the hint
  153. // in this case may contain information about
  154. // what properties are needed. Maybe not.
  155. //
  156. //==============================================================================
  157. //
  158. // IsSpecial
  159. //
  160. // Checks if this filter is of one of two special types: one that
  161. // accepts everything and one that accepts nothing.
  162. //
  163. // RETURNS:
  164. //
  165. // WBEM_S_ACCEPTS_EVERYTHING
  166. // WBEM_S_ACCEPTS_NOTHING
  167. // WBEM_S_FALSE Not special
  168. // WBEM_E_FAILED Internal error.
  169. //
  170. //==============================================================================
  171. [object, uuid(e2451055-b06e-11d0-ad61-00c04fd8fdff)]
  172. interface IWbemFilter : IUnknown
  173. {
  174. HRESULT CheckObject(
  175. [in] IWbemPropertySource* pObject,
  176. [in, out, unique] IWbemPropertyList** ppList,
  177. [in, out, unique] IUnknown** ppHint);
  178. HRESULT IsSpecial();
  179. HRESULT GetType([out] IID* piid);
  180. HRESULT GetSelectedPropertyList(
  181. [in] long lFlags, // necessary, sufficient
  182. [out] IWbemPropertyList** ppList);
  183. };
  184. [uuid(d36b512c-c03a-11d0-ad64-00c04fd8fdff)]
  185. interface IWbemParse : IUnknown
  186. {
  187. HRESULT Parse([in] WBEM_WSTR wszText, [in] long lFlags);
  188. };
  189. //==============================================================================
  190. //
  191. // Class Info
  192. //
  193. //==============================================================================
  194. typedef struct _tag_ClassInfo
  195. {
  196. WBEM_WSTR m_wszClassName;
  197. boolean m_bIncludeChildren;
  198. long m_lNumSelectedProperties;
  199. [size_is(m_lNumSelectedProperties)] WBEM_WSTR* m_awszSelected;
  200. } WBEM_CLASS_INFO;
  201. [object, uuid(e245105b-b06e-11d0-ad61-00c04fd8fdff)]
  202. interface IWbemClassInfoFilter : IWbemFilter
  203. {
  204. HRESULT GetClassInfos(
  205. [in] long lFirstIndex,
  206. [in] long lNumInfos,
  207. [out] long* plInfosReturned,
  208. [out, size_is(lNumInfos), length_is(*plInfosReturned)]
  209. WBEM_CLASS_INFO* aInfos);
  210. };
  211. [uuid(d36b512d-c03a-11d0-ad64-00c04fd8fdff)]
  212. interface IConfigureWbemClassInfoFilter : IUnknown
  213. {
  214. HRESULT AddClassInfos([in] long lNumInfos,
  215. [in, size_is(lNumInfos)] WBEM_CLASS_INFO* aInfos);
  216. HRESULT RemoveAllInfos();
  217. };
  218. //==============================================================================
  219. //
  220. // QL operators
  221. //
  222. //==============================================================================
  223. typedef enum _tag_Ql1ComparisonOperator
  224. {
  225. QL1_OPERATOR_NONE = 0,
  226. QL1_OPERATOR_EQUALS = 1,
  227. QL1_OPERATOR_NOTEQUALS,
  228. QL1_OPERATOR_GREATER,
  229. QL1_OPERATOR_LESS,
  230. QL1_OPERATOR_LESSOREQUALS,
  231. QL1_OPERATOR_GREATEROREQUALS,
  232. QL1_OPERATOR_LIKE,
  233. QL1_OPERATOR_UNLIKE,
  234. QL1_OPERATOR_ISA,
  235. QL1_OPERATOR_ISNOTA,
  236. QL1_OPERATOR_INV_ISA,
  237. QL1_OPERATOR_INV_ISNOTA,
  238. } WBEM_QL1_COMPARISON_OPERATOR;
  239. typedef enum _tag_Ql1Function
  240. {
  241. QL1_FUNCTION_NONE = 0,
  242. QL1_FUNCTION_UPPER,
  243. QL1_FUNCTION_LOWER
  244. } WBEM_QL1_FUNCTION;
  245. typedef enum _tag_Ql1TokenType
  246. {
  247. QL1_NONE = 0,
  248. QL1_OR = 1,
  249. QL1_AND,
  250. QL1_NOT,
  251. QL1_OP_EXPRESSION
  252. } WBEM_QL1_TOKEN_TYPE;
  253. typedef struct _tag_WbemQl1Token
  254. {
  255. long m_lTokenType; // WbemSql1TokenType
  256. WBEM_PROPERTY_NAME m_PropertyName;
  257. long m_lOperator; // WbemSql1ComparisonOperator
  258. WBEM_VARIANT m_vConstValue;
  259. long m_lPropertyFunction; // WbemSql1Function
  260. long m_lConstFunction; // WbemSql1Function
  261. } WBEM_QL1_TOKEN;
  262. typedef struct _tag_WbemQl1Tolerance
  263. {
  264. boolean m_bExact;
  265. double m_fTolerance;
  266. } WBEM_QL1_TOLERANCE;
  267. [object, uuid(e245105c-b06e-11d0-ad61-00c04fd8fdff)]
  268. interface IWbemQl1Filter : IWbemFilter
  269. {
  270. HRESULT GetTargetClass([out] WBEM_CLASS_INFO* pTargetClass,
  271. [out] WBEM_QL1_TOLERANCE* pTolerance);
  272. HRESULT GetTokens(
  273. [in] long lFirstIndex,
  274. [in] long lNumTokens,
  275. [out] long* plTokensReturned,
  276. [out, size_is(lNumTokens), length_is(*plTokensReturned)]
  277. WBEM_QL1_TOKEN* aTokens);
  278. };
  279. [uuid(0682f5d6-c03b-11d0-ad64-00c04fd8fdff)]
  280. interface IConfigureWbemQl1Filter : IConfigureWbemProjector
  281. {
  282. HRESULT SetTargetClass([in] WBEM_CLASS_INFO* pTargetClass);
  283. HRESULT AddTokens(
  284. [in] long lNumTokens,
  285. [in, size_is(lNumTokens)] WBEM_QL1_TOKEN* aToken);
  286. HRESULT RemoveAllTokens();
  287. // From ICreateWbemProjector
  288. // AddProperties, RemoveAllProperties.
  289. };
  290. [pointer_default(unique), uuid(10cd7c50-c03b-11d0-ad64-00c04fd8fdff)]
  291. interface IWbemMultiFilter : IWbemFilter
  292. {
  293. HRESULT FindAllMatches(
  294. [in] IWbemPropertySource* pObject,
  295. [out] long* plNumMatches,
  296. [out, size_is(, *plNumMatches)] long **paMatches);
  297. HRESULT GetFilter([in] long lIndex, [out] IWbemFilter** ppFilter);
  298. };
  299. [uuid(10cd7c51-c03b-11d0-ad64-00c04fd8fdff)]
  300. interface ICreateWbemMultiFilter : IUnknown
  301. {
  302. HRESULT AddFilter([in] IWbemFilter* pFilter, [out] long* plIndex);
  303. };
  304. //==============================================================================
  305. //
  306. // Condition conversion flags.
  307. //
  308. // Can be either:
  309. // WBEM_CONVERT_EXACT to indicate that the conversion may not
  310. // change the semantics of the condition (the new condition must accept
  311. // exactly the same set as the old one), or
  312. // WBEM_CONVERT_MAY_WEAKEN to indicate that the conversion may weaken the
  313. // condition (the new condition must accept all the objects that the old
  314. // one accepted, but may accept some other ones).
  315. // WBEM_CONVERT_MAY_STRENGTHEN to indicate that the conversion may strengthen
  316. // the condition (the new condition must reject all objects that were
  317. // rejected by the old condition, but may reject some that were accepted).
  318. //
  319. //==============================================================================
  320. typedef enum _tag_WBEM_CONVERSION_FLAGS_TYPE
  321. {
  322. WBEM_CONVERT_EXACT = 0,
  323. WBEM_CONVERT_FLAG_MAY_WEAKEN = 0x1,
  324. WBEM_CONVERT_FLAG_MAY_STRENGTHEN = 0x2
  325. } WBEM_CONVERSION_FLAGS_TYPE;
  326. //==============================================================================
  327. //
  328. // IWbemFilterServices
  329. //
  330. // Exported by WBEMOM to provide generic filter examination and manipulation
  331. // services to providers. This interface is available from the standard
  332. // CLSID_WbemFilterServices object which can be instantiated by any provider.
  333. //
  334. // Used: by providers to learn enough about user registrations to perform
  335. // appropriate registration with their own data sources.
  336. // Implemented: by WBEMOM. No plans for user-defined query languages at this time
  337. //
  338. //==============================================================================
  339. //
  340. // ParseCondition
  341. //
  342. // Parses a textual representation of a condition in a given query language,
  343. // like SQL.
  344. //
  345. // PARAMETERS:
  346. //
  347. // IN WCHAR* wszQueryLanguage The language of the query, e.g. "SQL".
  348. // IN WCHAR* wszQuery The textual representation of the
  349. // query.
  350. // IN long lFlags Reserved. Set to 0 for future
  351. // compatibility.
  352. // OUT IWbemFilter** ppFilter Destination for the parsed condition.
  353. // OUT IUnknown** ppError If a syntax error is discovered, this
  354. // pointer may receive an interface to the
  355. // object describing the error.
  356. // RETURNS:
  357. //
  358. // WBEM_S_NO_ERROR Query successfully parsed.
  359. // WBEM_E_INVALID_QUERY_TYPE Query language is not supported.
  360. // WBEM_E_INVALID_QUERY Syntax error. ppError may have received more
  361. // information.
  362. // WBEM_E_FAILED Internal failure.
  363. //
  364. //==============================================================================
  365. //
  366. // ConvertCondition
  367. //
  368. // Attempts to convert a condition to a different format. Since different
  369. // condition formats have different powers of expression, this operation may
  370. // change the semantics of the condition. The user specifies if the method
  371. // may weaken or strengthen the condition.
  372. //
  373. // PARAMETERS:
  374. //
  375. // IN IWbemCondition* pOriginal The condition to convert.
  376. // IN long lNumFormats The number of elements in the
  377. // awszFormats array.
  378. // IN WCHAR* awszFormat[] The list of formats requested by the
  379. // caller. The list corresponds to the
  380. // caller's preference, but the callee has
  381. // the right to choose any one of them.
  382. // Supported formats include:
  383. // ClassInfo, SQL1, SIMPLE-OR.
  384. //
  385. // IN long lConversionFlags WBEM_CONVERSION_FLAGS_TYPE describing
  386. // how the semantics of the condition is
  387. // allowed to change.
  388. // IN REFIID ariids[] The list of interface ids to use: one
  389. // for each format.
  390. // OUT long* plFormat Destination for the index of the format
  391. // chosen by the callee.
  392. // OUT IWbemCondition** ppConverted Destination for the converted condition.
  393. // This pointer will actually point to the
  394. // interface identified by
  395. // ariids[*plFormat]
  396. // RETURNS:
  397. //
  398. // WBEM_S_EXACT The condition was converted without
  399. // changes in semantics.
  400. // WBEM_S_WEAKENED The condition was weakened by the
  401. // conversion.
  402. // WBEM_S_STREGTHENED The condition was strngthened by the
  403. // conversion.
  404. // WBEM_E_INVALID_FORMAT This condition format is not supported.
  405. // WBEM_E_NOINTERFACE This interface is not available for this
  406. // query format.
  407. // WBEM_E_FAILED Internal error.
  408. //
  409. //==============================================================================
  410. //
  411. // RestrictCondition
  412. //
  413. // Restricts the condition to a subset of the domain. The entire domain
  414. // consists of objects (property sets). This function restricts the condition
  415. // to a set of properties of this object. For instance, it can create a
  416. // condition on two given properties such that if this new condition is
  417. // satisfied (and you only need the values of those two properties to check
  418. // that) then the entire condition is satisfied. Similarily, it can handle the
  419. // necessity case.
  420. //
  421. // PARAMETERS:
  422. //
  423. // IN IWbemCondition* pOriginal The condition to restrict
  424. // IN long lNumProperties The number of properties in the
  425. // restricted domain (awszPropertyNames).
  426. // IN WCHAR** awszPropertyNames The array (of size lNumProperties) of
  427. // names of the properties to restrict on.
  428. // Complex names (like "OldVal.Index") are
  429. // allowed. If a property is an embedded
  430. // object, the condition can may apply to
  431. // the properties of that object as well.
  432. // IN long lFlags WBEM_CONVERSION_FLAGS_TYPE (see above).
  433. // OUT IWbemCondition** ppRestricted Destination for the restricted
  434. // condition.
  435. // RETURNS:
  436. //
  437. // WBEM_S_EXACT The condition was restricted without
  438. // changes in semantics. This means that no
  439. // actual restriction occurred.
  440. // WBEM_S_WEAKENED The condition was weakened by the
  441. // restriction.
  442. // WBEM_S_STREGTHENED The condition was strngthened by the
  443. // restriction.
  444. // WBEM_E_INVALID_PARAMEYER One or more parameters are invalid
  445. // WBEM_E_INVALID_PROPERTY One or more property names are invalid
  446. // WBEM_E_FAILED
  447. //
  448. //==============================================================================
  449. //
  450. // GetDifference
  451. //
  452. // Similar to the notion of conditional probability, given conditions A
  453. // (pSubtractFromWhat) and B (pSubtractWhat), it returns condition C such that
  454. // if B AND C = A. Intuitively, C is what we need to check to be assured of
  455. // A, given that B is guaranteed to hold.
  456. //
  457. // This constructs is very important for optimizing delivery.
  458. //
  459. // PARAMETERS:
  460. //
  461. // IN IWbemCondition* pConditionWhat "A"
  462. // IN IWbemCondition* pConditionOnWhat "B"
  463. // IN long lFlags Reserved. Set to 0 for compatibility
  464. // OUT IWbemCondition** ppConditional Destination for "C".
  465. //
  466. // RETURN VALUES:
  467. //
  468. // WBEM_S_NO_ERROR Success.
  469. // WBEM_E_INVALID_PARAMETER
  470. // WBEM_E_FAILED
  471. //
  472. //==============================================================================
  473. //
  474. // InteresectConditions
  475. //
  476. // AND's several conditions together to produce a new one condition which will
  477. // only be satisfied if all the members are.
  478. //
  479. // PARAMETERS:
  480. //
  481. // IN long lConditionCount The number of conditions to intersect.
  482. // IN IWbemCondition** aConditions The array of conditions to intersect.
  483. // IN long lFlags Reserved. Set to 0.
  484. // OUT IWbemCondition* ppIntersection Destination for the intersection.
  485. //
  486. // RETURN VALUES:
  487. //
  488. // WBEM_S_NO_ERROR Success.
  489. // WBEM_E_INVALID_PARAMETER
  490. // WBEM_E_FAILED
  491. //
  492. //==============================================================================
  493. //
  494. // UnionConditions
  495. //
  496. // OR's several conditions together to produce a new one condition which will
  497. // be satisfied if any of the members are.
  498. //
  499. // PARAMETERS:
  500. //
  501. // IN long lConditionCount The number of conditions to union.
  502. // IN IWbemCondition** aConditions The array of conditions to union.
  503. // IN long lFlags Reserved. Set to 0.
  504. // OUT IWbemCondition* ppIntersection Destination for the union.
  505. //
  506. // RETURN VALUES:
  507. //
  508. // WBEM_S_NO_ERROR Success.
  509. // WBEM_E_INVALID_PARAMETER
  510. // WBEM_E_FAILED
  511. //
  512. //==============================================================================
  513. [object, uuid(e2451056-b06e-11d0-ad61-00c04fd8fdff)]
  514. interface IWbemFilterServices : IUnknown
  515. {
  516. HRESULT ParseFilter(
  517. [in] WBEM_WSTR wszQueryLanguage,
  518. [in] WBEM_WSTR wszQuery,
  519. [in] long lFlags,
  520. [out] IWbemFilter** ppFilter,
  521. [out] IUnknown** ppError);
  522. HRESULT ConvertFilter(
  523. [in] IWbemFilter* pOriginal,
  524. [in] long lNumFormats,
  525. [in, size_is(lNumFormats)] WBEM_WSTR* awszFormat,
  526. [in] long lFlags,
  527. [in, size_is(lNumFormats)] IID *aiids,
  528. [out] long* plFormat,
  529. [out, iid_is(aiids + *plFormat)] IWbemFilter** ppConverted
  530. );
  531. HRESULT RestrictFilter(
  532. [in] IWbemFilter* pOriginal,
  533. [in] long lNumProperties,
  534. [in, size_is(lNumProperties)] WBEM_WSTR* awszPropertyNames,
  535. [in] long lFlags,
  536. [out] IWbemFilter** ppRestricted);
  537. HRESULT GetFilterDifference(
  538. [in] IWbemFilter* pSubtractFromWhat,
  539. [in] IWbemFilter* pSubtractWhat,
  540. [in] long lFlags,
  541. [out] IWbemFilter** ppDifference);
  542. HRESULT IntersectFilters(
  543. [in] long lConditionCount,
  544. [in, size_is(lConditionCount)] IWbemFilter** apFilters,
  545. [in] long lFlags,
  546. [out] IWbemFilter** ppIntersection);
  547. HRESULT UnionFilters(
  548. [in] long lConditionCount,
  549. [in, size_is(lConditionCount)] IWbemFilter** apFilters,
  550. [in] long lFlags,
  551. [out] IWbemFilter** ppIntersection);
  552. };
  553. //==============================================================================
  554. //==============================================================================
  555. //
  556. // Event-provider specific interfaces.
  557. //
  558. //==============================================================================
  559. //==============================================================================
  560. //==============================================================================
  561. //
  562. // interface IWbemRequirementChangeSink
  563. //
  564. // Receives notifications when the requirements for events on a given event
  565. // sink (IWbemEventSink) changes.
  566. //
  567. // Used: by WBEMOM to notify providers of requirement changes.
  568. // Implemented: by providers to recieve these notifications. registered using
  569. // IWbemEventSink::SetRequirementChangeSink.
  570. //
  571. //==============================================================================
  572. //
  573. // OnRequirementChange
  574. //
  575. // This method is called by WBEMOM on the IWbemRequirementChangeSink pointer
  576. // registered with a given IWbemEventSink when the requirements attached to that
  577. // event sink change.
  578. //
  579. // PARAMETERS:
  580. //
  581. // IN long lFlags Reserved. Set to 0.
  582. // IN IWbemFilter* pNewRequirements Condition corresponding to the new
  583. // requirement. This condition is
  584. // also available from IWbemEventSink::
  585. // GetRequirements.
  586. // IN IWbemFilter* pToAdd Condition describing what new objects are
  587. // now required which were not required before.
  588. // Formally, it is guaranted that
  589. // (pOld OR pToAdd) IMPLIES pNew, but it is not
  590. // guaranteed that
  591. // pOld AND pToAdd = <empty>
  592. // IN IWbemFilter* pToDelete Condition describing what objects that were
  593. // required are no longer required. Formally,
  594. // it is guaranteed that
  595. // (pNew OR pToDelete) IMPLIES pOld, but it is
  596. // not guaranteed that
  597. // pNew AND pDelete = <empty>
  598. //
  599. // It is also guaranteed that
  600. // (pOld AND NOT pToDelete) OR pToAdd =
  601. // pNew
  602. // RETURNS:
  603. //
  604. // WBEM_S_NO_ERROR Provider accepted the change
  605. // WBEM_E_FAILED Provider encountered an error.
  606. //
  607. //==============================================================================
  608. [object, uuid(e2451058-b06e-11d0-ad61-00c04fd8fdff)]
  609. interface IWbemRequirementChangeSink : IUnknown
  610. {
  611. HRESULT OnRequirementChange(
  612. [in] long lFlags,
  613. [in] IWbemFilter* pNewRequirement,
  614. [in] IWbemFilter* pToAdd,
  615. [in] IWbemFilter* pToDelete,
  616. [in] IUnknown* pContext // reserved for operation context
  617. );
  618. };
  619. //==============================================================================
  620. //
  621. // interface IWbemEventSink
  622. //
  623. // What providers stuff events into. Encapsulates a filter which it uses to
  624. // filter incoming events.
  625. //
  626. // Used: by providers to provide events and learn about registrations.
  627. // Implemented: by WBEMOM on event sink objects it gives out in
  628. // IWbemEventProvider::ProvideForNamespace.
  629. //
  630. //==============================================================================
  631. //
  632. // GetRequiremets
  633. //
  634. // Returns the condition this sink uses to filter events
  635. //
  636. // PARAMETERS:
  637. //
  638. // IWbemFilter** ppRequirements
  639. //
  640. // RETURN VALUES:
  641. //
  642. // WBEM_S_NO_ERROR
  643. // WBEM_E_FAILED
  644. //
  645. //==============================================================================
  646. //
  647. // SetRequirementChangeSink
  648. //
  649. // Sets the interface pointer that will be informed when the requirements for
  650. // this sink are changed. See IWbemRequirementChangeSink above for details.
  651. //
  652. // PARAMETERS:
  653. //
  654. // IN IWbemRequirementChangeSink* pNewSink
  655. // The pointer to inform of changes
  656. // OUT IWbemRequirementChangeSink** ppOldSink
  657. // Destination for the old pointer.
  658. // RETURNS:
  659. //
  660. // WBEM_S_NO_ERROR
  661. // WBEM_E_FAILED
  662. //
  663. //==============================================================================
  664. //
  665. // GetOptimizedSink
  666. //
  667. // Called by providers who have the knowledge that events coming from a
  668. // particular source (internal to the provider) always satisfy a certain
  669. // condition. Such a provider may want to get a specialized sink for this
  670. // event source, so that WBEMOM would have less checking to do when events
  671. // arrive. This is related to IWbemQueryServices::GetDifference method, but is
  672. // not the same!
  673. //
  674. // Note: by providing events into the optimized sink, the provider takes on
  675. // the responsibility for not lying to WBEMOM --- the guaranteed condition must
  676. // really be guaranteed!
  677. //
  678. // PARAMETERS:
  679. //
  680. // IN IWbemFilter* pGuaranteedCondition The condition that the provider
  681. // guarantees will be satisfied by
  682. // all events it will stuff into
  683. // the resulting sink.
  684. // IN long lFlags Reserved. Set to 0.
  685. // OUT IWbemEventSink** ppOptimizedSink Destination for the optimized
  686. // sink.
  687. // RETURNS:
  688. //
  689. // WBEM_S_NO_ERROR
  690. // WBEM_E_FAILED
  691. //
  692. //==============================================================================
  693. //
  694. // GetUsefulSubsink
  695. //
  696. // Only for providers doing all their filtering by themselves (WBEMOM chaining
  697. // is the only justifyable case of such behavior that I can see). In
  698. // addition to determining whether an event is useful, WBEMOM also needs to
  699. // determine which clients it needs to be dispatched to. If provider does its
  700. // own filtering, WBEMOM will still have to repeat that work if the event is to
  701. // be dispatched.
  702. //
  703. // This method allows such providers to learn about sub-conditions of the
  704. // big condition which WBEMOM is interested in. Using this information, providers
  705. // can do perfect filtering requiring no additional work from WBEMOM.
  706. //
  707. // It is guaranteed that the union of the conditions on all the subsinks
  708. // returned by this method implies the condition on the original sink. However,
  709. // the conditions on the sinks are not at all guaranteed to be disjoint.
  710. //
  711. // PARAMETERS:
  712. //
  713. // IN long lIndex The index of the "useful subsink" to return.
  714. // IN long lFlags
  715. // OUT IWbemEventSink** ppSink Destination for the subsink. Provider can
  716. // examine the sink and decide to supply
  717. // events into it, instead of the main sink.
  718. // NOTE: this sink is NOT optimized, i.e. it
  719. // will check all incoming events against its
  720. // condition. Use GetOptimizedSink on it to
  721. // promise to do all the filtering yourself.
  722. // RETURNS:
  723. //
  724. // WBEM_S_NO_ERROR Success
  725. // WBEM_S_NO_MORE_DATA lIndex is larger than the number of useful
  726. // sinks.
  727. // WBEM_E_FAILED
  728. //
  729. //==============================================================================
  730. //
  731. // IndicateWithHint
  732. //
  733. // Used by providers who tested their event against the condition of the sink
  734. // before constructing it (see IWbemFilter::CheckObject and
  735. // IWbemPropertySetRO above). When doing so, such a provider might have
  736. // recieved a "hint" (see again). Now that the provider is ready to supply
  737. // that event to WBEMOM, it can give the hint to WBEMOM so that WBEMOM would not
  738. // duplicate the work done in CheckObject.
  739. //
  740. // Note: it is the provider's responsibility to not lie to WBEMOM about the
  741. // hint, e.g., not to give the hint for the wrong object.
  742. //
  743. // Parameters:
  744. //
  745. // IWbemClassObject* pEvent The event to indicate
  746. // IUnknown* pHint The hint.
  747. //
  748. // RETURN VALUES:
  749. //
  750. // WBEM_S_NO_ERROR Success
  751. // ??? TBD: may want to handle acknowledgement problem here???
  752. //
  753. //==============================================================================
  754. [object, uuid(e2461059-b06e-11d0-ad61-00c04fd8fdff)]
  755. interface IWbemRawObjectSink : IUnknown
  756. {
  757. HRESULT IndicateRaw(
  758. [in] long lNumObjects,
  759. [in, size_is(lNumObjects)] IWbemPropertySource** apObjects);
  760. };
  761. [object, uuid(e2451059-b06e-11d0-ad61-00c04fd8fdff)]
  762. interface IWbemEventSink : IWbemRawObjectSink
  763. {
  764. HRESULT IndicateWithHint(
  765. [in] long lNumObjects,
  766. [in] IWbemClassObject* pObject,
  767. [in] IUnknown* pHint);
  768. HRESULT CheckObject(
  769. [in] IWbemPropertySource* pSource,
  770. [out] IWbemPropertyList** ppList,
  771. [out] IUnknown** ppHint);
  772. HRESULT GetRequirements(
  773. [out] IWbemFilter** ppRequirements);
  774. HRESULT SetRequirementChangeSink(
  775. [in] IWbemRequirementChangeSink* pNewSink,
  776. [out] IWbemRequirementChangeSink** ppOldSink);
  777. HRESULT GetOptimizedSink(
  778. [in] IWbemFilter* pGuaranteedCondition,
  779. [in] long lFlags,
  780. [out] IWbemEventSink** ppOptimizedSink);
  781. HRESULT GetUsefulSubsink(
  782. [in] long lIndex,
  783. [in] long lFlags,
  784. [out] IWbemEventSink** ppSubsink);
  785. };
  786. //==============================================================================
  787. //
  788. // interface IWbemEventProvider
  789. //
  790. // Primary event provider interface.
  791. //
  792. // Used: by WBEMOM to initiate communication with a provider.
  793. // Implemented: by providers. Accessible from their class factory.
  794. //
  795. //==============================================================================
  796. //
  797. // ProvideForNamespace
  798. //
  799. // Instructs the provider to begin providing events for a particular namespace.
  800. // Provider can learn more about what to provide from pSink.
  801. //
  802. // PARAMETERS:
  803. //
  804. // IN WCHAR* wszNamespaceName The full name of the namespace to provide
  805. // events for.
  806. // IN IWbemServices* pNamespace The pointer to the namespace object. Use
  807. // this pointer for all operations on the
  808. // namespace, rather than ConnectServer.
  809. // IN IWbemEventSink* pSink Where to supply events. Providers can also
  810. // learn about requirements from this sink, see
  811. // IWbemEventSink.
  812. // IN long lFlags Reserved. Set to 0.
  813. //
  814. //==============================================================================
  815. //
  816. // StopProvidingForNamespace
  817. //
  818. // Instructs the provide to stop providing events for this namespace. All
  819. // parameters are guaranteed to be the same as in the corresponding
  820. // ProvideForNamespace call. Provider should release any ref counts it has
  821. // on both pNamespace and pSink in response to this call, however, it does not
  822. // need to finish that before returning from this call.
  823. //
  824. // PARAMETERS:
  825. //
  826. // IN WCHAR* wszNamespaceName The full name of the namespace to stop
  827. // providing for.
  828. // IN IWbemServices* pNamespace The pointer to the namespace object. Use
  829. // this pointer for all operations on the
  830. // namespace, rather than ConnectServer.
  831. // IN IWbemEventSink* pSink Where to stop supplying events.
  832. // IN long lFlags Reserved. Set to 0.
  833. //
  834. //==============================================================================
  835. [object, uuid(e245105a-b06e-11d0-ad61-00c04fd8fdff)]
  836. interface IWbemEventProvider : IUnknown
  837. {
  838. HRESULT ProvideForNamespace(
  839. [in] WBEM_WSTR wszNamespaceName,
  840. [in] IWbemServices* pNamespace,
  841. [in] IWbemObjectSink* pSink,
  842. [in] WBEM_WSTR wszLocale,
  843. [in] long lFlags
  844. );
  845. };
  846. [object, uuid(a553f3f0-3805-11d0-b6b2-00aa003240c7)]
  847. interface IWbemEventSubsystem_m4 : IUnknown
  848. {
  849. HRESULT ProcessInternalEvent(
  850. [in] LONG lSendType,
  851. [in] BSTR strReserved1,
  852. [in] BSTR strReserved2,
  853. [in] BSTR strReserved3,
  854. [in] unsigned long dwReserved1,
  855. [in] unsigned long dwReserved2,
  856. [in] unsigned long dwNumObjects,
  857. [in, size_is(dwNumObjects)] IWbemClassObject** apObjects
  858. );
  859. HRESULT VerifyInternalEvent(
  860. [in] LONG lSendType,
  861. [in] BSTR strReserved1,
  862. [in] BSTR strReserved2,
  863. [in] BSTR strReserved3,
  864. [in] unsigned long dwReserved1,
  865. [in] unsigned long dwReserved2,
  866. [in] unsigned long dwNumObjects,
  867. [in, size_is(dwNumObjects)] IWbemClassObject** apObjects
  868. );
  869. HRESULT RegisterNotificationSink(
  870. [in] WBEM_WSTR wszNamespace,
  871. [in] WBEM_WSTR wszQueryLanguage,
  872. [in] WBEM_WSTR wszQuery,
  873. [in] long lFlags,
  874. [in] IWbemContext* pContext,
  875. [in] IWbemObjectSink* pSink);
  876. HRESULT RemoveNotificationSink(
  877. [in] IWbemObjectSink* pSink);
  878. HRESULT GetNamespaceSink(
  879. [in] WBEM_WSTR wszNamespace,
  880. [out] IWbemObjectSink** ppNamespaceSink);
  881. };
  882. [object, uuid(e245107a-b06e-11d0-ad61-00c04fd8fdff)]
  883. interface IWbemEventSubsystem : IUnknown
  884. {
  885. typedef struct
  886. {
  887. long lNumSinks;
  888. [size_is(lNumSinks)] IWbemRawObjectSink** apSinks;
  889. } WBEM_SINK_TABLE;
  890. HRESULT Startup(
  891. [in] IWbemLocator* pLocator,
  892. [in] WBEM_WSTR wszServerName,
  893. [in] IWbemClassObject* pIdentification);
  894. HRESULT Shutdown();
  895. HRESULT OpenNamespace(
  896. [in] WBEM_WSTR wszNamespaceName,
  897. [in] IWbemServices* pNamespace,
  898. [out] IWbemRawObjectSink** ppGenericSink,
  899. [out] WBEM_SINK_TABLE* pIntrinsicTable);
  900. HRESULT CloseNamespace(
  901. [in] WBEM_WSTR wszNamespaceName,
  902. [in] IWbemServices* pNamespace,
  903. [out] long* plNamespaceFlags);
  904. };
  905. //============================================================================
  906. //
  907. // Consumer interfaces
  908. //
  909. //============================================================================
  910. [object, uuid(e246107a-b06e-11d0-ad61-00c04fd8fdff)]
  911. interface IWbemEventConsumerProvider : IUnknown
  912. {
  913. HRESULT FindConsumer(
  914. [in] IWbemClassObject* pLogicalConsumer,
  915. [out] IWbemUnboundObjectSink** ppConsumer);
  916. };
  917. [object, uuid(a57be31e-efe3-11d0-ad71-00c04fd8fdff)]
  918. interface IWbemCausalityAccess : IUnknown
  919. {
  920. HRESULT GetCausalityId([out] unsigned long* pdwId);
  921. HRESULT SetCausalityId([in] unsigned long dwId);
  922. };
  923. [uuid(9ee8e422-c115-11d0-ad64-00c04fd8fdff)]
  924. library WbemQuery
  925. {
  926. interface IWbemObjectSink;
  927. [uuid(02c72e3e-c109-11d0-ad64-00c04fd8fdff)]
  928. coclass WbemClassInfoFilter
  929. {
  930. interface IWbemClassInfoFilter;
  931. interface IConfigureWbemClassInfoFilter;
  932. };
  933. [uuid(254896c8-c109-11d0-ad64-00c04fd8fdff)]
  934. coclass WbemQl1Filter
  935. {
  936. interface IWbemQl1Filter;
  937. interface IConfigureWbemQl1Filter;
  938. interface IWbemParse;
  939. };
  940. [uuid(08a59b5c-dd50-11d0-ad6b-00c04fd8fdff)]
  941. coclass ComEventConsumerProvider
  942. {
  943. interface IWbemEventConsumerProvider;
  944. };
  945. [uuid(5d08b586-343a-11d0-ad46-00c04fd8fdff)]
  946. coclass WbemEventSubsystem
  947. {
  948. interface IWbemEventSubsystem_m4;
  949. };
  950. [uuid(08a59b5d-dd50-11d0-ad6b-00c04fd8fdff)]
  951. coclass WbempEventConsumerProvider
  952. {
  953. interface IWbemUnboundObjectSink;
  954. };
  955. }