ReactOS 0.4.15-dev-7958-gcd0bb1a
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 ComCatCFVtbl =
141{
147};
148
150
151static const IClassFactoryVtbl GlobalOptionsCFVtbl =
152{
158};
159
161
162/***********************************************************************
163 * DllGetClassObject [OLE32.@]
164 */
166{
167 HRESULT hr;
168
169 *ppv = NULL;
170 if (IsEqualIID(rclsid,&CLSID_DfMarshal)&&(
173 )
174 )
178 if (IsEqualCLSID(rclsid, &CLSID_FileMoniker))
179 return IClassFactory_QueryInterface(&FileMonikerCF, iid, ppv);
180 if (IsEqualCLSID(rclsid, &CLSID_ItemMoniker))
181 return IClassFactory_QueryInterface(&ItemMonikerCF, iid, ppv);
182 if (IsEqualCLSID(rclsid, &CLSID_AntiMoniker))
183 return IClassFactory_QueryInterface(&AntiMonikerCF, iid, ppv);
184 if (IsEqualCLSID(rclsid, &CLSID_CompositeMoniker))
185 return IClassFactory_QueryInterface(&CompositeMonikerCF, iid, ppv);
186 if (IsEqualCLSID(rclsid, &CLSID_ClassMoniker))
187 return IClassFactory_QueryInterface(&ClassMonikerCF, iid, ppv);
188 if (IsEqualCLSID(rclsid, &CLSID_PointerMoniker))
189 return IClassFactory_QueryInterface(&PointerMonikerCF, iid, ppv);
190 if (IsEqualGUID(rclsid, &CLSID_StdComponentCategoriesMgr))
191 return IClassFactory_QueryInterface(&ComCatCF, iid, ppv);
192
193 hr = OLE32_DllGetClassObject(rclsid, iid, ppv);
194 if (SUCCEEDED(hr))
195 return hr;
196
197 return Handler_DllGetClassObject(rclsid, iid, ppv);
198}
HRESULT WINAPI AntiMoniker_CreateInstance(IClassFactory *iface, IUnknown *pUnk, REFIID riid, void **ppv)
Definition: antimoniker.c:631
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
const GUID IID_IUnknown
const GUID IID_IClassFactory
const CLSID CLSID_StdGlobalInterfaceTable
HRESULT WINAPI ClassMoniker_CreateInstance(IClassFactory *iface, IUnknown *pUnk, REFIID riid, void **ppv)
Definition: classmoniker.c:806
HRESULT MARSHAL_GetStandardMarshalCF(LPVOID *ppv) DECLSPEC_HIDDEN
Definition: marshal.c:2205
HRESULT WINAPI OLE32_DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv) DECLSPEC_HIDDEN
HRESULT StdGlobalInterfaceTable_GetFactory(LPVOID *ppv) DECLSPEC_HIDDEN
Definition: git.c:344
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:702
HRESULT Handler_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
Definition: compobj.c:5167
HRESULT WINAPI GlobalOptions_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
Definition: compobj.c:5351
HRESULT WINAPI FileMoniker_CreateInstance(IClassFactory *iface, IUnknown *pUnk, REFIID riid, void **ppv)
Definition: filemoniker.c:1543
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 *pUnk, REFIID riid, void **ppv)
Definition: itemmoniker.c:958
#define debugstr_guid
Definition: kernel32.h:35
static const GUID CLSID_DfMarshal
Definition: marshal.c:63
HRESULT WINAPI PointerMoniker_CreateInstance(IClassFactory *iface, IUnknown *pUnk, REFIID riid, void **ppv)
static const IClassFactoryVtbl GlobalOptionsCFVtbl
Definition: oleproxy.c:151
static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL fLock)
Definition: oleproxy.c:68
static const IClassFactoryVtbl CompositeMonikerCFVtbl
Definition: oleproxy.c:107
static const IClassFactoryVtbl FileMonikerCFVtbl
Definition: oleproxy.c:74
static const IClassFactoryVtbl ComCatCFVtbl
Definition: oleproxy.c:140
IClassFactory GlobalOptionsCF
Definition: oleproxy.c:160
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 ItemMonikerCFVtbl
Definition: oleproxy.c:85
static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
Definition: oleproxy.c:44
static IClassFactory PointerMonikerCF
Definition: oleproxy.c:138
static IClassFactory CompositeMonikerCF
Definition: oleproxy.c:116
static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
Definition: oleproxy.c:58
static IClassFactory ClassMonikerCF
Definition: oleproxy.c:127
static IClassFactory ComCatCF
Definition: oleproxy.c:149
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
Definition: oleproxy.c:165
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:2364