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.

490 lines
17 KiB

  1. import "unknwn.idl";
  2. import "transact.idl";
  3. import "wbemcli.idl";
  4. #define OPT
  5. /********************************************************************
  6. IWmiMessageSendReceive
  7. This is the interface to send or receive messages. Anyone wishing to
  8. receive messages implements this interfaces and passes it to a Wmi
  9. Message Receiver instance. Anyone wishing to send messages obtains a
  10. Wmi Message Sender instance which implements this interface.
  11. The FlagsStatus parameter is used to specify flags when sending and
  12. is used to specify a status when receiving.
  13. Auxiliary Data can be sent with the message. Some implementations
  14. may treat this data differently than the message data.
  15. *********************************************************************/
  16. [restricted, object, local, uuid(5BD9DF3C-6A1C-43c3-91C6-1CDDC0298083)]
  17. interface IWmiMessageSendReceive : IUnknown
  18. {
  19. HRESULT SendReceive( [in,size_is(cData)] BYTE* pData,
  20. [in] ULONG cData,
  21. [in,size_is(cAuxData)] BYTE* pAuxData,
  22. [in] ULONG cAuxData,
  23. [in] DWORD dwFlagsStatus,
  24. [in] OPT IUnknown* pContext );
  25. };
  26. /********************************************************************
  27. IWmiMessageMultiSendReceive
  28. This interface allows the one to send/receive messages to/from multiple
  29. SendReceive instances using a single call to SendReceive on this interface.
  30. Users build up the destination list using the Add() method.
  31. *********************************************************************/
  32. [restricted, object, local, uuid(0D1EE0A9-A096-43a0-ACF9-CED3D29EDC25)]
  33. interface IWmiMessageMultiSendReceive : IWmiMessageSendReceive
  34. {
  35. HRESULT Add( [in] DWORD dwFlags, // currently specify 0.
  36. [in] IWmiMessageSendReceive* pSndRcv );
  37. };
  38. /********************************************************************
  39. IWmiMessageTraceSink
  40. *********************************************************************/
  41. [restricted, object, local, uuid(A4A01B0C-8B4A-4fcd-91CA-338548A61949)]
  42. interface IWmiMessageTraceSink : IUnknown
  43. {
  44. HRESULT Notify( [in] HRESULT hr,
  45. [in] GUID guidSource,
  46. [in] OPT LPCWSTR wszTrace,
  47. [in] OPT IUnknown* pContext );
  48. };
  49. /********************************************************************
  50. IWmiMessageSender
  51. This interface allows users to obtain an IWmiMessageSendReceive
  52. interface that can be used to send messages. This interface is not
  53. stateful, so multiple Open() calls can be made using the same or
  54. different parameters without affecting instances obtained through
  55. previous calls. Once an send interface is obtained, this interface
  56. can also be released without affecting instances from previous calls.
  57. *********************************************************************/
  58. typedef struct tagWMIMSG_SNDR_AUTH_INFO
  59. {
  60. LPCWSTR wszTargetPrincipal;
  61. LPCWSTR wszIdentity;
  62. LPCWSTR wszDomain;
  63. LPCWSTR wszPasswd;
  64. } WMIMSG_SNDR_AUTH_INFO, *WMIMSG_SNDR_AUTH_INFOP;
  65. [restricted, object, local, uuid(3049205F-47FC-4f17-9136-D843AEE1206F)]
  66. interface IWmiMessageSender : IUnknown
  67. {
  68. HRESULT Open( [in] LPCWSTR wszTarget,
  69. [in] DWORD dwFlags,
  70. [in] WMIMSG_SNDR_AUTH_INFOP pAuthInfo,
  71. [in] OPT LPCWSTR wszResponse,
  72. [in] OPT IWmiMessageTraceSink* pTraceSink,
  73. [out] IWmiMessageSendReceive** ppSend );
  74. };
  75. /********************************************************************
  76. IWmiMessageReceiver
  77. This interface allows users to specify an IWmiMessageSendReceive
  78. interface that will be used to receive messages asynchronously.
  79. Once the Open() method is called, the receiver will start listening and
  80. servicing messages from the specified endpoint. The user must be prepared
  81. for calls to be made to the SendReceive method during the Open() call.
  82. To stop the servicing process, the user calls the Close() method.
  83. Implementations will implicitly call this method when the last reference is
  84. released and just before each Open() call. The Close() method is idempotent.
  85. Only when Close() has returned, either from an implicit or explicit call,
  86. can the user assume that no calls will be made to the callback interface.
  87. The SendReceive instance can also implement the IWmiMessageTraceSink
  88. interface to receive trace notifications. This interface will be used
  89. only for errors occurring asynchronously, such as asynchronous receiving
  90. errors. Any error returned from the methods of this interface will NOT
  91. be reported to the error sink.
  92. *********************************************************************/
  93. typedef struct tagWMIMSG_RCVR_AUTH_INFO
  94. {
  95. LPCWSTR* awszPrincipal;
  96. ULONG cwszPrincipal;
  97. } WMIMSG_RCVR_AUTH_INFO, *WMIMSG_RCVR_AUTH_INFOP;
  98. [restricted, object, local, uuid(B0CFB756-C5D8-4b04-BB64-3AF723166F53)]
  99. interface IWmiMessageReceiver : IUnknown
  100. {
  101. HRESULT Open( [in] LPCWSTR wszEndpoint,
  102. [in] DWORD dwFlags,
  103. [in] WMIMSG_RCVR_AUTH_INFOP pAuthInfo,
  104. [in] IWmiMessageSendReceive* pRecv );
  105. HRESULT Close();
  106. };
  107. /****************************************************************************
  108. IWmiMessageReceiverContext
  109. ****************************************************************************/
  110. [restricted, object, local, uuid(42D36328-BBFF-4f0e-849B-BD520CF161B6)]
  111. interface IWmiMessageReceiverContext : IUnknown
  112. {
  113. HRESULT GetTimeSent( [out] SYSTEMTIME* pTime );
  114. HRESULT GetSendingMachine( [out,size_is(cMachine)] WCHAR* awchMachine,
  115. [in] ULONG cMachine,
  116. [out] ULONG* pcMachine );
  117. HRESULT GetTarget( [out,size_is(cTarget)] WCHAR* awchTarget,
  118. [in] ULONG cTarget,
  119. [out] ULONG* pcTarget );
  120. HRESULT GetSenderId( [out,size_is(cSenderId)] BYTE* achSenderId,
  121. [in] ULONG cSenderId,
  122. [out] ULONG* pcSenderId );
  123. HRESULT IsSenderAuthenticated();
  124. HRESULT ImpersonateSender();
  125. HRESULT RevertToSelf();
  126. };
  127. /****************************************************************************
  128. IWmiMessageQueueReceiver - receiver interface specific to Queues.
  129. Implementations of this interface do not handle asynchronous receiving -
  130. this is a syncrhonous interface. However, the callback approach is used
  131. for received messages so that we can avoid unnecesary copying of messages.
  132. This interface is not multithread safe since it implies that the message
  133. is saved as state.
  134. *****************************************************************************/
  135. [restricted, object, local, uuid(4FB36328-BBFF-4f0e-849B-BD520CF161B6)]
  136. interface IWmiMessageQueueReceiver : IUnknown
  137. {
  138. HRESULT ReceiveMessage( DWORD dwTimeout,
  139. PVOID pCursor,
  140. DWORD dwAction,
  141. ITransaction* pTxn );
  142. HRESULT CreateCursor( [out] PVOID* ppvCursor );
  143. HRESULT DestroyCursor( [in] PVOID pvCursor );
  144. };
  145. /****************************************************************************
  146. IWmiMessageQueue - interface for opening queues for receiving.
  147. *****************************************************************************/
  148. [restricted, object, local, uuid(E169E1E3-CC16-4dc2-A5B7-6C165C6B17F8)]
  149. interface IWmiMessageQueue : IUnknown
  150. {
  151. HRESULT Open( [in] LPCWSTR wszEndpoint,
  152. [in] DWORD dwFlags,
  153. [in] OPT IWmiMessageSendReceive* pRecv,
  154. [out] IWmiMessageQueueReceiver** ppRecvr );
  155. };
  156. /****************************************************************************
  157. IWmiMessageQueueManager
  158. *****************************************************************************/
  159. [restricted, object, local, uuid(35F36F0E-9FD6-483f-94F9-CE0367863376)]
  160. interface IWmiMessageQueueManager : IUnknown
  161. {
  162. HRESULT Create( [in] LPCWSTR wszPathName,
  163. [in] GUID guidType,
  164. [in] BOOL bAuth,
  165. [in] DWORD dwQos,
  166. [in] DWORD dwQuota,
  167. [in] OPT PVOID pSecurityDescriptor );
  168. HRESULT Destroy( [in] LPCWSTR wszName );
  169. HRESULT GetAllNames( [in] GUID guidTypeFilter,
  170. [in] BOOL bPrivateOnly,
  171. [out] LPWSTR** ppwszNames,
  172. [out] ULONG* pcNames );
  173. };
  174. /*************************************************************************
  175. IWmiObjectMarshal - Interface for efficiently marshaling/unmarshaling
  176. groups of wbem objects. Implementations of this interface can be stateful.
  177. It will only marshal class information once. To release the state held
  178. within the object, use Flush().
  179. **************************************************************************/
  180. [restricted, object, local, uuid(31C80872-1221-4907-BCB1-9BA58BE7847A)]
  181. interface IWmiObjectMarshal : IUnknown
  182. {
  183. HRESULT Pack( [in] IWbemClassObject* pObj,
  184. [in] LPCWSTR wszNamespace, // for undecorated objs
  185. [in] DWORD dwFlags,
  186. [in] ULONG cBuff,
  187. [out,size_is(cBuff)] BYTE* pBuff,
  188. [out] ULONG* pcUsed );
  189. HRESULT Unpack( [in] ULONG cBuff,
  190. [in,size_is(cBuff)] BYTE* pBuff,
  191. [in] DWORD dwFlags,
  192. [out] IWbemClassObject** ppObj,
  193. [out] ULONG* pcUsed );
  194. HRESULT Flush();
  195. };
  196. [restricted, object, local, uuid(5BD3213C-6A1C-43c3-91C6-1CDDC0298083)]
  197. interface IWmiObjectAccess : IUnknown
  198. {
  199. HRESULT GetProp( LPVOID pHdl, DWORD dwFlags, VARIANT* pvar, CIMTYPE* pct );
  200. HRESULT PutProp( LPVOID pHdl, DWORD dwFlags, VARIANT* pvar, CIMTYPE ct );
  201. HRESULT SetObject( IWbemClassObject* pObj );
  202. HRESULT GetObject( IWbemClassObject** ppObj );
  203. HRESULT CommitChanges();
  204. };
  205. [restricted, object, local, uuid(5BD1233C-6A1C-43c3-91C6-1CDDC0298083)]
  206. interface IWmiObjectAccessFactory : IUnknown
  207. {
  208. //
  209. // optional call. is used to help optimize the accessors even more
  210. //
  211. HRESULT SetObjectTemplate( IWbemClassObject* pTemplate );
  212. HRESULT GetObjectAccess( IWmiObjectAccess** ppAccess );
  213. HRESULT GetPropHandle( LPCWSTR wszProp, DWORD dwFlags, LPVOID* ppHdl );
  214. };
  215. /***********************************************************************
  216. IWmiMessageReceiverSink - INTERNAL ONLY
  217. This interfaces encapsulates the logic of actually receiving and
  218. handling incoming messages from a queue, network connection, etc..
  219. The interface methods allow the receiving and handling to be broken
  220. into two distinct tasks. This separation allows an overlapped i/o
  221. receiving model to be supported.
  222. This interface is implemented by Receivers. When they are activated,
  223. through their Open() method, they hand their associated receiver sink
  224. to a message service through the IWmiMessageService interface.
  225. This is a stateful interface. It implies that there is a single
  226. receive buffer associated with the sink.
  227. Receiver Sinks that handle overlapped i/o pass the pOverlapped structure
  228. to the actual receive operation.
  229. ************************************************************************/
  230. [restricted, object, local, uuid(80CF2156-C5D8-4b04-BB64-3AF723166F53)]
  231. interface IWmiMessageReceiverSink : IUnknown
  232. {
  233. HRESULT Receive( OPT void* pOverlapped );
  234. HRESULT Notify( OPT void* pOverlapped );
  235. };
  236. /***********************************************************************
  237. IWmiMessageService - INTERNAL ONLY
  238. The message service interface encapsulates the logic of thread pooling
  239. and overlapped i/o.
  240. When receivers become active, they pass their IWmiMessageReceiverSink
  241. implementation to the service using the Add() method. When receivers
  242. become inactive, they remove themselves from the service using Remove().
  243. It is important to note that a receiver is responsible for cancelling any
  244. pending receive calls before calling remove. Failing to do this will
  245. cause the Remove() method to hang. A receiver most often can do this by
  246. closing their file handle.
  247. Receivers that can handle overlapped i/o pass their file handle to the
  248. service. This allows N receivers to be shared across M threads.
  249. Receivers that do not handle overlapped i/o do not pass their file handle.
  250. They will have their own dedicated thread.
  251. ************************************************************************/
  252. [restricted, object, local, uuid(DAFB73A1-6E9E-483a-982A-0E51C039E18E)]
  253. interface IWmiMessageService : IUnknown
  254. {
  255. HRESULT Add( [in] IWmiMessageReceiverSink* pSink,
  256. [in] OPT HANDLE* phOverlappedFile,
  257. [in] DWORD dwFlags,
  258. [out] void** ppHdl );
  259. HRESULT Remove( [in] void* pHdl );
  260. };
  261. [uuid(90B3BB2E-EAE8-40e9-A1D8-3A4CD7CDB648)]
  262. library WmiMessage_v1
  263. {
  264. typedef enum tag_WMIMSG_MARSHAL_FLAG
  265. {
  266. WMIMSG_FLAG_MRSH_FULL = 0x00,
  267. WMIMSG_FLAG_MRSH_PARTIAL = 0x01,
  268. WMIMSG_FLAG_MRSH_FULL_ONCE = 0x02,
  269. } WMIMSG_MARSHAL_FLAG;
  270. typedef enum tag_WMIMSG_QOS_FLAG
  271. {
  272. WMIMSG_FLAG_QOS_SYNCHRONOUS = 0x00,
  273. WMIMSG_FLAG_QOS_EXPRESS = 0x01,
  274. WMIMSG_FLAG_QOS_GUARANTEED = 0x02,
  275. WMIMSG_FLAG_QOS_XACT = 0x03
  276. } WMIMSG_QOS_FLAG;
  277. typedef enum tag_WMIMSG_SND_FLAG
  278. {
  279. WMIMSG_FLAG_SNDR_AUTHENTICATE = 0x10,
  280. WMIMSG_FLAG_SNDR_ENCRYPT = 0x20,
  281. WMIMSG_FLAG_SNDR_LAZY_INIT = 0x40,
  282. WMIMSG_FLAG_SNDR_ACK = 0x80,
  283. WMIMSG_FLAG_SNDR_NACK_ONLY = 0x100,
  284. WMIMSG_FLAG_SNDR_PRIV_SIGN = 0x200
  285. } WMIMSG_SND_FLAG;
  286. typedef enum tag_WMIMSG_RCV_FLAG
  287. {
  288. WMIMSG_FLAG_RCVR_IMPERSONATE = 0x10,
  289. WMIMSG_FLAG_RCVR_PRIV_VERIFY = 0x20,
  290. WMIMSG_FLAG_RCVR_SECURE_ONLY = 0x30,
  291. WMIMSG_FLAG_RCVR_ACK = 0x40
  292. } WMIMSG_RCV_FLAG;
  293. typedef enum tag_WMIMSG_FLAG_MASK
  294. {
  295. WMIMSG_MASK_QOS = 0x0f,
  296. WMIMSG_MASK_SNDRRCVR = 0xfff0
  297. } WMIMSG_FLAG_MASK;
  298. typedef enum tag_WMIMSG_MULTISEND_FLAG
  299. {
  300. WMIMSG_FLAG_MULTISEND_RETURN_IMMEDIATELY = 0x1, // specified on Send
  301. WMIMSG_FLAG_MULTISEND_TERMINATING_SENDER = 0x1, // specified on Add
  302. } WMIMSG_MULTISEND_FLAG;
  303. typedef enum tag_WMIMSG_STATUS
  304. {
  305. WMIMSG_E_MSGTOOLARGE = 0x80042100,
  306. WMIMSG_E_AUTHFAILURE = 0x80042101,
  307. WMIMSG_E_ENCRYPTFAILURE = 0x80042102,
  308. WMIMSG_E_QOSFAILURE = 0x80042103,
  309. WMIMSG_E_XACTFAILURE = 0x80042104,
  310. WMIMSG_E_INVALIDADDRESS = 0x80042105,
  311. WMIMSG_E_TARGETNOTFOUND = 0x80042106,
  312. WMIMSG_E_INVALIDMESSAGE = 0x80042108,
  313. WMIMSG_E_REQSVCNOTAVAIL = 0x80042109,
  314. WMIMSG_E_TIMEDOUT = 0x80042110,
  315. WMIMSG_E_EXCEEDEDQUOTA = 0x80042111,
  316. WMIMSG_E_QUEUEPURGED = 0x80042112,
  317. WMIMSG_E_TARGETNOTLISTENING = 0x80042113
  318. } WMIMSG_STATUS;
  319. typedef enum tag_WMIMSG_QRCV_ACTION
  320. {
  321. WMIMSG_ACTION_QRCV_PEEK_CURRENT = 0x1,
  322. WMIMSG_ACTION_QRCV_PEEK_NEXT = 0x2,
  323. WMIMSG_ACTION_QRCV_RECEIVE = 0x3,
  324. WMIMSG_ACTION_QRCV_REMOVE = 0x4
  325. } WMIMSG_QRCV_ACTION;
  326. [restricted, uuid(122D47A6-CEEC-4de1-8056-B6D16F29BC97)]
  327. coclass WmiMessageMsmqSender
  328. {
  329. interface IWmiMessageSender;
  330. };
  331. [restricted, uuid(9E007F18-9C24-4630-8B3E-61F96280C593)]
  332. coclass WmiMessageMsmqReceiver
  333. {
  334. interface IWmiMessageReceiver;
  335. };
  336. [restricted, uuid(622D47B6-CEEC-4de1-8056-B6D16F29BC97)]
  337. coclass WmiMessageRpcSender
  338. {
  339. interface IWmiMessageSender;
  340. };
  341. [restricted, uuid(9F007F18-9C24-4630-8B3E-61F96280C593)]
  342. coclass WmiMessageRpcReceiver
  343. {
  344. interface IWmiMessageReceiver;
  345. };
  346. [restricted, uuid(89F9F7B0-8DE3-4ae0-8B41-109ABAB32151)]
  347. coclass WmiMessageMultiSendReceive
  348. {
  349. interface IWmiMessageMultiSendReceive;
  350. };
  351. [restricted, uuid(C89DBDC4-5491-409a-8D00-E34538211FED)]
  352. coclass WmiMessageQueue
  353. {
  354. interface IWmiMessageQueue;
  355. };
  356. [restricted, uuid(FF10E656-2B7C-421e-B145-7AB337FB865F)]
  357. coclass WmiMessageQueueManager
  358. {
  359. interface IWmiMessageQueueManager;
  360. };
  361. [restricted, uuid(CE69CC1E-1EC0-4847-9C0D-D2F2D80D07CF)]
  362. coclass WmiMessageService
  363. {
  364. // singleton
  365. interface IWmiMessageService;
  366. };
  367. [restricted, uuid(C169CC11-1EC1-4847-9C0D-D2F2D80D07CF)]
  368. coclass WmiSmartObjectMarshal
  369. {
  370. interface IWmiObjectMarshal;
  371. };
  372. [restricted, uuid(958c59a0-3670-4fe0-b893-6998bb494402)]
  373. coclass WmiSmartObjectUnmarshal
  374. {
  375. interface IWmiObjectMarshal;
  376. };
  377. [restricted, uuid(C1692211-1EC1-4847-9C0D-D2F2D80D07CF)]
  378. coclass WmiSmartObjectAccessFactory
  379. {
  380. interface IWmiObjectAccessFactory;
  381. };
  382. };