ReactOS 0.4.16-dev-2332-g4cba65d
oleproxy.c
Go to the documentation of this file.
1/*
2 * OLE32 proxy/stub handler
3 *
4 * Copyright 2002 Marcus Meissner
5 * Copyright 2001 Ove Kåven, TransGaming Technologies
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 */
21
22#include <stdlib.h>
23#include <stdarg.h>
24#include <stdio.h>
25#include <string.h>
26
27#define COBJMACROS
28
29#include "windef.h"
30#include "winbase.h"
31#include "winuser.h"
32#include "objbase.h"
33#include "ole2.h"
34#include "rpc.h"
35
36#include "compobj_private.h"
37#include "moniker.h"
38#include "comcat.h"
39
40#include "wine/debug.h"
41
43
45{
46 TRACE("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppv);
47
49 {
50 *ppv = iface;
51 return S_OK;
52 }
53
54 *ppv = NULL;
55 return E_NOINTERFACE;
56}
57
59{
60 return 2;
61}
62
64{
65 return 1;
66}
67
69{
70 TRACE("(%x)\n", fLock);
71 return S_OK;
72}
73
74static const IClassFactoryVtbl FileMonikerCFVtbl =
75{
81};
82
84
85static const IClassFactoryVtbl ItemMonikerCFVtbl =
86{
92};
93
95
96static const IClassFactoryVtbl AntiMonikerCFVtbl =
97{
103};
104
106
107static const IClassFactoryVtbl CompositeMonikerCFVtbl =
108{
114};
115
117
118static const IClassFactoryVtbl ClassMonikerCFVtbl =
119{
125};
126
128
129static const IClassFactoryVtbl PointerMonikerCFVtbl =
130{
136};
137
139
140static const IClassFactoryVtbl ObjrefMonikerCFVtbl =
141{
147};
148
150
151static const IClassFactoryVtbl ComCatCFVtbl =
152{
158};
159
161
162static const IClassFactoryVtbl GlobalInterfaceTableCFVtbl =
163{
169};
170
172
173static const IClassFactoryVtbl ManualResetEventCFVtbl =
174{
180};
181
183
184/***********************************************************************
185 * DllGetClassObject [OLE32.@]
186 */
188{
189 HRESULT hr;
190
191 *ppv = NULL;
192 if (IsEqualIID(rclsid,&CLSID_DfMarshal)&&(
195 )
196 )
199 return IClassFactory_QueryInterface(&GlobalInterfaceTableCF, iid, ppv);
201 return IClassFactory_QueryInterface(&ManualResetEventCF, iid, ppv);
202 if (IsEqualCLSID(rclsid, &CLSID_FileMoniker))
203 return IClassFactory_QueryInterface(&FileMonikerCF, iid, ppv);
204 if (IsEqualCLSID(rclsid, &CLSID_ItemMoniker))
205 return IClassFactory_QueryInterface(&ItemMonikerCF, iid, ppv);
206 if (IsEqualCLSID(rclsid, &CLSID_AntiMoniker))
207 return IClassFactory_QueryInterface(&AntiMonikerCF, iid, ppv);
208 if (IsEqualCLSID(rclsid, &CLSID_CompositeMoniker))
209 return IClassFactory_QueryInterface(&CompositeMonikerCF, iid, ppv);
210 if (IsEqualCLSID(rclsid, &CLSID_ClassMoniker))
211 return IClassFactory_QueryInterface(&ClassMonikerCF, iid, ppv);
212 if (IsEqualCLSID(rclsid, &CLSID_ObjrefMoniker))
213 return IClassFactory_QueryInterface(&ObjrefMonikerCF, iid, ppv);
214 if (IsEqualCLSID(rclsid, &CLSID_PointerMoniker))
215 return IClassFactory_QueryInterface(&PointerMonikerCF, iid, ppv);
216 if (IsEqualGUID(rclsid, &CLSID_StdComponentCategoriesMgr))
217 return IClassFactory_QueryInterface(&ComCatCF, iid, ppv);
218
219 hr = OLE32_DllGetClassObject(rclsid, iid, ppv);
220 if (SUCCEEDED(hr))
221 return hr;
222
223 return Handler_DllGetClassObject(rclsid, iid, ppv);
224}
225
226/***********************************************************************
227 * Ole32DllGetClassObject [OLE32.@]
228 */
230{
232 return IClassFactory_QueryInterface(&GlobalInterfaceTableCF, riid, obj);
233 else if (IsEqualCLSID(rclsid, &CLSID_ManualResetEvent))
234 return IClassFactory_QueryInterface(&ManualResetEventCF, riid, obj);
235 else if (IsEqualCLSID(rclsid, &CLSID_InProcFreeMarshaler))
236 return FTMarshalCF_Create(riid, obj);
237 else
239}
HRESULT WINAPI AntiMoniker_CreateInstance(IClassFactory *iface, IUnknown *pUnk, REFIID riid, void **ppv)
Definition: antimoniker.c:633
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
const GUID IID_IUnknown
const GUID IID_IClassFactory
const CLSID CLSID_ManualResetEvent
const CLSID CLSID_InProcFreeMarshaler
const CLSID CLSID_StdGlobalInterfaceTable
HRESULT WINAPI ClassMoniker_CreateInstance(IClassFactory *iface, IUnknown *pUnk, REFIID riid, void **ppv)
Definition: classmoniker.c:686
HRESULT WINAPI OLE32_DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
HRESULT MARSHAL_GetStandardMarshalCF(LPVOID *ppv)
Definition: marshal.c:92
HRESULT FTMarshalCF_Create(REFIID riid, LPVOID *ppv)
Definition: ftmarshal.c:99
HRESULT WINAPI GlobalInterfaceTable_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **obj)
Definition: git.c:303
HRESULT WINAPI CompositeMoniker_CreateInstance(IClassFactory *iface, IUnknown *pUnk, REFIID riid, void **ppv)
#define NULL
Definition: types.h:112
HRESULT WINAPI ComCat_CreateInstance(IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, void **ppvObj)
Definition: comcat.c:686
HRESULT Handler_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
Definition: compobj.c:911
HRESULT WINAPI ManualResetEvent_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID iid, void **ppv)
Definition: compobj.c:481
HRESULT WINAPI FileMoniker_CreateInstance(IClassFactory *iface, IUnknown *pUnk, REFIID riid, void **ppv)
Definition: filemoniker.c:1486
unsigned int BOOL
Definition: ntddk_ex.h:94
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
HRESULT WINAPI ItemMoniker_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
Definition: itemmoniker.c:978
#define debugstr_guid
Definition: kernel32.h:35
static const GUID CLSID_DfMarshal
Definition: marshal.c:62
HRESULT WINAPI ObjrefMoniker_CreateInstance(IClassFactory *iface, IUnknown *pUnk, REFIID riid, void **ppv)
HRESULT WINAPI PointerMoniker_CreateInstance(IClassFactory *iface, IUnknown *pUnk, REFIID riid, void **ppv)
static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL fLock)
Definition: oleproxy.c:68
static const IClassFactoryVtbl CompositeMonikerCFVtbl
Definition: oleproxy.c:107
HRESULT WINAPI Ole32DllGetClassObject(REFCLSID rclsid, REFIID riid, void **obj)
Definition: oleproxy.c:229
static const IClassFactoryVtbl FileMonikerCFVtbl
Definition: oleproxy.c:74
static const IClassFactoryVtbl ComCatCFVtbl
Definition: oleproxy.c:151
static IClassFactory ObjrefMonikerCF
Definition: oleproxy.c:149
static const IClassFactoryVtbl AntiMonikerCFVtbl
Definition: oleproxy.c:96
static const IClassFactoryVtbl ClassMonikerCFVtbl
Definition: oleproxy.c:118
static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
Definition: oleproxy.c:63
static IClassFactory AntiMonikerCF
Definition: oleproxy.c:105
static const IClassFactoryVtbl GlobalInterfaceTableCFVtbl
Definition: oleproxy.c:162
static const IClassFactoryVtbl ItemMonikerCFVtbl
Definition: oleproxy.c:85
static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
Definition: oleproxy.c:44
static const IClassFactoryVtbl ManualResetEventCFVtbl
Definition: oleproxy.c:173
static IClassFactory PointerMonikerCF
Definition: oleproxy.c:138
static IClassFactory CompositeMonikerCF
Definition: oleproxy.c:116
IClassFactory GlobalInterfaceTableCF
Definition: oleproxy.c:171
static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
Definition: oleproxy.c:58
static const IClassFactoryVtbl ObjrefMonikerCFVtbl
Definition: oleproxy.c:140
static IClassFactory ClassMonikerCF
Definition: oleproxy.c:127
static IClassFactory ComCatCF
Definition: oleproxy.c:160
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
Definition: oleproxy.c:187
IClassFactory ManualResetEventCF
Definition: oleproxy.c:182
static const IClassFactoryVtbl PointerMonikerCFVtbl
Definition: oleproxy.c:129
static IClassFactory FileMonikerCF
Definition: oleproxy.c:83
static IClassFactory ItemMonikerCF
Definition: oleproxy.c:94
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
#define REFCLSID
Definition: guiddef.h:117
#define IsEqualCLSID(rclsid1, rclsid2)
Definition: guiddef.h:96
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4
uint32_t ULONG
Definition: typedefs.h:59
#define WINAPI
Definition: msvc.h:6
#define E_NOINTERFACE
Definition: winerror.h:3479
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:3772