Get rid of the ICOM_MSVTABLE_COMPAT support, g++ no longer requires
[wine/multimedia.git] / include / rpcproxy.h
blob223ab5036b69cb11f07325066e9f18a620bcf465
1 /*
2 * Copyright (C) 2001 Ove Kaaven
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef __RPCPROXY_H_VERSION__
20 /* FIXME: Find an appropriate version number. I guess something is better than nothing */
21 #define __RPCPROXY_H_VERSION__ ( 399 )
22 #endif
24 #ifndef __WINE_RPCPROXY_H
25 #define __WINE_RPCPROXY_H
27 #include <basetsd.h>
28 #include <guiddef.h>
29 #include <rpc.h>
30 #include <rpcndr.h>
32 typedef struct tagCInterfaceStubVtbl *PCInterfaceStubVtblList;
33 typedef struct tagCInterfaceProxyVtbl *PCInterfaceProxyVtblList;
34 typedef const char *PCInterfaceName;
35 typedef int __stdcall IIDLookupRtn( const IID *pIID, int *pIndex );
36 typedef IIDLookupRtn *PIIDLookup;
38 typedef struct tagProxyFileInfo
40 const PCInterfaceProxyVtblList *pProxyVtblList;
41 const PCInterfaceStubVtblList *pStubVtblList;
42 const PCInterfaceName *pNamesArray;
43 const IID **pDelegatedIIDs;
44 const PIIDLookup pIIDLookupRtn;
45 unsigned short TableSize;
46 unsigned short TableVersion;
47 const IID **pAsyncIIDLookup;
48 LONG_PTR Filler2;
49 LONG_PTR Filler3;
50 LONG_PTR Filler4;
51 } ProxyFileInfo;
53 typedef ProxyFileInfo ExtendedProxyFileInfo;
55 typedef struct tagCInterfaceProxyHeader
57 #ifdef USE_STUBLESS_PROXY
58 const void *pStublessProxyInfo;
59 #endif
60 const IID *piid;
61 } CInterfaceProxyHeader;
63 #define CINTERFACE_PROXY_VTABLE(n) \
64 struct \
65 { \
66 CInterfaceProxyHeader header; \
67 void *Vtbl[n]; \
70 typedef struct tagCInterfaceProxyVtbl
72 CInterfaceProxyHeader header;
73 #if defined(__GNUC__)
74 void *Vtbl[0];
75 #else
76 void *Vtbl[1];
77 #endif
78 } CInterfaceProxyVtbl;
80 typedef void (__RPC_STUB *PRPC_STUB_FUNCTION)(
81 IRpcStubBuffer *This,
82 IRpcChannelBuffer *_pRpcChannelBuffer,
83 PRPC_MESSAGE _pRpcMessage,
84 DWORD *pdwStubPhase);
86 typedef struct tagCInterfaceStubHeader
88 const IID *piid;
89 const MIDL_SERVER_INFO *pServerInfo;
90 unsigned long DispatchTableCount;
91 const PRPC_STUB_FUNCTION *pDispatchTable;
92 } CInterfaceStubHeader;
94 typedef struct tagCInterfaceStubVtbl
96 CInterfaceStubHeader header;
97 IRpcStubBufferVtbl Vtbl;
98 } CInterfaceStubVtbl;
100 typedef struct tagCStdStubBuffer
102 const IRpcStubBufferVtbl *lpVtbl;
103 long RefCount;
104 struct IUnknown *pvServerObject;
105 const struct ICallFactoryVtbl *pCallFactoryVtbl;
106 const IID *pAsyncIID;
107 struct IPSFactoryBuffer *pPSFactory;
108 } CStdStubBuffer;
110 typedef struct tagCStdPSFactoryBuffer
112 const IPSFactoryBufferVtbl *lpVtbl;
113 long RefCount;
114 const ProxyFileInfo **pProxyFileList;
115 long Filler1;
116 } CStdPSFactoryBuffer;
118 HRESULT WINAPI
119 CStdStubBuffer_QueryInterface( IRpcStubBuffer *This, REFIID riid, void **ppvObject );
120 ULONG WINAPI
121 CStdStubBuffer_AddRef( IRpcStubBuffer *This );
122 ULONG WINAPI
123 CStdStubBuffer_Release( IRpcStubBuffer *This );
124 ULONG WINAPI
125 NdrCStdStubBuffer_Release( IRpcStubBuffer *This, IPSFactoryBuffer *pPSF );
126 HRESULT WINAPI
127 CStdStubBuffer_Connect( IRpcStubBuffer *This, IUnknown *pUnkServer );
128 void WINAPI
129 CStdStubBuffer_Disconnect( IRpcStubBuffer *This );
130 HRESULT WINAPI
131 CStdStubBuffer_Invoke( IRpcStubBuffer *This, RPCOLEMESSAGE *pRpcMsg, IRpcChannelBuffer *pRpcChannelBuffer );
132 IRpcStubBuffer * WINAPI
133 CStdStubBuffer_IsIIDSupported( IRpcStubBuffer *This, REFIID riid );
134 ULONG WINAPI
135 CStdStubBuffer_CountRefs( IRpcStubBuffer *This );
136 HRESULT WINAPI
137 CStdStubBuffer_DebugServerQueryInterface( IRpcStubBuffer *This, void **ppv );
138 void WINAPI
139 CStdStubBuffer_DebugServerRelease( IRpcStubBuffer *This, void *pv );
141 #define CStdStubBuffer_METHODS \
142 CStdStubBuffer_QueryInterface, \
143 CStdStubBuffer_AddRef, \
144 CStdStubBuffer_Release, \
145 CStdStubBuffer_Connect, \
146 CStdStubBuffer_Disconnect, \
147 CStdStubBuffer_Invoke, \
148 CStdStubBuffer_IsIIDSupported, \
149 CStdStubBuffer_CountRefs, \
150 CStdStubBuffer_DebugServerQueryInterface, \
151 CStdStubBuffer_DebugServerRelease
153 RPCRTAPI void RPC_ENTRY
154 NdrProxyInitialize( void *This, PRPC_MESSAGE pRpcMsg, PMIDL_STUB_MESSAGE pStubMsg,
155 PMIDL_STUB_DESC pStubDescriptor, unsigned int ProcNum );
156 RPCRTAPI void RPC_ENTRY
157 NdrProxyGetBuffer( void *This, PMIDL_STUB_MESSAGE pStubMsg );
158 RPCRTAPI void RPC_ENTRY
159 NdrProxySendReceive( void *This, PMIDL_STUB_MESSAGE pStubMsg );
160 RPCRTAPI void RPC_ENTRY
161 NdrProxyFreeBuffer( void *This, PMIDL_STUB_MESSAGE pStubMsg );
162 RPCRTAPI HRESULT RPC_ENTRY
163 NdrProxyErrorHandler( DWORD dwExceptionCode );
165 RPCRTAPI void RPC_ENTRY
166 NdrStubInitialize( PRPC_MESSAGE pRpcMsg, PMIDL_STUB_MESSAGE pStubMsg,
167 PMIDL_STUB_DESC pStubDescriptor, IRpcChannelBuffer *pRpcChannelBuffer );
168 RPCRTAPI void RPC_ENTRY
169 NdrStubInitializePartial( PRPC_MESSAGE pRpcMsg, PMIDL_STUB_MESSAGE pStubMsg,
170 PMIDL_STUB_DESC pStubDescriptor, IRpcChannelBuffer *pRpcChannelBuffer,
171 unsigned long RequestedBufferSize );
172 void __RPC_STUB NdrStubForwardingFunction( IRpcStubBuffer *This, IRpcChannelBuffer *pChannel,
173 PRPC_MESSAGE pMsg, DWORD *pdwStubPhase );
174 RPCRTAPI void RPC_ENTRY
175 NdrStubGetBuffer( IRpcStubBuffer *This, IRpcChannelBuffer *pRpcChannelBuffer, PMIDL_STUB_MESSAGE pStubMsg );
176 RPCRTAPI HRESULT RPC_ENTRY
177 NdrStubErrorHandler( DWORD dwExceptionCode );
179 RPCRTAPI HRESULT RPC_ENTRY
180 NdrDllGetClassObject( REFCLSID rclsid, REFIID riid, void **ppv, const ProxyFileInfo **pProxyFileList,
181 const CLSID *pclsid, CStdPSFactoryBuffer *pPSFactoryBuffer );
182 RPCRTAPI HRESULT RPC_ENTRY
183 NdrDllCanUnloadNow( CStdPSFactoryBuffer *pPSFactoryBuffer );
185 RPCRTAPI HRESULT RPC_ENTRY
186 NdrDllRegisterProxy( HMODULE hDll, const ProxyFileInfo **pProxyFileList, const CLSID *pclsid );
187 RPCRTAPI HRESULT RPC_ENTRY
188 NdrDllUnregisterProxy( HMODULE hDll, const ProxyFileInfo **pProxyFileList, const CLSID *pclsid );
190 #define CSTDSTUBBUFFERRELEASE(pFactory) \
191 ULONG WINAPI CStdStubBuffer_Release(IRpcStubBuffer *This) \
192 { return NdrCStdStubBuffer_Release(This, (IPSFactoryBuffer *)pFactory); }
194 #define IID_GENERIC_CHECK_IID(name,pIID,index) memcmp(pIID, name##_ProxyVtblList[index]->header.piid, sizeof(IID))
197 * In these macros, BS stands for Binary Search. MIDL uses these to
198 * "unroll" a binary search into the module's IID_Lookup function.
199 * However, I haven't bothered to reimplement that stuff yet;
200 * I've just implemented a linear search for now.
202 #define IID_BS_LOOKUP_SETUP \
203 int c;
204 #define IID_BS_LOOKUP_INITIAL_TEST(name, sz, split)
205 #define IID_BS_LOOKUP_NEXT_TEST(name, split)
206 #define IID_BS_LOOKUP_RETURN_RESULT(name, sz, index) \
207 for (c=0; c<sz; c++) if (!name##_CHECK_IID(c)) { (index)=c; return 1; } \
208 return 0;
210 #if 0
212 /* see http://msdn.microsoft.com/library/en-us/dnmsj99/html/com0199.asp?frame=true */
214 RPCRTAPI HRESULT RPC_ENTRY
215 CreateProxyFromTypeInfo( LPTYPEINFO pTypeInfo, LPUNKNOWN pUnkOuter, REFIID riid,
216 LPRPCPROXYBUFFER *ppProxy, LPVOID *ppv );
217 RPCRTAPI HRESULT RPC_ENTRY
218 CreateStubFromTypeInfo( LPTYPEINFO pTypeInfo, REFIID riid, LPUNKNOWN pUnkServer,
219 LPRPCSTUBBUFFER *ppStub );
221 #endif
223 #endif /*__WINE_RPCDCE_H */