Removed dependencies on the internals of the region object.
[wine] / include / rpcproxy.h
1 /*
2  * Copyright (C) 2001 Ove Kaaven
3  *
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.
8  *
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.
13  *
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
17  */
18
19 #ifndef __WINE_RPCPROXY_H
20 #define __WINE_RPCPROXY_H
21
22 #include "basetsd.h"
23 #include "guiddef.h"
24
25 typedef struct tagCInterfaceStubVtbl *PCInterfaceStubVtblList;
26 typedef struct tagCInterfaceProxyVtbl *PCInterfaceProxyVtblList;
27 typedef const char *PCInterfaceName;
28 typedef int __stdcall IIDLookupRtn( const IID *pIID, int *pIndex );
29 typedef IIDLookupRtn *PIIDLookup;
30
31 typedef struct tagProxyFileInfo
32 {
33   const PCInterfaceProxyVtblList *pProxyVtblList;
34   const PCInterfaceStubVtblList *pStubVtblList;
35   const PCInterfaceName *pNamesArray;
36   const IID **pDelegatedIIDs;
37   const PIIDLookup pIIDLookupRtn;
38   unsigned short TableSize;
39   unsigned short TableVersion;
40   const IID **pAsyncIIDLookup;
41   LONG_PTR Filler2;
42   LONG_PTR Filler3;
43   LONG_PTR Filler4;
44 } ProxyFileInfo;
45
46 typedef ProxyFileInfo ExtendedProxyFileInfo;
47
48 #include "rpc.h"
49 #include "rpcndr.h"
50
51 typedef struct tagCInterfaceProxyHeader
52 {
53 #ifdef USE_STUBLESS_PROXY
54   const void *pStublessProxyInfo;
55 #endif
56   const IID *piid;
57 } CInterfaceProxyHeader;
58
59 #define CINTERFACE_PROXY_VTABLE(n) \
60   struct \
61   { \
62     CInterfaceProxyHeader header; \
63     void *Vtbl[n]; \
64   }
65
66 typedef struct tagCInterfaceProxyVtbl
67 {
68   CInterfaceProxyHeader header;
69 #if defined(__GNUC__)
70   void *Vtbl[0];
71 #else
72   void *Vtbl[1];
73 #endif
74 } CInterfaceProxyVtbl;
75
76 typedef void (__RPC_STUB *PRPC_STUB_FUNCTION)(
77   IRpcStubBuffer *This,
78   IRpcChannelBuffer *_pRpcChannelBuffer,
79   PRPC_MESSAGE _pRpcMessage,
80   DWORD *pdwStubPhase);
81
82 typedef struct tagCInterfaceStubHeader
83 {
84   const IID *piid;
85   const MIDL_SERVER_INFO *pServerInfo;
86   unsigned long DispatchTableCount;
87   const PRPC_STUB_FUNCTION *pDispatchTable;
88 } CInterfaceStubHeader;
89
90 typedef struct tagCInterfaceStubVtbl
91 {
92   CInterfaceStubHeader header;
93   ICOM_VTABLE(IRpcStubBuffer) Vtbl;
94 } CInterfaceStubVtbl;
95
96 typedef struct tagCStdStubBuffer
97 {
98   const ICOM_VTABLE(IRpcStubBuffer) *lpVtbl;
99   long RefCount;
100   struct IUnknown *pvServerObject;
101   const struct ICallFactoryVtbl *pCallFactoryVtbl;
102   const IID *pAsyncIID;
103   struct IPSFactoryBuffer *pPSFactory;
104 } CStdStubBuffer;
105
106 typedef struct tagCStdPSFactoryBuffer
107 {
108   const IPSFactoryBufferVtbl *lpVtbl;
109   long RefCount;
110   const ProxyFileInfo **pProxyFileList;
111   long Filler1;
112 } CStdPSFactoryBuffer;
113
114 HRESULT WINAPI
115   CStdStubBuffer_QueryInterface( IRpcStubBuffer *This, REFIID riid, void **ppvObject );
116 ULONG WINAPI
117   CStdStubBuffer_AddRef( IRpcStubBuffer *This );
118 ULONG WINAPI
119   CStdStubBuffer_Release( IRpcStubBuffer *This );
120 ULONG WINAPI
121   NdrCStdStubBuffer_Release( IRpcStubBuffer *This, IPSFactoryBuffer *pPSF );
122 HRESULT WINAPI
123   CStdStubBuffer_Connect( IRpcStubBuffer *This, IUnknown *pUnkServer );
124 void WINAPI
125   CStdStubBuffer_Disconnect( IRpcStubBuffer *This );
126 HRESULT WINAPI
127   CStdStubBuffer_Invoke( IRpcStubBuffer *This, RPCOLEMESSAGE *pRpcMsg, IRpcChannelBuffer *pRpcChannelBuffer );
128 IRpcStubBuffer * WINAPI
129   CStdStubBuffer_IsIIDSupported( IRpcStubBuffer *This, REFIID riid );
130 ULONG WINAPI
131   CStdStubBuffer_CountRefs( IRpcStubBuffer *This );
132 HRESULT WINAPI
133   CStdStubBuffer_DebugServerQueryInterface( IRpcStubBuffer *This, void **ppv );
134 void WINAPI
135   CStdStubBuffer_DebugServerRelease( IRpcStubBuffer *This, void *pv );
136
137 #define CStdStubBuffer_METHODS \
138   ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE \
139   CStdStubBuffer_QueryInterface, \
140   CStdStubBuffer_AddRef, \
141   CStdStubBuffer_Release, \
142   CStdStubBuffer_Connect, \
143   CStdStubBuffer_Disconnect, \
144   CStdStubBuffer_Invoke, \
145   CStdStubBuffer_IsIIDSupported, \
146   CStdStubBuffer_CountRefs, \
147   CStdStubBuffer_DebugServerQueryInterface, \
148   CStdStubBuffer_DebugServerRelease
149
150 RPCRTAPI HRESULT RPC_ENTRY
151   NdrDllGetClassObject( REFCLSID rclsid, REFIID riid, void **ppv, const ProxyFileInfo **pProxyFileList,
152                         const CLSID *pclsid, CStdPSFactoryBuffer *pPSFactoryBuffer );
153 RPCRTAPI HRESULT RPC_ENTRY
154   NdrDllCanUnloadNow( CStdPSFactoryBuffer *pPSFactoryBuffer );
155
156 RPCRTAPI HRESULT RPC_ENTRY
157   NdrDllRegisterProxy( HMODULE hDll, const ProxyFileInfo **pProxyFileList, const CLSID *pclsid );
158 RPCRTAPI HRESULT RPC_ENTRY
159   NdrDllUnregisterProxy( HMODULE hDll, const ProxyFileInfo **pProxyFileList, const CLSID *pclsid );
160
161 #define CSTDSTUBBUFFERRELEASE(pFactory) \
162 ULONG WINAPI CStdStubBuffer_Release(IRpcStubBuffer *This) \
163   { return NdrCStdStubBuffer_Release(This, (IPSFactoryBuffer *)pFactory); }
164
165 #if defined(__WINE__) && defined(__WINE_WINE_OBJ_OLEAUT_H)
166 /* see http://msdn.microsoft.com/library/en-us/dnmsj99/html/com0199.asp?frame=true */
167
168 RPCRTAPI HRESULT RPC_ENTRY
169   CreateProxyFromTypeInfo( LPTYPEINFO pTypeInfo, LPUNKNOWN pUnkOuter, REFIID riid,
170                            LPRPCPROXYBUFFER *ppProxy, LPVOID *ppv );
171 RPCRTAPI HRESULT RPC_ENTRY
172   CreateStubFromTypeInfo( LPTYPEINFO pTypeInfo, REFIID riid, LPUNKNOWN pUnkServer,
173                           LPRPCSTUBBUFFER *ppStub );
174
175 #endif
176
177 #endif /*__WINE_RPCDCE_H */