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.

495 lines
18 KiB

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