[RPCRT4] Sync with Wine Staging 4.0. CORE-15682
[reactos.git] / dll / win32 / rpcrt4 / cpsf.h
1 /*
2 * COM proxy definitions
3 *
4 * Copyright 2001 Ove Kåven, TransGaming Technologies
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21 #ifndef __WINE_CPSF_H
22 #define __WINE_CPSF_H
23
24 typedef struct
25 {
26 IRpcProxyBuffer IRpcProxyBuffer_iface;
27 void **PVtbl;
28 LONG RefCount;
29 const IID *piid;
30 IUnknown *pUnkOuter;
31 /* offset of base_object from PVtbl must match assembly thunks; see
32 * fill_delegated_proxy_table() */
33 IUnknown *base_object;
34 IRpcProxyBuffer *base_proxy;
35 PCInterfaceName name;
36 IPSFactoryBuffer *pPSFactory;
37 IRpcChannelBuffer *pChannel;
38 } StdProxyImpl;
39
40 typedef struct
41 {
42 IUnknownVtbl *base_obj;
43 IRpcStubBuffer *base_stub;
44 CStdStubBuffer stub_buffer;
45 } cstdstubbuffer_delegating_t;
46
47 HRESULT StdProxy_Construct(REFIID riid, LPUNKNOWN pUnkOuter, const ProxyFileInfo *ProxyInfo,
48 int Index, LPPSFACTORYBUFFER pPSFactory, LPRPCPROXYBUFFER *ppProxy,
49 LPVOID *ppvObj) DECLSPEC_HIDDEN;
50 HRESULT WINAPI StdProxy_QueryInterface(IRpcProxyBuffer *iface, REFIID iid, void **obj) DECLSPEC_HIDDEN;
51 ULONG WINAPI StdProxy_AddRef(IRpcProxyBuffer *iface) DECLSPEC_HIDDEN;
52 HRESULT WINAPI StdProxy_Connect(IRpcProxyBuffer *iface, IRpcChannelBuffer *channel) DECLSPEC_HIDDEN;
53 void WINAPI StdProxy_Disconnect(IRpcProxyBuffer *iface) DECLSPEC_HIDDEN;
54
55 HRESULT CStdStubBuffer_Construct(REFIID riid, LPUNKNOWN pUnkServer, PCInterfaceName name,
56 CInterfaceStubVtbl *vtbl, LPPSFACTORYBUFFER pPSFactory,
57 LPRPCSTUBBUFFER *ppStub) DECLSPEC_HIDDEN;
58
59 HRESULT CStdStubBuffer_Delegating_Construct(REFIID riid, LPUNKNOWN pUnkServer, PCInterfaceName name,
60 CInterfaceStubVtbl *vtbl, REFIID delegating_iid,
61 LPPSFACTORYBUFFER pPSFactory, LPRPCSTUBBUFFER *ppStub) DECLSPEC_HIDDEN;
62
63 const MIDL_SERVER_INFO *CStdStubBuffer_GetServerInfo(IRpcStubBuffer *iface) DECLSPEC_HIDDEN;
64
65 extern const IRpcStubBufferVtbl CStdStubBuffer_Vtbl DECLSPEC_HIDDEN;
66 extern const IRpcStubBufferVtbl CStdStubBuffer_Delegating_Vtbl DECLSPEC_HIDDEN;
67
68 BOOL fill_delegated_proxy_table(IUnknownVtbl *vtbl, DWORD num) DECLSPEC_HIDDEN;
69 HRESULT create_proxy(REFIID iid, IUnknown *pUnkOuter, IRpcProxyBuffer **pproxy, void **ppv) DECLSPEC_HIDDEN;
70 HRESULT create_stub(REFIID iid, IUnknown *pUnk, IRpcStubBuffer **ppstub) DECLSPEC_HIDDEN;
71 BOOL fill_stubless_table(IUnknownVtbl *vtbl, DWORD num) DECLSPEC_HIDDEN;
72 IUnknownVtbl *get_delegating_vtbl(DWORD num_methods) DECLSPEC_HIDDEN;
73 void release_delegating_vtbl(IUnknownVtbl *vtbl) DECLSPEC_HIDDEN;
74
75 #endif /* __WINE_CPSF_H */