2 * OLE32 proxy/stub handler
4 * Copyright 2002 Marcus Meissner
5 * Copyright 2001 Ove Kåven, TransGaming Technologies
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.
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.
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
38 #include "compobj_private.h"
42 #include "wine/debug.h"
44 WINE_DEFAULT_DEBUG_CHANNEL(ole
);
46 static HRESULT WINAPI
ClassFactory_QueryInterface(IClassFactory
*iface
, REFIID riid
, void **ppv
)
48 TRACE("(%p)->(%s %p)\n", iface
, debugstr_guid(riid
), ppv
);
50 if (IsEqualIID(riid
, &IID_IUnknown
) || IsEqualIID(riid
, &IID_IClassFactory
))
60 static ULONG WINAPI
ClassFactory_AddRef(IClassFactory
*iface
)
65 static ULONG WINAPI
ClassFactory_Release(IClassFactory
*iface
)
70 static HRESULT WINAPI
ClassFactory_LockServer(IClassFactory
*iface
, BOOL fLock
)
72 TRACE("(%x)\n", fLock
);
76 static const IClassFactoryVtbl FileMonikerCFVtbl
=
78 ClassFactory_QueryInterface
,
81 FileMoniker_CreateInstance
,
82 ClassFactory_LockServer
85 static IClassFactory FileMonikerCF
= { &FileMonikerCFVtbl
};
87 /***********************************************************************
88 * DllGetClassObject [OLE32.@]
90 HRESULT WINAPI
DllGetClassObject(REFCLSID rclsid
, REFIID iid
,LPVOID
*ppv
)
95 if (IsEqualIID(rclsid
,&CLSID_DfMarshal
)&&(
96 IsEqualIID(iid
,&IID_IClassFactory
) ||
97 IsEqualIID(iid
,&IID_IUnknown
)
100 return MARSHAL_GetStandardMarshalCF(ppv
);
101 if (IsEqualIID(rclsid
,&CLSID_StdGlobalInterfaceTable
) && (IsEqualIID(iid
,&IID_IClassFactory
) || IsEqualIID(iid
,&IID_IUnknown
)))
102 return StdGlobalInterfaceTable_GetFactory(ppv
);
103 if (IsEqualCLSID(rclsid
, &CLSID_FileMoniker
))
104 return IClassFactory_QueryInterface(&FileMonikerCF
, iid
, ppv
);
105 if (IsEqualCLSID(rclsid
, &CLSID_ItemMoniker
))
106 return ItemMonikerCF_Create(iid
, ppv
);
107 if (IsEqualCLSID(rclsid
, &CLSID_AntiMoniker
))
108 return AntiMonikerCF_Create(iid
, ppv
);
109 if (IsEqualCLSID(rclsid
, &CLSID_CompositeMoniker
))
110 return CompositeMonikerCF_Create(iid
, ppv
);
111 if (IsEqualCLSID(rclsid
, &CLSID_ClassMoniker
))
112 return ClassMonikerCF_Create(iid
, ppv
);
113 if (IsEqualCLSID(rclsid
, &CLSID_PointerMoniker
))
114 return PointerMonikerCF_Create(iid
, ppv
);
115 if (IsEqualGUID(rclsid
, &CLSID_StdComponentCategoriesMgr
))
116 return ComCatCF_Create(iid
, ppv
);
118 hr
= OLE32_DllGetClassObject(rclsid
, iid
, ppv
);
122 return Handler_DllGetClassObject(rclsid
, iid
, ppv
);