Leaked source code of windows server 2003
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.

513 lines
23 KiB

  1. // Copyright (C) 1999-2001 Microsoft Corporation. All rights reserved.
  2. // appsrvcs.idl : IDL source for appsrvcs.dll
  3. //
  4. // This file will be processed by the MIDL tool to
  5. // produce the type library (appsrvcs.tlb) and marshalling code.
  6. import "oaidl.idl";
  7. import "ocidl.idl";
  8. //////////////////////////////////////////////////////////////////////////
  9. // IApplianceServices Interface
  10. //////////////////////////////////////////////////////////////////////////
  11. //////////////////////////////////////////////////////////////////////
  12. [
  13. object,
  14. uuid(408B0460-B8E5-11D2-A91C-00AA00A71DCA),
  15. dual,
  16. pointer_default(unique)
  17. ]
  18. interface IApplianceServices : IDispatch
  19. {
  20. //////////////////////////////////////////////////////////////////////
  21. [public] typedef enum _SA_ALERT_TYPE
  22. {
  23. SA_ALERT_TYPE_MALFUNCTION,
  24. SA_ALERT_TYPE_FAILURE,
  25. SA_ALERT_TYPE_ATTENTION
  26. } SA_ALERT_TYPE;
  27. //////////////////////////////////////////////////////////////////////
  28. [public] typedef enum _SA_ALERT_DURATION
  29. {
  30. // Alert is logged only (no alert object is created)
  31. SA_ALERT_DURATION_EVANESCENT = 0,
  32. // Alert is active until explicitly cleared
  33. SA_ALERT_DURATION_ETERNAL = 0x7FFFFFFF
  34. } SA_ALERT_DURATION;
  35. [public] typedef enum _SA_ALERT_FLAGS
  36. {
  37. SA_ALERT_FLAG_NONE = 0x0,
  38. SA_ALERT_FLAG_SINGLETON = 0x1,
  39. SA_ALERT_FLAG_PERSISTENT = 0x2
  40. }SA_ALERT_FLAGS;
  41. //////////////////////////////////////////////////////////////////////
  42. //
  43. // Function: Initialize() - Used to initialize the appliance manager
  44. // services component
  45. //
  46. // Inputs: None:
  47. //
  48. // Outputs: S_OK: Function succeeded
  49. //
  50. // E_FAIL: Function failed.
  51. //
  52. //////////////////////////////////////////////////////////////////////
  53. [id(1)]
  54. HRESULT Initialize(void);
  55. //////////////////////////////////////////////////////////////////////
  56. //
  57. // Function: InitializeFromContext() - Used to initialize the
  58. // appliance manager services
  59. // Use instead of Initialize when calling from WMI process space
  60. //
  61. // Inputs: pContext: Pointer to the IUnknown interface for
  62. // a WMI provided namespace.
  63. //
  64. // Outputs: S_OK: Function succeeded
  65. //
  66. // E_FAIL: Function failed.
  67. //
  68. //////////////////////////////////////////////////////////////////////
  69. [id(2)]
  70. HRESULT InitializeFromContext(
  71. [in] IUnknown* pContext
  72. );
  73. //////////////////////////////////////////////////////////////////////
  74. //
  75. // Function: ResetAppliance() - Used to perform an orderly shutdown
  76. //
  77. // of the server appliance. This method works when the reliabiliity
  78. // framework is installed.
  79. //
  80. // Inputs: bPowerOff: If non zero then shutdown (power off)
  81. // the appliance. Otherwise reboot the appliance.
  82. //
  83. // Outputs: S_OK: Function succeeded
  84. //
  85. // E_FAIL: Unable to reset the appliance
  86. //
  87. //////////////////////////////////////////////////////////////////////
  88. [id(3)]
  89. HRESULT ResetAppliance(
  90. [in] VARIANT_BOOL bPowerOff
  91. );
  92. //////////////////////////////////////////////////////////////////////
  93. //
  94. // Function: RaiseAlert() - Called to raise an alert condition
  95. //
  96. // Inputs: lAlertType: Alert type value from the SA_ALERT_TYPE
  97. // enumeration.
  98. //
  99. // lAlertId: Alert identifier value.
  100. //
  101. // bstrAlertLog: Alert log source identifier.
  102. //
  103. // bstrAlertSource: String identifying the component that raised
  104. // the alert condition.
  105. //
  106. // lTimeToLive: Amount of time (in milliseconds) for which the
  107. // alert condition should remain active before
  108. // being cleared by the appliance manager. Set
  109. // this value to SA_ALERT_DURATION_ETERNAL if
  110. // the alert should remain active until explicitly
  111. // cleard by user action or system reset. Set this
  112. // value to SA_ALERT_DURATION_EVANESCENT to log
  113. // the alert only.
  114. //
  115. // pReplacementStrings: Variant containing an array of
  116. // basic strings that are used as
  117. // parameters to the formatted alert
  118. // alert message. This parameter can
  119. // be VT_EMPTY if there are no replacement
  120. // strings associated with the alert
  121. // condition format string in the MC file.
  122. //
  123. // pRawData: Variant containing an array of bytes containing
  124. // the raw data associated with the alert
  125. // condition. The raw data can be used to identify
  126. // a resource location property (for example "LPT1")
  127. // or any other information pertinent to the alert
  128. // condition. This parameter can be set to VT_EMPTY
  129. // if there is no raw data associated with the alert.
  130. //
  131. // pAlertCookie: Pointer to storage into which the function
  132. // returns a unique alert cookie (identifier).
  133. // The cookie can be used to clear the alert
  134. // by passing it to the ClearAlert() function.
  135. //
  136. // Outputs: S_OK: Function succeeded
  137. //
  138. // S_FALSE: Function succeeded but a singleton alert
  139. // exist.
  140. //
  141. // E_POINTER: NULL pointer was specified
  142. //
  143. // E_INVALIDARG: Invalid argument was specified
  144. //
  145. // E_OUTOFMEMORY: Not enough memory
  146. //
  147. // E_FAIL: Unable to report the alert condition
  148. //
  149. //////////////////////////////////////////////////////////////////////
  150. [id(4)]
  151. HRESULT RaiseAlert(
  152. [in] LONG lAlertType,
  153. [in] LONG lAlertId,
  154. [in] BSTR bstrAlertLog,
  155. [in] BSTR bstrAlertSource,
  156. [in] LONG lTimeToLive,
  157. [in] VARIANT* pReplacementStrings,
  158. [in] VARIANT* pRawData,
  159. [out, retval] LONG* pAlertCookie
  160. );
  161. //////////////////////////////////////////////////////////////////////
  162. //
  163. // Function: ClearAlert() - Called to clear an alert condition
  164. //
  165. // Inputs: lAlertCookie: Alert cookie returned by the RaiseAlert()
  166. // function.
  167. //
  168. // Outputs: S_OK: Function succeeded
  169. //
  170. // E_FAILED: Unable to clear the alert condition
  171. //
  172. //////////////////////////////////////////////////////////////////////
  173. [id(5)]
  174. HRESULT ClearAlert(
  175. [in] LONG lAlertCookie
  176. );
  177. //////////////////////////////////////////////////////////////////////
  178. //
  179. // Function: ClearAlertAll() - Called to clear all alerts that
  180. // match a given criteria.
  181. //
  182. // Inputs: lAlertID: ID of the alert to clear.
  183. //
  184. // bstrAlertLog: Alert Log where the alert resides.
  185. //
  186. // Outputs: S_OK: Function succeeded and one or more alerts were
  187. // cleared.
  188. //
  189. // E_POINTER: NULL pointer was specified
  190. //
  191. // E_INVALIDARG: Invalid argument was specified
  192. //
  193. // DISP_E_MEMBERNOTFOUND: No alerts matching the specified
  194. // criteria could be located.
  195. //
  196. // E_FAIL: Unable to clear the alerts
  197. //
  198. //////////////////////////////////////////////////////////////////////
  199. [id(6)]
  200. HRESULT ClearAlertAll(
  201. [in] LONG lAlertID,
  202. [in] BSTR bstrAlertLog
  203. );
  204. //////////////////////////////////////////////////////////////////////
  205. //
  206. // Function: ExecuteTask() - Called to execute an appliance task
  207. //
  208. // Inputs: bstrTaskName: Name of the task to execute
  209. //
  210. // pTaskParams: Pointer to an object containing the task
  211. // (in/out) parameters. The object must
  212. // expose the ITaskContext interface.
  213. //
  214. // Outputs: S_OK: The specified task has successfully completed
  215. //
  216. // E_FAIL: The specified task could not be executed
  217. //
  218. //////////////////////////////////////////////////////////////////////
  219. [id(7)]
  220. HRESULT ExecuteTask(
  221. [in] BSTR bstrTaskName,
  222. [in] IUnknown* pTaskParams
  223. );
  224. //////////////////////////////////////////////////////////////////////
  225. //
  226. // Function: EnableObject() - Used to enable core objects (e.g tasks)
  227. //
  228. // Inputs: lObjectType: Value from the SA_OBJECT_TYPE
  229. // enumeration (see applianceobject.idl).
  230. //
  231. // bstrObjectName: Object name. For tasks this is the
  232. // "TaskName" property.
  233. //
  234. // Outputs: S_OK: Function succeeded
  235. //
  236. // E_POINTER: NULL pointer was specified
  237. //
  238. // E_INVALIDARG: Invalid argument was specified
  239. //
  240. // E_OUTOFMEMORY: Not enough memory
  241. //
  242. //////////////////////////////////////////////////////////////////////
  243. [id(8)]
  244. HRESULT EnableObject(
  245. [in] LONG lObjectType,
  246. [in] BSTR bstrObjectName
  247. );
  248. //////////////////////////////////////////////////////////////////////
  249. //
  250. // Function: DisableObject() - Used to disable core objects (e.g tasks)
  251. //
  252. // Inputs: lObjectType: Value from the SA_OBJECT_TYPE
  253. // enumeration (see applianceobject.idl).
  254. //
  255. // bstrObjectName: Object name. For tasks this is the
  256. // "TaskName" property.
  257. //
  258. // Outputs: S_OK: Function succeeded
  259. //
  260. // E_POINTER: NULL pointer was specified
  261. //
  262. // E_INVALIDARG: Invalid argument was specified
  263. //
  264. // E_OUTOFMEMORY: Not enough memory
  265. //
  266. //////////////////////////////////////////////////////////////////////
  267. [id(9)]
  268. HRESULT DisableObject(
  269. [in] LONG lObjectType,
  270. [in] BSTR bstrObjectName
  271. );
  272. //////////////////////////////////////////////////////////////////////
  273. //
  274. // Function: GetObjectProperty() - Used to retrieve a core object
  275. // property
  276. //
  277. // Inputs: lObjectType: Value from the SA_OBJECT_TYPE
  278. // enumeration (see applianceobject.idl).
  279. //
  280. // bstrObjectName: Object name. For tasks this is the
  281. // "TaskName" property.
  282. //
  283. // bstrPropertyName: Name of the object property to
  284. // retrieve.
  285. //
  286. // pPropertyValue: Pointer to a variant that will
  287. // receive the returned property value
  288. //
  289. // Outputs: S_OK: Function succeeded
  290. //
  291. // E_POINTER: NULL pointer was specified
  292. //
  293. // E_INVALIDARG: Invalid argument was specified
  294. //
  295. // E_OUTOFMEMORY: Not enough memory
  296. //
  297. //////////////////////////////////////////////////////////////////////
  298. [id(10)]
  299. HRESULT GetObjectProperty(
  300. [in] LONG lObjectType,
  301. [in] BSTR bstrObjectName,
  302. [in] BSTR bstrPropertyName,
  303. [out, retval] VARIANT* pPropertyValue
  304. );
  305. //////////////////////////////////////////////////////////////////////
  306. //
  307. // Function: PutObjectProperty() - Used to retrieve a core object
  308. // property
  309. //
  310. // Inputs: lObjectType: Value from the SA_OBJECT_TYPE
  311. // enumeration (see applianceobject.idl).
  312. //
  313. // bstrObjectName: Object name. For tasks this is the
  314. // "TaskName" property.
  315. //
  316. // bstrPropertyName: Name of the object property to
  317. // update.
  318. //
  319. // pPropertyValue: Pointer to a variant containing the
  320. // new property value
  321. //
  322. // Outputs: S_OK: Function succeeded
  323. //
  324. // E_POINTER: NULL pointer was specified
  325. //
  326. // E_INVALIDARG: Invalid argument was specified
  327. //
  328. // E_OUTOFMEMORY: Not enough memory
  329. //
  330. //////////////////////////////////////////////////////////////////////
  331. [id(11)]
  332. HRESULT PutObjectProperty(
  333. [in] LONG lObjectType,
  334. [in] BSTR bstrObjectName,
  335. [in] BSTR bstrPropertyName,
  336. [in] VARIANT* pPropertyValue
  337. );
  338. //////////////////////////////////////////////////////////////////////
  339. //
  340. // Function: ExecuteTaskAsync() - Called to execute an appliance task
  341. // asynchronously. The final task
  342. // status is handled using the
  343. // appliance messaging facility.
  344. //
  345. // Inputs: bstrTaskName: Name of the task to execute
  346. //
  347. // pTaskParams: Pointer to an object containing the task
  348. // (in/out) parameters. The object must
  349. // expose the ITaskContext interface.
  350. //
  351. // Outputs: S_OK: The specified task was successfully invoked
  352. //
  353. // E_FAIL: The specified task could not be executed
  354. //
  355. //////////////////////////////////////////////////////////////////////
  356. [id(12)]
  357. HRESULT ExecuteTaskAsync(
  358. [in] BSTR bstrTaskName,
  359. [in] IUnknown* pTaskParams
  360. );
  361. //////////////////////////////////////////////////////////////////////
  362. //
  363. // Function: RaiseAlertEx () - Called to raise an alert condition as
  364. // singleton or persistent alert base on
  365. // alert flags.
  366. //
  367. // Inputs: lAlertType: Alert type value from the SA_ALERT_TYPE
  368. // enumeration.
  369. //
  370. // lAlertId: Alert identifier value.
  371. //
  372. // bstrAlertLog: Alert log source identifier.
  373. //
  374. // bstrAlertSource: String identifying the component that raised
  375. // the alert condition.
  376. //
  377. // lTimeToLive: Amount of time (in milliseconds) for which the
  378. // alert condition should remain active before
  379. // being cleared by the appliance manager. Set
  380. // this value to SA_ALERT_DURATION_ETERNAL if
  381. // the alert should remain active until explicitly
  382. // cleared by user action or system reset. Set this
  383. // value to SA_ALERT_DURATION_EVANESCENT to log
  384. // the alert only.
  385. //
  386. // pReplacementStrings: Variant containing an array of
  387. // basic strings that are used as
  388. // parameters to the formatted alert
  389. // alert message. This parameter can
  390. // be VT_EMPTY if there are no replacement
  391. // strings associated with the alert
  392. // condition format string in the MC file.
  393. //
  394. // pRawData: Variant containing an array of bytes containing
  395. // the raw data associated with the alert
  396. // condition. The raw data can be used to identify
  397. // a resource location property (for example "LPT1")
  398. // or any other information pertinent to the alert
  399. // condition. This parameter can be set to VT_EMPTY
  400. // if there is no raw data associated with the alert.
  401. //
  402. // lAlertFlags: Alert flag value from the SA_ALERT_FLAGS
  403. // enumeration.
  404. //
  405. // pAlertCookie: Pointer to storage into which the function
  406. // returns a unique alert cookie (identifier).
  407. // The cookie can be used to clear the alert
  408. // by passing it to the ClearAlert() function.
  409. //
  410. // Outputs: S_OK: Function succeeded and alert is raised
  411. //
  412. // S_FALSE: Function succeeded but a singleton alert
  413. // exist.
  414. //
  415. // E_POINTER: NULL pointer was specified
  416. //
  417. // E_INVALIDARG: Invalid argument was specified
  418. //
  419. // E_OUTOFMEMORY: Not enough memory
  420. //
  421. // E_FAIL: Unable to report the alert condition
  422. //
  423. //////////////////////////////////////////////////////////////////////
  424. [id(13)] HRESULT RaiseAlertEx (
  425. [in] LONG lAlertType,
  426. [in] LONG lAlertId,
  427. [in] BSTR bstrAlertLog,
  428. [in] BSTR bstrAlertSource,
  429. [in] LONG lTimeToLive,
  430. [in] VARIANT* pReplacementStrings,
  431. [in] VARIANT* pRawData,
  432. [in] LONG lAlertFlags,
  433. [out, retval] LONG* pAlertCookie
  434. );
  435. //////////////////////////////////////////////////////////////////////
  436. //
  437. // Function: IsAlertPresent() - Called to check the existence of an
  438. // alert.
  439. //
  440. // Inputs: lAlertID: ID of the alert to be checked.
  441. //
  442. // bstrAlertLog: Alert Log where the alert resides.
  443. //
  444. // pvIsPresent: Pointer to VARIANT_BOOL type value which is
  445. // used to verify the result of check.
  446. //
  447. // Outputs: S_OK: Function succeeded and one or more alerts exist.
  448. //
  449. // E_OUTOFMEMORY: Not enough memory
  450. //
  451. // E_FAIL: Unable to check the existence of the alert.
  452. //
  453. //////////////////////////////////////////////////////////////////////
  454. [id(14)] HRESULT IsAlertPresent(
  455. [in] LONG lAlertId,
  456. [in] BSTR bstrAlertLog,
  457. [out, retval] VARIANT_BOOL* pvIsPresent
  458. );
  459. };
  460. [
  461. uuid(FB75C300-CB9D-11D2-90C3-00AA00A71DCA),
  462. version(1.0),
  463. helpstring("Microsoft Server Appliance Manager Services 1.0 Type Library")
  464. ]
  465. library APPSRVCSLib
  466. {
  467. importlib("stdole32.tlb");
  468. importlib("stdole2.tlb");
  469. [
  470. uuid(1BF00631-CB9E-11D2-90C3-00AA00A71DCA),
  471. helpstring("ApplianceServices Class")
  472. ]
  473. coclass ApplianceServices
  474. {
  475. [default] interface IApplianceServices;
  476. };
  477. };