19#ifndef __RPCPROXY_H_VERSION__
21#define __RPCPROXY_H_VERSION__ ( 399 )
24#ifndef __WINE_RPCPROXY_H
25#define __WINE_RPCPROXY_H
65#ifdef USE_STUBLESS_PROXY
66 const void *pStublessProxyInfo;
71#define CINTERFACE_PROXY_VTABLE(n) \
74 CInterfaceProxyHeader header; \
126#define STUB_FORWARDING_FUNCTION NdrStubForwardingFunction
131#define CStdStubBuffer_DELEGATING_METHODS 0, 0, CStdStubBuffer2_Release, 0, 0, 0, 0, 0, 0, 0
157#define CStdStubBuffer_METHODS \
158 CStdStubBuffer_QueryInterface, \
159 CStdStubBuffer_AddRef, \
160 CStdStubBuffer_Release, \
161 CStdStubBuffer_Connect, \
162 CStdStubBuffer_Disconnect, \
163 CStdStubBuffer_Invoke, \
164 CStdStubBuffer_IsIIDSupported, \
165 CStdStubBuffer_CountRefs, \
166 CStdStubBuffer_DebugServerQueryInterface, \
167 CStdStubBuffer_DebugServerRelease
187 ULONG RequestedBufferSize );
209#define CSTDSTUBBUFFERRELEASE(pFactory) \
210ULONG WINAPI CStdStubBuffer_Release(IRpcStubBuffer *This) \
211 { return NdrCStdStubBuffer_Release(This, (IPSFactoryBuffer *)pFactory); }
213#ifdef PROXY_DELEGATION
214#define CSTDSTUBBUFFER2RELEASE(pFactory) \
215ULONG WINAPI CStdStubBuffer2_Release(IRpcStubBuffer *This) \
216 { return NdrCStdStubBuffer2_Release(This, (IPSFactoryBuffer *)pFactory); }
218#define CSTDSTUBBUFFER2RELEASE(pFactory)
221#define IID_GENERIC_CHECK_IID(name,pIID,index) memcmp(pIID, name##_ProxyVtblList[index]->header.piid, sizeof(IID))
229#define IID_BS_LOOKUP_SETUP \
231#define IID_BS_LOOKUP_INITIAL_TEST(name, sz, split)
232#define IID_BS_LOOKUP_NEXT_TEST(name, split)
233#define IID_BS_LOOKUP_RETURN_RESULT(name, sz, index) \
234 for (c=0; c<sz; c++) if (!name##_CHECK_IID(c)) { (index)=c; return 1; } \
238#define EXTERN_PROXY_FILE(proxy) \
239 EXTERN_C const ProxyFileInfo proxy##_ProxyFileInfo DECLSPEC_HIDDEN;
241#define PROXYFILE_LIST_START \
242 const ProxyFileInfo * aProxyFileList[] DECLSPEC_HIDDEN = \
245#define REFERENCE_PROXY_FILE(proxy) \
246 & proxy##_ProxyFileInfo
248#define PROXYFILE_LIST_END \
257# define CLSID_PSFACTORYBUFFER extern CLSID PROXY_CLSID DECLSPEC_HIDDEN;
259# ifdef PROXY_CLSID_IS
260# define CLSID_PSFACTORYBUFFER const CLSID CLSID_PSFactoryBuffer DECLSPEC_HIDDEN; \
261 const CLSID CLSID_PSFactoryBuffer = PROXY_CLSID_IS;
262# define PROXY_CLSID CLSID_PSFactoryBuffer
264# define CLSID_PSFACTORYBUFFER
269# define GET_DLL_CLSID (aProxyFileList[0]->pStubVtblList[0] ? \
270 aProxyFileList[0]->pStubVtblList[0]->header.piid : NULL)
272# define GET_DLL_CLSID &PROXY_CLSID
276# define __rpc_macro_expand2(a, b) a##b
277# define __rpc_macro_expand(a, b) __rpc_macro_expand2(a, b)
278# define DLLREGISTERSERVER_ENTRY __rpc_macro_expand(ENTRY_PREFIX, DllRegisterServer)
279# define DLLUNREGISTERSERVER_ENTRY __rpc_macro_expand(ENTRY_PREFIX, DllUnregisterServer)
280# define DLLMAIN_ENTRY __rpc_macro_expand(ENTRY_PREFIX, DllMain)
281# define DLLGETCLASSOBJECT_ENTRY __rpc_macro_expand(ENTRY_PREFIX, DllGetClassObject)
282# define DLLCANUNLOADNOW_ENTRY __rpc_macro_expand(ENTRY_PREFIX, DllCanUnloadNow)
284# define DLLREGISTERSERVER_ENTRY DllRegisterServer
285# define DLLUNREGISTERSERVER_ENTRY DllUnregisterServer
286# define DLLMAIN_ENTRY DllMain
287# define DLLGETCLASSOBJECT_ENTRY DllGetClassObject
288# define DLLCANUNLOADNOW_ENTRY DllCanUnloadNow
291#ifdef WINE_REGISTER_DLL
292# define WINE_DO_REGISTER_DLL(pfl, clsid) return __wine_register_resources( hProxyDll )
293# define WINE_DO_UNREGISTER_DLL(pfl, clsid) return __wine_unregister_resources( hProxyDll )
295# define WINE_DO_REGISTER_DLL(pfl, clsid) return NdrDllRegisterProxy( hProxyDll, (pfl), (clsid) )
296# define WINE_DO_UNREGISTER_DLL(pfl, clsid) return NdrDllUnregisterProxy( hProxyDll, (pfl), (clsid) )
300#define DLLDATA_GETPROXYDLLINFO(pfl, rclsid) \
301 void RPC_ENTRY GetProxyDllInfo(const ProxyFileInfo ***ppProxyFileInfo, \
302 const CLSID **ppClsid) DECLSPEC_HIDDEN; \
303 void RPC_ENTRY GetProxyDllInfo(const ProxyFileInfo ***ppProxyFileInfo, \
304 const CLSID **ppClsid) \
306 *ppProxyFileInfo = (pfl); \
307 *ppClsid = (rclsid); \
310#define DLLGETCLASSOBJECTROUTINE(pfl, factory_clsid, factory) \
311 HRESULT WINAPI DLLGETCLASSOBJECT_ENTRY(REFCLSID rclsid, REFIID riid, void **ppv) DECLSPEC_HIDDEN; \
312 HRESULT WINAPI DLLGETCLASSOBJECT_ENTRY(REFCLSID rclsid, REFIID riid, \
315 return NdrDllGetClassObject(rclsid, riid, ppv, (pfl), \
316 (factory_clsid), factory); \
319#define DLLCANUNLOADNOW(factory) \
320 HRESULT WINAPI DLLCANUNLOADNOW_ENTRY(void) DECLSPEC_HIDDEN; \
321 HRESULT WINAPI DLLCANUNLOADNOW_ENTRY(void) \
323 return NdrDllCanUnloadNow((factory)); \
326#define REGISTER_PROXY_DLL_ROUTINES(pfl, factory_clsid) \
327 HINSTANCE hProxyDll DECLSPEC_HIDDEN = NULL; \
329 BOOL WINAPI DLLMAIN_ENTRY(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) DECLSPEC_HIDDEN; \
330 BOOL WINAPI DLLMAIN_ENTRY(HINSTANCE hinstDLL, DWORD fdwReason, \
331 LPVOID lpvReserved) \
333 if (fdwReason == DLL_PROCESS_ATTACH) \
335 DisableThreadLibraryCalls(hinstDLL); \
336 hProxyDll = hinstDLL; \
341 HRESULT WINAPI DLLREGISTERSERVER_ENTRY(void) DECLSPEC_HIDDEN; \
342 HRESULT WINAPI DLLREGISTERSERVER_ENTRY(void) \
344 WINE_DO_REGISTER_DLL( (pfl), (factory_clsid) ); \
347 HRESULT WINAPI DLLUNREGISTERSERVER_ENTRY(void) DECLSPEC_HIDDEN; \
348 HRESULT WINAPI DLLUNREGISTERSERVER_ENTRY(void) \
350 WINE_DO_UNREGISTER_DLL( (pfl), (factory_clsid) ); \
353#if defined(REGISTER_PROXY_DLL) || defined(WINE_REGISTER_DLL)
354# define DLLREGISTRY_ROUTINES(pfl, factory_clsid) \
355 REGISTER_PROXY_DLL_ROUTINES(pfl, factory_clsid)
357# define DLLREGISTRY_ROUTINES(pfl, factory_clsid)
360#define DLLDATA_ROUTINES(pfl, factory_clsid) \
361 CLSID_PSFACTORYBUFFER \
362 CStdPSFactoryBuffer DECLSPEC_HIDDEN gPFactory = { NULL, 0, NULL, 0 }; \
363 DLLDATA_GETPROXYDLLINFO(pfl, factory_clsid) \
364 DLLGETCLASSOBJECTROUTINE(pfl, factory_clsid, &gPFactory) \
365 DLLCANUNLOADNOW(&gPFactory) \
366 CSTDSTUBBUFFERRELEASE(&gPFactory) \
367 CSTDSTUBBUFFER2RELEASE(&gPFactory) \
368 DLLREGISTRY_ROUTINES(pfl, factory_clsid)
#define STDMETHODCALLTYPE
_Out_ PULONG _Out_ PULONG pIndex
HRESULT WINAPI CreateStubFromTypeInfo(ITypeInfo *typeinfo, REFIID iid, IUnknown *server, IRpcStubBuffer **stub_buffer)
HRESULT WINAPI CreateProxyFromTypeInfo(ITypeInfo *typeinfo, IUnknown *outer, REFIID iid, IRpcProxyBuffer **proxy_buffer, void **out)
interface IRpcStubBuffer * LPRPCSTUBBUFFER
interface IRpcProxyBuffer * LPRPCPROXYBUFFER
void __RPC_STUB NdrStubForwardingFunction(IRpcStubBuffer *This, IRpcChannelBuffer *pChannel, PRPC_MESSAGE pMsg, DWORD *pdwStubPhase)
struct tagCInterfaceProxyVtbl CInterfaceProxyVtbl
ULONG STDMETHODCALLTYPE CStdStubBuffer2_Release(IRpcStubBuffer *This) DECLSPEC_HIDDEN
RPCRTAPI void RPC_ENTRY NdrStubInitializePartial(PRPC_MESSAGE pRpcMsg, PMIDL_STUB_MESSAGE pStubMsg, PMIDL_STUB_DESC pStubDescriptor, IRpcChannelBuffer *pRpcChannelBuffer, ULONG RequestedBufferSize)
void WINAPI CStdStubBuffer_DebugServerRelease(IRpcStubBuffer *This, void *pv)
IIDLookupRtn * PIIDLookup
int __stdcall IIDLookupRtn(const IID *pIID, int *pIndex)
struct tagCInterfaceStubVtbl CInterfaceStubVtbl
ULONG WINAPI CStdStubBuffer_Release(IRpcStubBuffer *This) DECLSPEC_HIDDEN
ULONG WINAPI CStdStubBuffer_AddRef(IRpcStubBuffer *This)
RPCRTAPI HRESULT RPC_ENTRY NdrDllGetClassObject(REFCLSID rclsid, REFIID riid, void **ppv, const ProxyFileInfo **pProxyFileList, const CLSID *pclsid, CStdPSFactoryBuffer *pPSFactoryBuffer)
HRESULT WINAPI CStdStubBuffer_DebugServerQueryInterface(IRpcStubBuffer *This, void **ppv)
ULONG STDMETHODCALLTYPE NdrCStdStubBuffer2_Release(IRpcStubBuffer *This, IPSFactoryBuffer *pPSF)
struct tagCInterfaceStubHeader CInterfaceStubHeader
void(__RPC_STUB * PRPC_STUB_FUNCTION)(IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *pdwStubPhase)
HRESULT WINAPI CStdStubBuffer_Invoke(IRpcStubBuffer *This, RPCOLEMESSAGE *pRpcMsg, IRpcChannelBuffer *pRpcChannelBuffer)
HRESULT WINAPI CStdStubBuffer_QueryInterface(IRpcStubBuffer *This, REFIID riid, void **ppvObject)
RPCRTAPI void RPC_ENTRY NdrStubInitialize(PRPC_MESSAGE pRpcMsg, PMIDL_STUB_MESSAGE pStubMsg, PMIDL_STUB_DESC pStubDescriptor, IRpcChannelBuffer *pRpcChannelBuffer)
ProxyFileInfo ExtendedProxyFileInfo
RPCRTAPI void RPC_ENTRY NdrProxyFreeBuffer(void *This, PMIDL_STUB_MESSAGE pStubMsg)
const char * PCInterfaceName
RPCRTAPI HRESULT RPC_ENTRY NdrStubErrorHandler(DWORD dwExceptionCode)
struct tagCStdStubBuffer CStdStubBuffer
RPCRTAPI void RPC_ENTRY NdrProxySendReceive(void *This, PMIDL_STUB_MESSAGE pStubMsg)
HRESULT __wine_unregister_resources(HMODULE module) DECLSPEC_HIDDEN
RPCRTAPI HRESULT RPC_ENTRY NdrDllRegisterProxy(HMODULE hDll, const ProxyFileInfo **pProxyFileList, const CLSID *pclsid)
RPCRTAPI HRESULT RPC_ENTRY NdrDllUnregisterProxy(HMODULE hDll, const ProxyFileInfo **pProxyFileList, const CLSID *pclsid)
RPCRTAPI void RPC_ENTRY NdrProxyGetBuffer(void *This, PMIDL_STUB_MESSAGE pStubMsg)
RPCRTAPI void RPC_ENTRY NdrStubGetBuffer(IRpcStubBuffer *This, IRpcChannelBuffer *pRpcChannelBuffer, PMIDL_STUB_MESSAGE pStubMsg)
RPCRTAPI HRESULT RPC_ENTRY NdrDllCanUnloadNow(CStdPSFactoryBuffer *pPSFactoryBuffer)
ULONG WINAPI CStdStubBuffer_CountRefs(IRpcStubBuffer *This)
struct tagCInterfaceProxyVtbl * PCInterfaceProxyVtblList
struct tagCInterfaceProxyHeader CInterfaceProxyHeader
void WINAPI CStdStubBuffer_Disconnect(IRpcStubBuffer *This)
RPCRTAPI void RPC_ENTRY NdrProxyInitialize(void *This, PRPC_MESSAGE pRpcMsg, PMIDL_STUB_MESSAGE pStubMsg, PMIDL_STUB_DESC pStubDescriptor, unsigned int ProcNum)
struct tagProxyFileInfo ProxyFileInfo
struct tagCInterfaceStubVtbl * PCInterfaceStubVtblList
HRESULT __wine_register_resources(HMODULE module) DECLSPEC_HIDDEN
RPCRTAPI HRESULT RPC_ENTRY NdrProxyErrorHandler(DWORD dwExceptionCode)
HRESULT WINAPI CStdStubBuffer_Connect(IRpcStubBuffer *This, IUnknown *pUnkServer)
IRpcStubBuffer *WINAPI CStdStubBuffer_IsIIDSupported(IRpcStubBuffer *This, REFIID riid)
ULONG WINAPI NdrCStdStubBuffer_Release(IRpcStubBuffer *This, IPSFactoryBuffer *pPSF)
struct tagCStdPSFactoryBuffer CStdPSFactoryBuffer
CInterfaceProxyHeader header
CInterfaceStubHeader header
const ProxyFileInfo ** pProxyFileList
const IPSFactoryBufferVtbl * lpVtbl
const struct ICallFactoryVtbl * pCallFactoryVtbl
struct IUnknown * pvServerObject
const IRpcStubBufferVtbl * lpVtbl
struct IPSFactoryBuffer * pPSFactory
unsigned short TableVersion
const IID ** pDelegatedIIDs
const PCInterfaceStubVtblList * pStubVtblList
const IID ** pAsyncIIDLookup
const PIIDLookup pIIDLookupRtn
const PCInterfaceProxyVtblList * pProxyVtblList
const PCInterfaceName * pNamesArray
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject