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.

200 lines
6.4 KiB

  1. import "unknwn.idl";
  2. import "wbemcli.idl";
  3. // Following interface allows for management of refreshable objects and enums that
  4. // can be cooked.
  5. [restricted,local,object,uuid(13ED7E55-8D63-41b0-9086-D0C5C17364C8)]
  6. interface IWMIRefreshableCooker : IUnknown
  7. {
  8. // Adds a new instance to the refreshable cooker. The Refreshable Instance
  9. // will be updated on calls to recalc.
  10. HRESULT AddInstance(
  11. [in] IWbemServices* pService, // The object's namespace
  12. [in] IWbemObjectAccess* pCookingClass, // Cooking class
  13. [in] IWbemObjectAccess* pCookingInstance, // An instance of the cooking class
  14. [out] IWbemObjectAccess** ppRefreshableInstance, // A clone of the instance used for refreshing
  15. [out] long* plId // The id of the refreshable cooking instance
  16. );
  17. // Adds a new enumeration to the refreshable cooker. The Refreshable Enumerator
  18. // will be updated on calls to recalc.
  19. HRESULT AddEnum(
  20. [in] IWbemServices* pService, // The object's namespace
  21. [in,string] LPCWSTR szCookingClass, // The cooking class' name
  22. [in] IWbemHiPerfEnum* pRefreshableEnum, // The enumerator passed in from WMI
  23. [out] long* plId // THe id of the refreshable cooking enumerator
  24. );
  25. // Removes the instance or enumerator specified by ulId from the
  26. // Refreshable Cooker.
  27. HRESULT Remove(
  28. [in] long lId
  29. );
  30. // Refreshes all instances and enumerators in the refreshable cooker
  31. HRESULT Refresh();
  32. };
  33. // Following interface allows for refreshable objects of the same class to be
  34. // cooked as a group.
  35. [restricted,local,object,uuid(A239BDF1-0AB1-45a0-8764-159115689589)]
  36. interface IWMISimpleObjectCooker : IUnknown
  37. {
  38. // Sets the class used by the cooker in order to fill out
  39. // instances when cooking. Once the class is set, it cannot
  40. // be reset
  41. HRESULT SetClass(
  42. [in] WCHAR* wszCookingClassName,
  43. [in] IWbemObjectAccess* pCookingClass,
  44. [in] IWbemObjectAccess* pRawClass
  45. );
  46. // Retrieves a new cooked instance and an id which can be used
  47. // to identify it. The instance will not be updated unless
  48. // a sample instance is bound to it via BeginCooking()
  49. HRESULT SetCookedInstance(
  50. [in] IWbemObjectAccess* pCookedInstance,
  51. [out] long* plId
  52. );
  53. // Provides an initial sample for cooking the instance specified
  54. // by ulId. Once the initial sample is set, it can be
  55. // cleared by calling BeginCooking again with another
  56. // instance
  57. HRESULT BeginCooking(
  58. [in] long lId,
  59. [in] IWbemObjectAccess* pSampleInstance,
  60. [in] unsigned long dwRefresherId
  61. );
  62. // Tells the cooker to stop cooking the instance specified
  63. // by ulId. Cooking can be restarted by calling BeginCooking
  64. // again.
  65. HRESULT StopCooking(
  66. [in] long lId
  67. );
  68. // Recalcs all instances using the appropriate cooking instances.
  69. HRESULT Recalc([in] unsigned long dwRefresherId);
  70. // Removes an instance from the object cooker
  71. HRESULT Remove(
  72. [in] long lId
  73. );
  74. // Clears all instances from the cooker.
  75. HRESULT Reset( void );
  76. };
  77. // Following interface allows for simple cooking of properties whose formulas
  78. // can be defined using 1 or 2 value samples.
  79. [restricted,local,object,uuid(510ADF6E-D481-4a64-B74A-CC712E11AA34)]
  80. interface IWMISimpleCooker : IUnknown
  81. {
  82. // Simple method for cooking a two value, one base counter
  83. HRESULT CookRawValues(
  84. [in] DWORD dwCookingType,
  85. [in] DWORD dwNumSamples,
  86. [in, size_is(dwNumSamples)] __int64* anTimeStamp,
  87. [in, size_is(dwNumSamples)] __int64* anRawValue,
  88. [in, size_is(dwNumSamples)] __int64* anBase,
  89. [in] __int64 nTimeFrequency,
  90. [out] __int64* pnResult
  91. );
  92. };
  93. /*
  94. // This interface is a placeholder. We need to decide if the
  95. // methods below are really appropriate for what we are planning
  96. // to do.
  97. [restricted,local,object,uuid(B1ADC67F-09E6-4adc-A45E-05BA3007CE30)]
  98. interface IWMIComplexCooker : public IUnknown
  99. {
  100. // Sets a formula in the cooker. If the formula is known, a known
  101. // id is returned. If not, then the formula is parsed and a new
  102. // id generated
  103. HRESULT SetFormula(
  104. [in] LPCWSTR pwszCookingType,
  105. [out] DWORD* pdwId
  106. );
  107. // General method for cooking a complex value - assumes that the formula follows
  108. // timestamp, time frequency, raw value and base value conventions
  109. HRESULT CookRawValues(
  110. [in] DWORD dwId,
  111. [in] ULONG nNumTimeStamps,
  112. [in,size_is(nNumTimeStamps)] unsigned __int64* pnTimestamps,
  113. [in] unsigned __int64 nTimeFrequency,
  114. [in,size_is(nNumTimeFrequency)] unsigned __int64* pnTimeFrequency,
  115. [in] ULONG nNumRawValues,
  116. [in,size_is(nNumRawValues)] unsigned __int64* pnRawValues,
  117. [in] ULONG nBaseValues,
  118. [in,size_is(nBaseValues)] unsigned __int64* pnBaseValues,
  119. [out] unsigned __int64 pnResult
  120. );
  121. // General method for cooking a free form value by using an array of
  122. // supplied values. The cooker uses the values from the array, in order,
  123. // and applies them to the formula.
  124. HRESULT CookGeneralRawValues(
  125. [in] DWORD dwId,
  126. [in] ULONG nNumValues,
  127. [in,size_is(nNumTimeStamps)] unsigned __int64* pnRawValues
  128. [out] unsigned __int64 pnResult
  129. );
  130. };
  131. // Use arrays of these structures to describe each sample
  132. typedef struct _WMI_COOKING_SAMPLE
  133. {
  134. ULONG ulIndex; // Index in class array
  135. ULONG ulCount; // Num Instances in array
  136. [size_is(ulCount)] IWbemObjectAccess** apInstances;
  137. } WMI_COOKING_SAMPLE;
  138. // This interface is a placeholder. We need to decide if the
  139. // methods below are really appropriate for what we are planning
  140. // to do.
  141. [restricted,local,object,uuid(979FF10D-D616-4448-BF08-3A79E01506B0)]
  142. interface IWMIComplexObjectCooker : public IUnknown
  143. {
  144. // Sets the class used by the cooker in order to fill out
  145. // instances when cooking.
  146. HRESULT SetClass(
  147. [in] IWbemObjectAccess* pCookingClass,
  148. );
  149. // Sets the initial instances. From this point forwards, additional
  150. // instances are supplied at Recalc time.
  151. HRESULT SetFirstSample(
  152. [in] ULONG ulCount,
  153. [in,size_is(ulCount)] WMI_COOKING_SAMPLE* apSampleData
  154. );
  155. // Clears the cooking data and all samples - Initial sample is now required
  156. HRESULT Reset( void );
  157. // Recalcs the specified instance using the supplied raw data. If this
  158. // is an initial sample, this sets the sample but doesn't atually recalc
  159. // anything. Fills out any properties that require cooking. Any others
  160. // must be filled out by the user themselves. This assumes a single instance
  161. // is used for cooking.
  162. HRESULT Recalc(
  163. [in,out] IWbemObjectAccess* pInstance,
  164. [in] ULONG ulCount,
  165. [in,size_is(ulCount)] WMI_COOKING_SAMPLE* apSampleData
  166. );
  167. };
  168. */