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 )
24 #ifndef __WINE_RPCPROXY_H
25 #define __WINE_RPCPROXY_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
;
53 typedef ProxyFileInfo ExtendedProxyFileInfo
;
55 typedef struct tagCInterfaceProxyHeader
57 #ifdef USE_STUBLESS_PROXY
58 const void *pStublessProxyInfo
;
61 } CInterfaceProxyHeader
;
63 #define CINTERFACE_PROXY_VTABLE(n) \
66 CInterfaceProxyHeader header; \
70 typedef struct tagCInterfaceProxyVtbl
72 CInterfaceProxyHeader header
;
78 } CInterfaceProxyVtbl
;
80 typedef void (__RPC_STUB
*PRPC_STUB_FUNCTION
)(
82 IRpcChannelBuffer
*_pRpcChannelBuffer
,
83 PRPC_MESSAGE _pRpcMessage
,
86 typedef struct tagCInterfaceStubHeader
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 ICOM_VTABLE(IRpcStubBuffer
) Vtbl
;
100 typedef struct tagCStdStubBuffer
102 const ICOM_VTABLE(IRpcStubBuffer
) *lpVtbl
;
104 struct IUnknown
*pvServerObject
;
105 const struct ICallFactoryVtbl
*pCallFactoryVtbl
;
106 const IID
*pAsyncIID
;
107 struct IPSFactoryBuffer
*pPSFactory
;
110 typedef struct tagCStdPSFactoryBuffer
112 const IPSFactoryBufferVtbl
*lpVtbl
;
114 const ProxyFileInfo
**pProxyFileList
;
116 } CStdPSFactoryBuffer
;
119 CStdStubBuffer_QueryInterface( IRpcStubBuffer
*This
, REFIID riid
, void **ppvObject
);
121 CStdStubBuffer_AddRef( IRpcStubBuffer
*This
);
123 CStdStubBuffer_Release( IRpcStubBuffer
*This
);
125 NdrCStdStubBuffer_Release( IRpcStubBuffer
*This
, IPSFactoryBuffer
*pPSF
);
127 CStdStubBuffer_Connect( IRpcStubBuffer
*This
, IUnknown
*pUnkServer
);
129 CStdStubBuffer_Disconnect( IRpcStubBuffer
*This
);
131 CStdStubBuffer_Invoke( IRpcStubBuffer
*This
, RPCOLEMESSAGE
*pRpcMsg
, IRpcChannelBuffer
*pRpcChannelBuffer
);
132 IRpcStubBuffer
* WINAPI
133 CStdStubBuffer_IsIIDSupported( IRpcStubBuffer
*This
, REFIID riid
);
135 CStdStubBuffer_CountRefs( IRpcStubBuffer
*This
);
137 CStdStubBuffer_DebugServerQueryInterface( IRpcStubBuffer
*This
, void **ppv
);
139 CStdStubBuffer_DebugServerRelease( IRpcStubBuffer
*This
, void *pv
);
141 #define CStdStubBuffer_METHODS \
142 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE \
143 CStdStubBuffer_QueryInterface, \
144 CStdStubBuffer_AddRef, \
145 CStdStubBuffer_Release, \
146 CStdStubBuffer_Connect, \
147 CStdStubBuffer_Disconnect, \
148 CStdStubBuffer_Invoke, \
149 CStdStubBuffer_IsIIDSupported, \
150 CStdStubBuffer_CountRefs, \
151 CStdStubBuffer_DebugServerQueryInterface, \
152 CStdStubBuffer_DebugServerRelease
154 RPCRTAPI
void RPC_ENTRY
155 NdrProxyInitialize( void *This
, PRPC_MESSAGE pRpcMsg
, PMIDL_STUB_MESSAGE pStubMsg
,
156 PMIDL_STUB_DESC pStubDescriptor
, unsigned int ProcNum
);
157 RPCRTAPI
void RPC_ENTRY
158 NdrProxyGetBuffer( void *This
, PMIDL_STUB_MESSAGE pStubMsg
);
159 RPCRTAPI
void RPC_ENTRY
160 NdrProxySendReceive( void *This
, PMIDL_STUB_MESSAGE pStubMsg
);
161 RPCRTAPI
void RPC_ENTRY
162 NdrProxyFreeBuffer( void *This
, PMIDL_STUB_MESSAGE pStubMsg
);
163 RPCRTAPI HRESULT RPC_ENTRY
164 NdrProxyErrorHandler( DWORD dwExceptionCode
);
166 RPCRTAPI
void RPC_ENTRY
167 NdrStubInitialize( PRPC_MESSAGE pRpcMsg
, PMIDL_STUB_MESSAGE pStubMsg
,
168 PMIDL_STUB_DESC pStubDescriptor
, IRpcChannelBuffer
*pRpcChannelBuffer
);
169 RPCRTAPI
void RPC_ENTRY
170 NdrStubInitializePartial( PRPC_MESSAGE pRpcMsg
, PMIDL_STUB_MESSAGE pStubMsg
,
171 PMIDL_STUB_DESC pStubDescriptor
, IRpcChannelBuffer
*pRpcChannelBuffer
,
172 unsigned long RequestedBufferSize
);
173 void __RPC_STUB
NdrStubForwardingFunction( IRpcStubBuffer
*This
, IRpcChannelBuffer
*pChannel
,
174 PRPC_MESSAGE pMsg
, DWORD
*pdwStubPhase
);
175 RPCRTAPI
void RPC_ENTRY
176 NdrStubGetBuffer( IRpcStubBuffer
*This
, IRpcChannelBuffer
*pRpcChannelBuffer
, PMIDL_STUB_MESSAGE pStubMsg
);
177 RPCRTAPI HRESULT RPC_ENTRY
178 NdrStubErrorHandler( DWORD dwExceptionCode
);
180 RPCRTAPI HRESULT RPC_ENTRY
181 NdrDllGetClassObject( REFCLSID rclsid
, REFIID riid
, void **ppv
, const ProxyFileInfo
**pProxyFileList
,
182 const CLSID
*pclsid
, CStdPSFactoryBuffer
*pPSFactoryBuffer
);
183 RPCRTAPI HRESULT RPC_ENTRY
184 NdrDllCanUnloadNow( CStdPSFactoryBuffer
*pPSFactoryBuffer
);
186 RPCRTAPI HRESULT RPC_ENTRY
187 NdrDllRegisterProxy( HMODULE hDll
, const ProxyFileInfo
**pProxyFileList
, const CLSID
*pclsid
);
188 RPCRTAPI HRESULT RPC_ENTRY
189 NdrDllUnregisterProxy( HMODULE hDll
, const ProxyFileInfo
**pProxyFileList
, const CLSID
*pclsid
);
191 #define CSTDSTUBBUFFERRELEASE(pFactory) \
192 ULONG WINAPI CStdStubBuffer_Release(IRpcStubBuffer *This) \
193 { return NdrCStdStubBuffer_Release(This, (IPSFactoryBuffer *)pFactory); }
195 #define IID_GENERIC_CHECK_IID(name,pIID,index) memcmp(pIID, name##_ProxyVtblList[index]->header.piid, sizeof(IID))
198 * In these macros, BS stands for Binary Search. MIDL uses these to
199 * "unroll" a binary search into the module's IID_Lookup function.
200 * However, I haven't bothered to reimplement that stuff yet;
201 * I've just implemented a linear search for now.
203 #define IID_BS_LOOKUP_SETUP \
205 #define IID_BS_LOOKUP_INITIAL_TEST(name, sz, split)
206 #define IID_BS_LOOKUP_NEXT_TEST(name, split)
207 #define IID_BS_LOOKUP_RETURN_RESULT(name, sz, index) \
208 for (c=0; c<sz; c++) if (!name##_CHECK_IID(c)) { (index)=c; return 1; } \
213 /* see http://msdn.microsoft.com/library/en-us/dnmsj99/html/com0199.asp?frame=true */
215 RPCRTAPI HRESULT RPC_ENTRY
216 CreateProxyFromTypeInfo( LPTYPEINFO pTypeInfo
, LPUNKNOWN pUnkOuter
, REFIID riid
,
217 LPRPCPROXYBUFFER
*ppProxy
, LPVOID
*ppv
);
218 RPCRTAPI HRESULT RPC_ENTRY
219 CreateStubFromTypeInfo( LPTYPEINFO pTypeInfo
, REFIID riid
, LPUNKNOWN pUnkServer
,
220 LPRPCSTUBBUFFER
*ppStub
);
224 #endif /*__WINE_RPCDCE_H */