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.

494 lines
15 KiB

  1. //+-------------------------------------------------------------------
  2. //
  3. // File: Context.idl
  4. //
  5. // Contents: Context interfaces
  6. //
  7. // History: 04-Dec-97 Gopalk Created
  8. //
  9. //--------------------------------------------------------------------
  10. cpp_quote("//+-----------------------------------------------------------------")
  11. cpp_quote("//")
  12. cpp_quote("// Microsoft Windows")
  13. cpp_quote("// Copyright (C) Microsoft Corporation, 1992 - 1997.")
  14. cpp_quote("//")
  15. cpp_quote("//------------------------------------------------------------------")
  16. #ifndef DO_NO_IMPORTS
  17. import "wtypes.idl";
  18. import "objidl.idl";
  19. import "unknwn.idl";
  20. #endif
  21. /****************************************************************************
  22. * Context Types *
  23. ****************************************************************************/
  24. // Event types
  25. enum tagCONTEXTEVENT
  26. {
  27. CONTEXTEVENT_NONE = 0x00000000,
  28. // Call Events
  29. CONTEXTEVENT_CALL = 0x00000001,
  30. CONTEXTEVENT_ENTER = 0x00000002,
  31. CONTEXTEVENT_LEAVE = 0x00000004,
  32. CONTEXTEVENT_RETURN = 0x00000008,
  33. // Buffer Events
  34. CONTEXTEVENT_CALLFILLBUFFER = 0x00000010,
  35. CONTEXTEVENT_ENTERWITHBUFFER = 0x00000020,
  36. CONTEXTEVENT_LEAVEFILLBUFFER = 0x00000040,
  37. CONTEXTEVENT_RETURNWITHBUFFER = 0x00000080,
  38. // Begin Events
  39. CONTEXTEVENT_BEGINCALL = 0x00000100,
  40. CONTEXTEVENT_BEGINENTER = 0x00000200,
  41. CONTEXTEVENT_BEGINLEAVE = 0x00000400,
  42. CONTEXTEVENT_BEGINRETURN = 0x00000800,
  43. // Finish Events
  44. CONTEXTEVENT_FINISHCALL = 0x00001000,
  45. CONTEXTEVENT_FINISHENTER = 0x00002000,
  46. CONTEXTEVENT_FINISHLEAVE = 0x00004000,
  47. CONTEXTEVENT_FINISHRETURN = 0x00008000,
  48. // Buffer Events
  49. CONTEXTEVENT_BEGINCALLFILLBUFFER = 0x00010000,
  50. CONTEXTEVENT_BEGINENTERWITHBUFFER = 0x00020000,
  51. CONTEXTEVENT_FINISHLEAVEFILLBUFFER = 0x00040000,
  52. CONTEXTEVENT_FINISHRETURNWITHBUFFER = 0x00080000,
  53. // Exception Events
  54. CONTEXTEVENT_LEAVEEXCEPTION = 0x00100000,
  55. CONTEXTEVENT_LEAVEEXCEPTIONFILLBUFFER = 0x00200000,
  56. CONTEXTEVENT_RETURNEXCEPTION = 0x00400000,
  57. CONTEXTEVENT_RETURNEXCEPTIONWITHBUFFER = 0x00800000,
  58. // Other Events
  59. CONTEXTEVENT_ADDREFPOLICY = 0x10000000,
  60. CONTEXTEVENT_RELEASEPOLICY = 0x20000000
  61. };
  62. typedef DWORD ContextEvent;
  63. enum tagCPFLAGS
  64. {
  65. CPFLAG_NONE = 0x0,
  66. // Flags to determine whether the property gets copied when the context does
  67. CPFLAG_PROPAGATE = 0x1,
  68. CPFLAG_EXPOSE = 0x2,
  69. CPFLAG_ENVOY = 0x4,
  70. // Flags to determine whether the property receives stub/proxy
  71. // create/destroy events.
  72. CPFLAG_MONITORSTUB = 0x8,
  73. CPFLAG_MONITORPROXY = 0x10,
  74. // Flags to determine whether a property is used in context comparison
  75. CPFLAG_DONTCOMPARE = 0x20
  76. };
  77. #define MSHLFLAGS_NO_IEC 0x8 // don't use IExternalConnextion
  78. #define MSHLFLAGS_NO_IMARSHAL 0x10 // don't use IMarshal
  79. /****************************************************************************
  80. * Context Interfaces *
  81. ****************************************************************************/
  82. // IEnunContextProperties defined in objidl.idl
  83. interface IEnumContextProps;
  84. //IContext defined in objidl.idl
  85. interface IContext;
  86. // Interface for context-controlled marshalling
  87. [
  88. local,
  89. object,
  90. uuid(000001D8-0000-0000-C000-000000000046)
  91. ]
  92. interface IContextMarshaler : IUnknown
  93. {
  94. typedef [unique] IContextMarshaler *LPCTXMARSHALER;
  95. HRESULT GetMarshalSizeMax([in] REFIID riid,
  96. [in, unique] void *pv,
  97. [in] DWORD dwDestContext,
  98. [in, unique] void *pvDestContext,
  99. [in] DWORD mshlflags,
  100. [out] DWORD *pSize);
  101. HRESULT MarshalInterface([in, unique] IStream *pStm,
  102. [in] REFIID riid,
  103. [in, unique] void *pv,
  104. [in] DWORD dwDestContext,
  105. [in, unique] void *pvDestContext,
  106. [in] DWORD mshlflags);
  107. }
  108. //We don't want this IID in prvidl.lib
  109. #ifndef _OLE_PRVIDL_PASS_
  110. // IObjContext interface
  111. [
  112. local,
  113. object,
  114. uuid(000001c6-0000-0000-C000-000000000046),
  115. pointer_default(unique)
  116. ]
  117. interface IObjContext : IContext
  118. {
  119. typedef [ref] HRESULT __stdcall (*PFNCTXCALLBACK)(void* pParam);
  120. HRESULT Freeze();
  121. HRESULT DoCallback([in] PFNCTXCALLBACK pfnCallback,
  122. [in] void* pParam,
  123. [in] REFIID riid,
  124. [in] unsigned int iMethod);
  125. // These methods are here to minimize the code path for marshalling
  126. // otherwise I would put them in a separate interface
  127. // The Set methods can only be called before the context is frozen
  128. // Methods to set and get a special marshaller that is invoked for
  129. // GetMarshalSizeMax and MarshalInterface if MSHLFLAGS_USE_CTX_MSH is set
  130. HRESULT SetContextMarshaler([in] IContextMarshaler *pICM);
  131. HRESULT GetContextMarshaler([out] IContextMarshaler **pICM);
  132. // Ugly back-door methods to let us examine or modify the context flags
  133. // externally.
  134. HRESULT SetContextFlags([in] DWORD dwFlags); // flags |= dwFlags
  135. HRESULT ClearContextFlags([in] DWORD dwFlags); // flags &= ~dwFlags
  136. HRESULT GetContextFlags([out] DWORD *pdwFlags);
  137. }
  138. #else
  139. interface IObjContext;
  140. #endif
  141. // IGetContextId
  142. [
  143. local,
  144. object,
  145. uuid(000001dd-0000-0000-C000-000000000046),
  146. pointer_default(unique)
  147. ]
  148. interface IGetContextId : IUnknown
  149. {
  150. HRESULT GetContextId([out] GUID *pguidCtxtId);
  151. };
  152. // IAggregator
  153. [
  154. local,
  155. object,
  156. uuid(000001d8-0000-0000-C000-000000000046),
  157. pointer_default(unique)
  158. ]
  159. interface IAggregator : IUnknown
  160. {
  161. typedef [unique] IAggregator *IAGGREGATOR;
  162. HRESULT Aggregate([in] IUnknown* pInnerUnk);
  163. }
  164. // ICall interface
  165. [
  166. local,
  167. object,
  168. uuid(000001d6-0000-0000-C000-000000000046),
  169. pointer_default(unique)
  170. ]
  171. interface ICall : IUnknown
  172. {
  173. typedef [unique] ICall *LPCALL;
  174. HRESULT GetCallInfo([out] const void **ppIdentity,
  175. [out] IID *piid,
  176. [out] DWORD *pdwMethod,
  177. [out] HRESULT *phr);
  178. HRESULT Nullify([in] HRESULT hr);
  179. HRESULT GetServerHR([out] HRESULT *phr);
  180. };
  181. // IRpcCall interface
  182. [
  183. local,
  184. object,
  185. uuid(000001c5-0000-0000-C000-000000000046),
  186. pointer_default(unique)
  187. ]
  188. interface IRpcCall : IUnknown
  189. {
  190. typedef [unique] IRpcCall *LPRPCCALL;
  191. HRESULT GetRpcOleMessage([out] RPCOLEMESSAGE **ppMessage);
  192. };
  193. typedef enum _CALLSOURCE
  194. {
  195. CALLSOURCE_CROSSAPT = 0,
  196. CALLSOURCE_CROSSCTX = 1
  197. } CALLSOURCE;
  198. // ICallInfo interface
  199. [
  200. local,
  201. object,
  202. uuid(000001dc-0000-0000-C000-000000000046),
  203. pointer_default(unique)
  204. ]
  205. interface ICallInfo : IUnknown
  206. {
  207. HRESULT GetCallSource([out] CALLSOURCE* pCallSource);
  208. };
  209. // IPolicy interface
  210. [
  211. local,
  212. object,
  213. uuid(000001c2-0000-0000-C000-000000000046),
  214. pointer_default(unique)
  215. ]
  216. interface IPolicy : IUnknown
  217. {
  218. HRESULT Call([in] ICall *pCall);
  219. HRESULT Enter([in] ICall *pCall);
  220. HRESULT Leave([in] ICall *pCall);
  221. HRESULT Return([in] ICall *pCall);
  222. HRESULT CallGetSize([in] ICall *pCall,
  223. [out] ULONG *pcb);
  224. HRESULT CallFillBuffer([in] ICall *pCall,
  225. [in] void *pvBuf,
  226. [out] ULONG *pcb);
  227. HRESULT EnterWithBuffer([in] ICall *pCall,
  228. [in] void *pvBuf,
  229. [in] ULONG cb);
  230. HRESULT LeaveGetSize([in] ICall *pCall,
  231. [out] ULONG *pcb);
  232. HRESULT LeaveFillBuffer([in] ICall *pCall,
  233. [in] void *pvBuf,
  234. [out] ULONG *pcb);
  235. HRESULT ReturnWithBuffer([in] ICall *pCall,
  236. [in] void *pvBuf,
  237. [in] ULONG cb);
  238. ULONG AddRefPolicy();
  239. ULONG ReleasePolicy();
  240. };
  241. // IPolicyAsync interface
  242. [
  243. local,
  244. object,
  245. uuid(000001cd-0000-0000-C000-000000000046),
  246. pointer_default(unique)
  247. ]
  248. interface IPolicyAsync : IUnknown
  249. {
  250. HRESULT BeginCallGetSize([in] ICall *pCall,
  251. [out] ULONG *pcb);
  252. HRESULT BeginCall([in] ICall *pCall);
  253. HRESULT BeginCallFillBuffer([in] ICall *pCall,
  254. [in] void *pvBuf,
  255. [out] ULONG *pcb);
  256. HRESULT BeginEnter([in] ICall *pCall);
  257. HRESULT BeginEnterWithBuffer([in] ICall *pCall,
  258. [in] void *pvBuf,
  259. [in] ULONG cb);
  260. HRESULT BeginLeave([in] ICall *pCall);
  261. HRESULT BeginReturn([in] ICall *pCall);
  262. HRESULT FinishCall([in] ICall *pCall);
  263. HRESULT FinishEnter([in] ICall *pCall);
  264. HRESULT FinishLeaveGetSize([in] ICall *pCall,
  265. [out] ULONG *pcb);
  266. HRESULT FinishLeave([in] ICall *pCall);
  267. HRESULT FinishLeaveFillBuffer([in] ICall *pCall,
  268. [in] void *pvBuf,
  269. [out] ULONG *pcb);
  270. HRESULT FinishReturn([in] ICall *pCall);
  271. HRESULT FinishReturnWithBuffer([in] ICall *pCall,
  272. [in] void *pvBuf,
  273. [in] ULONG cb);
  274. };
  275. // IPolicySet interface
  276. [
  277. local,
  278. object,
  279. uuid(000001c3-0000-0000-C000-000000000046),
  280. pointer_default(unique)
  281. ]
  282. interface IPolicySet : IUnknown
  283. {
  284. HRESULT AddPolicy([in] ContextEvent ctxEvent,
  285. [in] REFGUID rguid,
  286. [in] IPolicy *pPolicy);
  287. }
  288. // IComObjIdentity interface
  289. [
  290. local,
  291. object,
  292. uuid(000001d7-0000-0000-C000-000000000046),
  293. pointer_default(unique)
  294. ]
  295. interface IComObjIdentity : IUnknown
  296. {
  297. BOOL IsServer();
  298. BOOL IsDeactivated();
  299. HRESULT GetIdentity([out] IUnknown** ppUnk);
  300. }
  301. // IPolicyMaker interface
  302. [
  303. local,
  304. object,
  305. uuid(000001c4-0000-0000-C000-000000000046),
  306. pointer_default(unique)
  307. ]
  308. interface IPolicyMaker : IUnknown
  309. {
  310. HRESULT AddClientPoliciesToSet([in] IPolicySet *pPS,
  311. [in] IContext *pClientContext,
  312. [in] IContext *pServerContext);
  313. HRESULT AddEnvoyPoliciesToSet([in] IPolicySet *pPS,
  314. [in] IContext *pClientContext,
  315. [in] IContext *pServerContext);
  316. HRESULT AddServerPoliciesToSet([in] IPolicySet *pPS,
  317. [in] IContext *pClientContext,
  318. [in] IContext *pServerContext);
  319. HRESULT Freeze([in] IObjContext *pObjContext);
  320. HRESULT CreateStub([in] IComObjIdentity *pID);
  321. HRESULT DestroyStub([in] IComObjIdentity *pID);
  322. HRESULT CreateProxy([in] IComObjIdentity *pID);
  323. HRESULT DestroyProxy([in] IComObjIdentity *pID);
  324. }
  325. // IExceptionNotification interface
  326. [
  327. local,
  328. object,
  329. uuid(000001db-0000-0000-C000-000000000046),
  330. pointer_default(unique)
  331. ]
  332. interface IExceptionNotification : IUnknown
  333. {
  334. void ServerException([in] void *pExcepPtrs);
  335. }
  336. // IAbandonmentNotification interface
  337. [
  338. local,
  339. object,
  340. uuid(000001de-0000-0000-C000-000000000046),
  341. pointer_default(unique)
  342. ]
  343. interface IAbandonmentNotification : IUnknown
  344. {
  345. void Abandoned (IObjContext* pObjContext);
  346. }
  347. // IMarshalEnvoy
  348. [
  349. local,
  350. object,
  351. uuid(000001c8-0000-0000-C000-000000000046),
  352. pointer_default(unique)
  353. ]
  354. interface IMarshalEnvoy : IUnknown
  355. {
  356. HRESULT GetEnvoyUnmarshalClass([in] DWORD dwDestContext,
  357. [out] CLSID* pClsid);
  358. HRESULT GetEnvoySizeMax([in] DWORD dwDestContext,
  359. [out] DWORD* pcb);
  360. HRESULT MarshalEnvoy([in] IStream* pStream,
  361. [in] DWORD dwDestContext);
  362. HRESULT UnmarshalEnvoy([in] IStream* pStream,
  363. [in] REFIID riid,
  364. [out, iid_is(riid)] void** ppunk);
  365. };
  366. // IWrapperInfo
  367. [
  368. local,
  369. object,
  370. uuid(5052f924-7ab8-11d3-b93f-00c04f990176),
  371. pointer_default(unique)
  372. ]
  373. interface IWrapperInfo : IUnknown
  374. {
  375. void SetMapping(void *pv);
  376. void *GetMapping();
  377. IObjContext *GetServerObjectContext();
  378. IUnknown *GetServerObject();
  379. };
  380. // ICOMDispatchInfo
  381. [
  382. local,
  383. object,
  384. uuid(000001d9-0000-0000-C000-000000000046),
  385. pointer_default(unique)
  386. ]
  387. interface IComDispatchInfo : IUnknown
  388. {
  389. HRESULT EnableComInits([out] void **ppvCookie);
  390. HRESULT DisableComInits([in] void *pvCookie);
  391. };
  392. typedef DWORD HActivator;
  393. cpp_quote("STDAPI CoCreateObjectInContext(IUnknown *pUnk, IObjContext *pObjectCtx, REFIID riid, void **ppv);")
  394. cpp_quote("STDAPI CoGetApartmentID(APTTYPE dAptType, HActivator* pAptID);")
  395. cpp_quote("STDAPI CoGetProcessIdentifier(GUID* pguidProcessIdentifier);")
  396. cpp_quote("STDAPI CoDeactivateObject(IUnknown *pUnk, IUnknown **ppCookie);")
  397. cpp_quote("STDAPI CoReactivateObject(IUnknown *pUnk, IUnknown *pCookie);")
  398. cpp_quote("#define MSHLFLAGS_NO_IEC 0x8 // don't use IExternalConnextion")
  399. cpp_quote("#define MSHLFLAGS_NO_IMARSHAL 0x10 // don't use IMarshal")
  400. cpp_quote("#define CONTEXTFLAGS_FROZEN 0x01 // Frozen context")
  401. cpp_quote("#define CONTEXTFLAGS_ALLOWUNAUTH 0x02 // Allow unauthenticated calls")
  402. cpp_quote("#define CONTEXTFLAGS_ENVOYCONTEXT 0x04 // Envoy context")
  403. cpp_quote("#define CONTEXTFLAGS_DEFAULTCONTEXT 0x08 // Default context")
  404. cpp_quote("#define CONTEXTFLAGS_STATICCONTEXT 0x10 // Static context")
  405. cpp_quote("#define CONTEXTFLAGS_INPROPTABLE 0x20 // Is in property table")
  406. cpp_quote("#define CONTEXTFLAGS_INDESTRUCTOR 0x40 // Is in destructor")
  407. cpp_quote("#define CONTEXTFLAGS_URTPROPPRESENT 0x80 // URT property added")
  408. //
  409. // CoModuleType enumeration
  410. //
  411. typedef enum tagCoModuleType
  412. {
  413. CO_MODULE_UNKNOWN = 0x00000000,
  414. CO_MODULE_32BIT = 0x00000001,
  415. CO_MODULE_64BIT = 0x00000002
  416. } CoModuleType;
  417. //
  418. // CoGetModuleType
  419. //
  420. cpp_quote ("STDAPI CoGetModuleType (LPCWSTR pwszModule, CoModuleType* pModType); ")
  421. //
  422. // SWC APIs
  423. //
  424. cpp_quote ("STDAPI CoPushServiceDomain (IObjContext* pObjContext); ")
  425. cpp_quote ("STDAPI CoPopServiceDomain (IObjContext** ppObjContext); ")