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.

703 lines
21 KiB

  1. /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2. Copyright (c) 1994-2000 Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. ndrole.h
  5. Abstract:
  6. OLE routines for interface pointer marshalling.
  7. Author:
  8. ShannonC 18-Apr-1994
  9. Environment:
  10. Windows NT and Windows 95.
  11. Revision History:
  12. ---------------------------------------------------------------------*/
  13. #ifndef _NDROLE_
  14. #define _NDROLE_
  15. #include <objbase.h>
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. // ProxyFile->TableVersion may be
  20. // 1 for really old junk
  21. // 2 since the time we defined new proxy and stub Buffer2 for delegation
  22. // 6 for async uuid as we treat the previous values as flags.
  23. #define NDR_PROXY_FILE_ASYNC_UUID 0x4
  24. EXTERN_C IStream *__stdcall
  25. NdrpCreateStreamOnMemory( unsigned char *pData, unsigned long cbSize );
  26. // Note, both proxies and stubs have been remapped to the same size,
  27. // as a preparation for some code simplifications.
  28. // This means that some fields may not be used in some circumstances.
  29. // Non-delegated proxy
  30. typedef struct tagCStdProxyBuffer
  31. {
  32. const struct IRpcProxyBufferVtbl * lpVtbl;
  33. const void * pProxyVtbl; //Points to Vtbl in CInterfaceProxyVtbl
  34. long RefCount;
  35. struct IUnknown * punkOuter;
  36. struct IRpcChannelBuffer * pChannel;
  37. struct IPSFactoryBuffer * pPSFactory; // endof old ProxyBuffer
  38. struct IRpcProxyBuffer * Pad_pBaseProxyBuffer;
  39. struct IPSFactoryBuffer * Pad_pPSFactory;
  40. IID Pad_iidBase;
  41. const struct ICallFactoryVtbl * pCallFactoryVtbl;
  42. const IID * pAsyncIID;
  43. const struct IReleaseMarshalBuffersVtbl * pRMBVtbl;
  44. } CStdProxyBuffer;
  45. // Delegated proxy
  46. typedef struct tagCStdProxyBuffer2
  47. {
  48. const struct IRpcProxyBufferVtbl * lpVtbl;
  49. const void * pProxyVtbl; //Points to Vtbl in CInterfaceProxyVtbl
  50. long RefCount;
  51. struct IUnknown * punkOuter;
  52. struct IRpcChannelBuffer * pChannel;
  53. struct IUnknown * pBaseProxy; // colides with pPSFactory
  54. struct IRpcProxyBuffer * pBaseProxyBuffer;
  55. struct IPSFactoryBuffer * pPSFactory;
  56. IID iidBase; // endof old ProxyBuffer2
  57. const struct ICallFactoryVtbl * pCallFactoryVtbl;
  58. const IID * pAsyncIID;
  59. const struct IReleaseMarshalBuffersVtbl * pRMBVtbl;
  60. } CStdProxyBuffer2;
  61. // Async proxy buffer, one for delegated and non-delegated case.
  62. typedef struct _NdrDcomAsyncFlags
  63. {
  64. unsigned long AsyncMsgSet : 1;
  65. unsigned long BeginStarted : 1;
  66. unsigned long BeginDone : 1;
  67. unsigned long FinishStarted : 1;
  68. unsigned long FinishDone : 1;
  69. unsigned long BeginError : 1;
  70. unsigned long FinishError : 1;
  71. unsigned long InvokeForwarded : 1;
  72. unsigned long Unused :24;
  73. } NdrDcomAsyncFlags;
  74. typedef struct _CStdProxyBufferMap
  75. {
  76. struct IUnknown * pBaseProxy;
  77. } CStdProxyBufferMap;
  78. typedef struct _NdrDcomAsyncCallState
  79. {
  80. unsigned long Signature;
  81. unsigned long Lock;
  82. void * pAsyncMsg;
  83. NdrDcomAsyncFlags Flags;
  84. HRESULT Hr;
  85. } NdrDcomAsyncCallState;
  86. typedef struct tagCStdAsyncProxyBuffer
  87. {
  88. const struct IRpcProxyBufferVtbl * lpVtbl;
  89. const void * pProxyVtbl; //Points to Vtbl in CInterfaceProxyVtbl
  90. long RefCount;
  91. struct IUnknown * punkOuter;
  92. struct IRpcChannelBuffer * pChannel;
  93. CStdProxyBufferMap map; // the only colision 1<>2
  94. struct IRpcProxyBuffer * pBaseProxyBuffer;
  95. struct IPSFactoryBuffer * pPSFactory;
  96. IID iidBase;
  97. const struct ICallFactoryVtbl * pCallFactoryVtbl;
  98. const IID * pSyncIID; // points to sync iid in async
  99. // endof new ProxyBuffer,2
  100. const struct IReleaseMarshalBuffersVtbl * pRMBVtbl;
  101. NdrDcomAsyncCallState CallState;
  102. } CStdAsyncProxyBuffer;
  103. // This definition is in rpcproxy.h because CStdStubBuffer::pvServerObject is called explicitly
  104. // from /Os stub.
  105. // It is reproduced here for convenience.
  106. // It should be removed from there or may be left but a renamed clone used internally.
  107. #if 0
  108. typedef struct tagCStdStubBuffer
  109. {
  110. const struct IRpcStubBufferVtbl * lpVtbl; //Points to Vtbl field in CInterfaceStubVtbl.
  111. long RefCount;
  112. struct IUnknown * pvServerObject;
  113. const struct ICallFactoryVtbl * pCallFactoryVtbl;
  114. const IID * pAsyncIID;
  115. struct IPSFactoryBuffer * pPSFactory;
  116. const struct IReleaseMarshalBuffersVtbl * pRMBVtbl;
  117. } CStdStubBuffer;
  118. #endif
  119. // The plan to rewrite and colapse these structure does involve removing of the
  120. // pvServerObject field completely.
  121. // The channel would supply a pvServerObject pointer on the only call where
  122. // this is really needed, that is on the Invoke call.
  123. // In this model there would be no need whatsover for Connect and Disconnect operations
  124. // on the stub object, both sync stubs and async stub call objects.
  125. typedef struct tagCStdStubBuffer2
  126. {
  127. const void * lpForwardingVtbl;
  128. struct IRpcStubBuffer * pBaseStubBuffer;
  129. const struct IRpcStubBufferVtbl * lpVtbl; //Points to Vtbl field in CInterfaceStubVtbl.
  130. long RefCount;
  131. struct IUnknown * pvServerObject;
  132. const struct ICallFactoryVtbl * pCallFactoryVtbl;
  133. const IID * pAsyncIID;
  134. struct IPSFactoryBuffer * pPSFactory;
  135. const struct IReleaseMarshalBuffersVtbl * pRMBVtbl;
  136. } CStdStubBuffer2;
  137. typedef struct tagCStdAsyncStubBuffer
  138. {
  139. void * lpForwardingVtbl;
  140. struct IRpcStubBuffer * pBaseStubBuffer;
  141. const struct IRpcStubBufferVtbl * lpVtbl; //Points to Vtbl field in CInterfaceStubVtbl.
  142. long RefCount;
  143. struct IUnknown * pvServerObject;
  144. const struct ICallFactoryVtbl * pCallFactoryVtbl;
  145. const IID * pAsyncIID;
  146. struct IPSFactoryBuffer * pPSFactory;
  147. const struct IReleaseMarshalBuffersVtbl * pRMBVtbl;
  148. const struct ISynchronizeVtbl * pSynchronizeVtbl;
  149. NdrDcomAsyncCallState CallState;
  150. } CStdAsyncStubBuffer;
  151. HRESULT STDMETHODCALLTYPE
  152. CStdProxyBuffer_QueryInterface(IRpcProxyBuffer *pThis,REFIID riid, void **ppv);
  153. ULONG STDMETHODCALLTYPE
  154. CStdProxyBuffer_AddRef(IRpcProxyBuffer *pThis);
  155. HRESULT STDMETHODCALLTYPE
  156. CStdProxyBuffer_Connect(IRpcProxyBuffer *pThis, IRpcChannelBuffer *pChannel);
  157. void STDMETHODCALLTYPE
  158. CStdProxyBuffer_Disconnect(IRpcProxyBuffer *pThis);
  159. ULONG STDMETHODCALLTYPE
  160. CStdProxyBuffer2_Release(IRpcProxyBuffer *pThis);
  161. HRESULT STDMETHODCALLTYPE
  162. CStdProxyBuffer2_Connect(IRpcProxyBuffer *pThis, IRpcChannelBuffer *pChannel);
  163. void STDMETHODCALLTYPE
  164. CStdProxyBuffer2_Disconnect(IRpcProxyBuffer *pThis);
  165. HRESULT STDMETHODCALLTYPE
  166. CStdProxyBuffer_RMB_QueryInterface(IReleaseMarshalBuffers *pthis, REFIID riid, void **ppvObject);
  167. ULONG STDMETHODCALLTYPE
  168. CStdProxyBuffer_RMB_AddRef(IReleaseMarshalBuffers *pthis);
  169. ULONG STDMETHODCALLTYPE
  170. CStdProxyBuffer_RMB_Release(IReleaseMarshalBuffers *pthis);
  171. HRESULT STDMETHODCALLTYPE
  172. CStdProxyBuffer_RMB_ReleaseMarshalBuffer(IN IReleaseMarshalBuffers *This,RPCOLEMESSAGE * pMsg,DWORD dwFlags,IUnknown *pChnl);
  173. HRESULT STDMETHODCALLTYPE
  174. CStdAsyncProxyBuffer_RMB_ReleaseMarshalBuffer(IN IReleaseMarshalBuffers *This,RPCOLEMESSAGE * pMsg,DWORD dwFlags,IUnknown *pChnl);
  175. HRESULT STDMETHODCALLTYPE
  176. IUnknown_QueryInterface_Proxy(
  177. IN IUnknown * This,
  178. IN REFIID riid,
  179. OUT void ** ppv);
  180. ULONG STDMETHODCALLTYPE
  181. IUnknown_AddRef_Proxy(
  182. IN IUnknown *This);
  183. ULONG STDMETHODCALLTYPE
  184. IUnknown_Release_Proxy(
  185. IN IUnknown *This);
  186. HRESULT STDMETHODCALLTYPE
  187. Forwarding_QueryInterface(
  188. IN IUnknown * This,
  189. IN REFIID riid,
  190. OUT void ** ppv);
  191. ULONG STDMETHODCALLTYPE
  192. Forwarding_AddRef(
  193. IN IUnknown *This);
  194. ULONG STDMETHODCALLTYPE
  195. Forwarding_Release(
  196. IN IUnknown *This);
  197. void __RPC_STUB NdrStubForwardingFunction(
  198. IN IRpcStubBuffer * This,
  199. IN IRpcChannelBuffer * pChannel,
  200. IN PRPC_MESSAGE pmsg,
  201. OUT DWORD * pdwStubPhase);
  202. HRESULT STDMETHODCALLTYPE
  203. CStdStubBuffer_QueryInterface(IRpcStubBuffer *pthis, REFIID riid, void **ppvObject);
  204. ULONG STDMETHODCALLTYPE
  205. CStdStubBuffer_AddRef(IRpcStubBuffer *pthis);
  206. HRESULT STDMETHODCALLTYPE
  207. CStdStubBuffer_Connect(IRpcStubBuffer *pthis, IUnknown *pUnkServer);
  208. void STDMETHODCALLTYPE
  209. CStdStubBuffer_Disconnect(IRpcStubBuffer *pthis);
  210. HRESULT STDMETHODCALLTYPE
  211. CStdStubBuffer_Invoke(IRpcStubBuffer *pthis,RPCOLEMESSAGE *_prpcmsg,IRpcChannelBuffer *_pRpcChannelBuffer);
  212. IRpcStubBuffer * STDMETHODCALLTYPE
  213. CStdStubBuffer_IsIIDSupported(IRpcStubBuffer *pthis,REFIID riid);
  214. ULONG STDMETHODCALLTYPE
  215. CStdStubBuffer_CountRefs(IRpcStubBuffer *pthis);
  216. HRESULT STDMETHODCALLTYPE
  217. CStdStubBuffer_DebugServerQueryInterface(IRpcStubBuffer *pthis, void **ppv);
  218. void STDMETHODCALLTYPE
  219. CStdStubBuffer_DebugServerRelease(IRpcStubBuffer *pthis, void *pv);
  220. HRESULT STDMETHODCALLTYPE
  221. CStdStubBuffer2_Connect(IRpcStubBuffer *pthis, IUnknown *pUnkServer);
  222. void STDMETHODCALLTYPE
  223. CStdStubBuffer2_Disconnect(IRpcStubBuffer *pthis);
  224. ULONG STDMETHODCALLTYPE
  225. CStdStubBuffer2_CountRefs(IRpcStubBuffer *pthis);
  226. // Async
  227. extern const IRpcProxyBufferVtbl CStdAsyncProxyBufferVtbl;
  228. extern const IRpcProxyBufferVtbl CStdAsyncProxyBuffer2Vtbl;
  229. extern const IRpcStubBufferVtbl CStdAsyncStubBufferVtbl;
  230. extern const IRpcStubBufferVtbl CStdAsyncStubBuffer2Vtbl;
  231. extern const ISynchronizeVtbl CStdStubBuffer_ISynchronizeVtbl;
  232. extern const ISynchronizeVtbl CStdStubBuffer2_ISynchronizeVtbl;
  233. extern void * const ForwardingVtbl[];
  234. HRESULT STDMETHODCALLTYPE
  235. CStdProxyBuffer_CF_QueryInterface(ICallFactory *pthis, REFIID riid, void **ppvObject);
  236. ULONG STDMETHODCALLTYPE
  237. CStdProxyBuffer_CF_AddRef(ICallFactory *pthis);
  238. ULONG STDMETHODCALLTYPE
  239. CStdProxyBuffer_CF_Release(ICallFactory *pthis);
  240. HRESULT STDMETHODCALLTYPE
  241. CStdProxyBuffer_CF_CreateCall(ICallFactory *pthis, REFIID riid, IUnknown* punkOuter, REFIID riid2, IUnknown **ppvObject);
  242. HRESULT STDMETHODCALLTYPE
  243. CStdProxyBuffer2_CF_QueryInterface(ICallFactory *pthis, REFIID riid, void **ppvObject);
  244. ULONG STDMETHODCALLTYPE
  245. CStdProxyBuffer2_CF_AddRef(ICallFactory *pthis);
  246. ULONG STDMETHODCALLTYPE
  247. CStdProxyBuffer2_CF_Release(ICallFactory *pthis);
  248. HRESULT STDMETHODCALLTYPE
  249. CStdProxyBuffer2_CF_CreateCall(ICallFactory *pthis, REFIID riid, IUnknown* punkOuter, REFIID riid2, IUnknown **ppvObject);
  250. HRESULT STDMETHODCALLTYPE
  251. CStdStubBuffer_CF_QueryInterface(ICallFactory *pthis, REFIID riid, void **ppvObject);
  252. ULONG STDMETHODCALLTYPE
  253. CStdStubBuffer_CF_AddRef(ICallFactory *pthis);
  254. ULONG STDMETHODCALLTYPE
  255. CStdStubBuffer_CF_Release(ICallFactory *pthis);
  256. HRESULT STDMETHODCALLTYPE
  257. CStdStubBuffer_CF_CreateCall(ICallFactory *pthis, REFIID riid, IUnknown* punkOuter, REFIID riid2, IUnknown **ppvObject);
  258. HRESULT STDMETHODCALLTYPE
  259. CStdStubBuffer2_CF_QueryInterface(ICallFactory *pthis, REFIID riid, void **ppvObject);
  260. ULONG STDMETHODCALLTYPE
  261. CStdStubBuffer2_CF_AddRef(ICallFactory *pthis);
  262. ULONG STDMETHODCALLTYPE
  263. CStdStubBuffer2_CF_Release(ICallFactory *pthis);
  264. HRESULT STDMETHODCALLTYPE
  265. CStdStubBuffer2_CF_CreateCall(ICallFactory *pthis, REFIID riid, IUnknown* punkOuter, REFIID riid2, IUnknown **ppvObject);
  266. HRESULT STDMETHODCALLTYPE
  267. CStdStubBuffer_RMB_QueryInterface(IReleaseMarshalBuffers *pthis, REFIID riid, void **ppvObject);
  268. ULONG STDMETHODCALLTYPE
  269. CStdStubBuffer_RMB_AddRef(IReleaseMarshalBuffers *pthis);
  270. ULONG STDMETHODCALLTYPE
  271. CStdStubBuffer_RMB_Release(IReleaseMarshalBuffers *pthis);
  272. HRESULT STDMETHODCALLTYPE
  273. CStdStubBuffer_RMB_ReleaseMarshalBuffer(IN IReleaseMarshalBuffers *This,RPCOLEMESSAGE * pMsg,DWORD dwFlags,IUnknown *pChnl);
  274. HRESULT STDMETHODCALLTYPE
  275. CStdAsyncStubBuffer_RMB_QueryInterface(IReleaseMarshalBuffers *pthis, REFIID riid, void **ppvObject);
  276. ULONG STDMETHODCALLTYPE
  277. CStdAsyncStubBuffer_RMB_AddRef(IReleaseMarshalBuffers *pthis);
  278. ULONG STDMETHODCALLTYPE
  279. CStdAsyncStubBuffer_RMB_Release(IReleaseMarshalBuffers *pthis);
  280. HRESULT STDMETHODCALLTYPE
  281. CStdAsyncStubBuffer_RMB_ReleaseMarshalBuffer(IN IReleaseMarshalBuffers *This,RPCOLEMESSAGE * pMsg,DWORD dwFlags,IUnknown *pChnl);
  282. HRESULT STDMETHODCALLTYPE
  283. CStdAsyncProxyBuffer_QueryInterface(IRpcProxyBuffer *pthis, REFIID riid, void **ppvObject);
  284. ULONG STDMETHODCALLTYPE
  285. CStdAsyncProxyBuffer_Release(IRpcProxyBuffer *pthis);
  286. HRESULT STDMETHODCALLTYPE
  287. CStdAsyncProxyBuffer_Connect(IRpcProxyBuffer *pThis, IRpcChannelBuffer *pChannel);
  288. ULONG STDMETHODCALLTYPE
  289. CStdAsyncProxyBuffer2_Release(IRpcProxyBuffer *pThis);
  290. HRESULT STDMETHODCALLTYPE
  291. CStdAsyncProxyBuffer2_Connect(IRpcProxyBuffer *pThis, IRpcChannelBuffer *pChannel);
  292. HRESULT STDMETHODCALLTYPE
  293. CStdAsyncStubBuffer_QueryInterface(IRpcStubBuffer *pthis, REFIID riid, void **ppvObject);
  294. ULONG STDMETHODCALLTYPE
  295. CStdAsyncStubBuffer_AddRef(IRpcStubBuffer *pthis);
  296. ULONG STDMETHODCALLTYPE
  297. CStdAsyncStubBuffer_Release(IRpcStubBuffer *pthis);
  298. ULONG STDMETHODCALLTYPE
  299. CStdAsyncStubBuffer2_Release(IRpcStubBuffer *pthis);
  300. HRESULT STDMETHODCALLTYPE
  301. CStdAsyncStubBuffer_Connect(IRpcStubBuffer *pthis, IUnknown *pUnkServer);
  302. HRESULT STDMETHODCALLTYPE
  303. CStdAsyncStubBuffer2_Connect(IRpcStubBuffer *pthis, IUnknown *pUnkServer);
  304. void STDMETHODCALLTYPE
  305. CStdAsyncStubBuffer_Disconnect(IRpcStubBuffer *pthis );
  306. void STDMETHODCALLTYPE
  307. CStdAsyncStubBuffer2_Disconnect(IRpcStubBuffer *pthis );
  308. HRESULT STDMETHODCALLTYPE
  309. CStdAsyncStubBuffer_Invoke(IRpcStubBuffer *pthis,RPCOLEMESSAGE *_prpcmsg,IRpcChannelBuffer *_pRpcChannelBuffer);
  310. HRESULT STDMETHODCALLTYPE
  311. CStdAsyncStubBuffer_Synchronize_QueryInterface( ISynchronize *pthis, REFIID riid, void **ppvObject);
  312. ULONG STDMETHODCALLTYPE
  313. CStdAsyncStubBuffer_Synchronize_AddRef(ISynchronize *pthis);
  314. ULONG STDMETHODCALLTYPE
  315. CStdAsyncStubBuffer_Synchronize_Release(ISynchronize *pthis);
  316. HRESULT STDMETHODCALLTYPE
  317. CStdAsyncStubBuffer_Synchronize_Wait( ISynchronize *pthis, DWORD dwFlags, DWORD mili );
  318. HRESULT STDMETHODCALLTYPE
  319. CStdAsyncStubBuffer_Synchronize_Signal( ISynchronize *pthis );
  320. HRESULT STDMETHODCALLTYPE
  321. CStdAsyncStubBuffer_Synchronize_Reset( ISynchronize *pthis );
  322. HRESULT
  323. NdrpAsyncProxySignal(
  324. CStdAsyncProxyBuffer * pAsyncPB );
  325. HRESULT
  326. NdrpAsyncProxyMsgConstructor(
  327. CStdAsyncProxyBuffer * pAsyncPB );
  328. HRESULT
  329. NdrpAsyncProxyMsgDestructor(
  330. CStdAsyncProxyBuffer * pAsyncPB );
  331. HRESULT
  332. NdrpAsyncStubMsgConstructor(
  333. CStdAsyncStubBuffer * pAsyncSB );
  334. HRESULT
  335. NdrpAsyncStubMsgDestructor(
  336. CStdAsyncStubBuffer * pAsyncSB );
  337. HRESULT
  338. NdrLoadOleRoutines();
  339. typedef
  340. HRESULT (STDAPICALLTYPE RPC_GET_CLASS_OBJECT_ROUTINE)(
  341. REFCLSID rclsid,
  342. DWORD dwClsContext,
  343. void *pvReserved,
  344. REFIID riid,
  345. void **ppv);
  346. typedef
  347. HRESULT (STDAPICALLTYPE RPC_GET_MARSHAL_SIZE_MAX_ROUTINE)(
  348. ULONG * pulSize,
  349. REFIID riid,
  350. LPUNKNOWN pUnk,
  351. DWORD dwDestContext,
  352. LPVOID pvDestContext,
  353. DWORD mshlflags);
  354. typedef
  355. HRESULT (STDAPICALLTYPE RPC_MARSHAL_INTERFACE_ROUTINE)(
  356. LPSTREAM pStm,
  357. REFIID riid,
  358. LPUNKNOWN pUnk,
  359. DWORD dwDestContext,
  360. LPVOID pvDestContext,
  361. DWORD mshlflags);
  362. typedef
  363. HRESULT (STDAPICALLTYPE RPC_UNMARSHAL_INTERFACE_ROUTINE)(
  364. LPSTREAM pStm,
  365. REFIID riid,
  366. LPVOID FAR* ppv);
  367. typedef
  368. HRESULT (STDAPICALLTYPE RPC_STRING_FROM_IID)(
  369. REFIID rclsid,
  370. LPOLESTR FAR* lplpsz);
  371. typedef
  372. HRESULT (STDAPICALLTYPE RPC_GET_PS_CLSID)(
  373. REFIID iid,
  374. LPCLSID lpclsid);
  375. typedef
  376. HRESULT (STDAPICALLTYPE RPC_CO_CREATE_INSTANCE)(
  377. REFCLSID rclsid,
  378. LPUNKNOWN pUnkOuter,
  379. DWORD dwClsContext,
  380. REFIID riid,
  381. LPVOID * ppv);
  382. typedef
  383. HRESULT (STDAPICALLTYPE RPC_CO_RELEASEMARSHALDATA)(
  384. IStream * pStm);
  385. typedef
  386. HRESULT (STDAPICALLTYPE RPC_DCOMCHANNELSETHRESULT)(
  387. PRPC_MESSAGE pmsg,
  388. ULONG * ulReserved,
  389. HRESULT appsHR );
  390. extern RPC_GET_CLASS_OBJECT_ROUTINE * pfnCoGetClassObject;
  391. extern RPC_GET_MARSHAL_SIZE_MAX_ROUTINE * pfnCoGetMarshalSizeMax;
  392. extern RPC_MARSHAL_INTERFACE_ROUTINE * pfnCoMarshalInterface;
  393. extern RPC_UNMARSHAL_INTERFACE_ROUTINE * pfnCoUnmarshalInterface;
  394. extern RPC_STRING_FROM_IID * pfnStringFromIID;
  395. extern RPC_GET_PS_CLSID * pfnCoGetPSClsid;
  396. extern RPC_CO_CREATE_INSTANCE * pfnCoCreateInstance;
  397. extern RPC_CO_RELEASEMARSHALDATA * pfnCoReleaseMarshalData;
  398. extern RPC_CLIENT_ALLOC * pfnCoTaskMemAlloc;
  399. extern RPC_CLIENT_FREE * pfnCoTaskMemFree;
  400. extern RPC_DCOMCHANNELSETHRESULT * pfnDcomChannelSetHResult;
  401. HRESULT (STDAPICALLTYPE NdrStringFromIID)(
  402. REFIID rclsid,
  403. char * lplpsz);
  404. //------------------------------------------------------------------------
  405. // New async support
  406. // -----------------------------------------------------------------------
  407. void
  408. NdrpAsyncProxyMgrConstructor(
  409. CStdAsyncProxyBuffer * pAsyncPB );
  410. void
  411. NdrpAsyncStubMgrConstructor(
  412. CStdAsyncStubBuffer * pAsyncSB );
  413. HRESULT
  414. NdrpAsyncStubSignal(
  415. CStdAsyncStubBuffer * pAsyncSB );
  416. const IID * RPC_ENTRY
  417. NdrGetProxyIID(
  418. IN const void *pThis);
  419. HRESULT NdrpClientReleaseMarshalBuffer(
  420. IReleaseMarshalBuffers * pRMB,
  421. RPC_MESSAGE *pRpcMsg,
  422. DWORD dwIOFlags,
  423. BOOLEAN fAsync);
  424. HRESULT NdrpServerReleaseMarshalBuffer(
  425. IReleaseMarshalBuffers *pRMB,
  426. RPC_MESSAGE *pRpcMsg,
  427. DWORD dwIOFlags,
  428. BOOLEAN fAsync);
  429. HRESULT Ndr64pReleaseMarshalBuffer(
  430. PRPC_MESSAGE pRpcMsg,
  431. PMIDL_SYNTAX_INFO pSyntaxInfo,
  432. unsigned long ProcNum,
  433. PMIDL_STUB_DESC pStubDesc,
  434. DWORD dwIOFlags,
  435. BOOLEAN IsClient );
  436. HRESULT
  437. NdrpInitializeMutex( I_RPC_MUTEX * pMutex );
  438. EXTERN_C const IID IID_IPrivStubBuffer;
  439. //--------------------
  440. // HookOle Interface
  441. //--------------------
  442. EXTERN_C extern const IID IID_IPSFactoryHook;
  443. #if defined(__cplusplus) && !defined(CINTERFACE)
  444. interface IPSFactoryHook : public IPSFactoryBuffer
  445. {
  446. public:
  447. STDMETHOD (HkGetProxyFileInfo)
  448. (
  449. REFIID riid,
  450. PINT pOffset,
  451. PVOID *ppProxyFileInfo
  452. )=0;
  453. };
  454. typedef IPSFactoryHook *PI_PSFACTORYHOOK;
  455. #else /* C Style Interface */
  456. typedef struct IPSFactoryHookVtbl
  457. {
  458. BEGIN_INTERFACE
  459. HRESULT ( __stdcall *QueryInterface )(
  460. IPSFactoryBuffer * This,
  461. /* [in] */ REFIID riid,
  462. /* [out] */ void ** ppvObject);
  463. ULONG ( __stdcall *AddRef )(
  464. IPSFactoryBuffer * This);
  465. ULONG ( __stdcall *Release )(
  466. IPSFactoryBuffer * This);
  467. HRESULT ( __stdcall *CreateProxy )(
  468. IPSFactoryBuffer * This,
  469. /* [in] */ IUnknown * pUnkOuter,
  470. /* [in] */ REFIID riid,
  471. /* [out] */ IRpcProxyBuffer ** ppProxy,
  472. /* [out] */ void ** ppv);
  473. HRESULT ( __stdcall *CreateStub )(
  474. IPSFactoryBuffer * This,
  475. /* [in] */ REFIID riid,
  476. /* [unique][in] */ IUnknown * pUnkServer,
  477. /* [out] */ IRpcStubBuffer ** ppStub);
  478. HRESULT ( __stdcall *HkGetProxyFileInfo )(
  479. IPSFactoryBuffer * This,
  480. /* [in] */ REFIID riid,
  481. /* [out]*/ PINT pOffset,
  482. /* [out]*/ PVOID * ppProxyFileInfo);
  483. END_INTERFACE
  484. } IPSFactoryHookVtbl;
  485. interface IPSFactoryHook
  486. {
  487. CONST_VTBL struct IPSFactoryHookVtbl *lpVtbl;
  488. };
  489. typedef interface IPSFactoryHook *PI_PSFACTORYHOOK;
  490. #ifdef COBJMACROS
  491. #define IPSFactoryHook_QueryInterface(This,riid,ppvObject) \
  492. (This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
  493. #define IPSFactoryHook_AddRef(This) \
  494. (This)->lpVtbl -> AddRef(This)
  495. #define IPSFactoryHook_Release(This) \
  496. (This)->lpVtbl -> Release(This)
  497. #define IPSFactoryHook_CreateProxy(This,pUnkOuter,riid,ppProxy,ppv) \
  498. (This)->lpVtbl -> CreateProxy(This,pUnkOuter,riid,ppProxy,ppv)
  499. #define IPSFactoryHook_CreateStub(This,riid,pUnkServer,ppStub) \
  500. (This)->lpVtbl -> CreateStub(This,riid,pUnkServer,ppStub)
  501. #define IPSFactoryHook_HkGetProxyFileInfo(This,riid,pOffset,ppProxyFileInfo) \
  502. (This)->lpVtbl -> HkGetProxyFileInfo(This,riid,pOffset,ppProxyFileInfo)
  503. #endif /* COBJMACROS */
  504. #endif /* C style interface */
  505. //-------------------------
  506. // End - HookOle Interface
  507. //-------------------------
  508. #ifdef __cplusplus
  509. }
  510. #endif
  511. #endif /* _NDROLE_ */