ole32: Add a class factory for composite monikers.

This commit is contained in:
Robert Shearman 2006-05-08 12:41:06 +01:00 committed by Alexandre Julliard
parent fa8472c35a
commit caefc34084
3 changed files with 72 additions and 1 deletions

View File

@ -37,7 +37,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(ole);
static const CLSID CLSID_CompositeMoniker = {
const CLSID CLSID_CompositeMoniker = {
0x309, 0, 0, {0xC0, 0, 0, 0, 0, 0, 0, 0x46}
};
@ -1944,3 +1944,70 @@ MonikerCommonPrefixWith(IMoniker* pmkThis,IMoniker* pmkOther,IMoniker** ppmkComm
FIXME("(),stub!\n");
return E_NOTIMPL;
}
static HRESULT WINAPI CompositeMonikerCF_QueryInterface(LPCLASSFACTORY iface,
REFIID riid, LPVOID *ppv)
{
*ppv = NULL;
if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IClassFactory))
{
*ppv = iface;
IUnknown_AddRef(iface);
return S_OK;
}
return E_NOINTERFACE;
}
static ULONG WINAPI CompositeMonikerCF_AddRef(LPCLASSFACTORY iface)
{
return 2; /* non-heap based object */
}
static ULONG WINAPI CompositeMonikerCF_Release(LPCLASSFACTORY iface)
{
return 1; /* non-heap based object */
}
static HRESULT WINAPI CompositeMonikerCF_CreateInstance(LPCLASSFACTORY iface,
LPUNKNOWN pUnk, REFIID riid, LPVOID *ppv)
{
CompositeMonikerImpl* newCompositeMoniker;
HRESULT hr;
TRACE("(%p, %s, %p)\n", pUnk, debugstr_guid(riid), ppv);
*ppv = NULL;
if (pUnk)
return CLASS_E_NOAGGREGATION;
hr = CompositeMonikerImpl_Construct(&newCompositeMoniker, NULL, NULL);
if (SUCCEEDED(hr))
hr = CompositeMonikerImpl_QueryInterface((IMoniker*)newCompositeMoniker, riid, ppv);
if (FAILED(hr))
HeapFree(GetProcessHeap(),0,newCompositeMoniker);
return hr;
}
static HRESULT WINAPI CompositeMonikerCF_LockServer(LPCLASSFACTORY iface, BOOL fLock)
{
FIXME("(%d), stub!\n",fLock);
return S_OK;
}
static const IClassFactoryVtbl CompositeMonikerCFVtbl =
{
CompositeMonikerCF_QueryInterface,
CompositeMonikerCF_AddRef,
CompositeMonikerCF_Release,
CompositeMonikerCF_CreateInstance,
CompositeMonikerCF_LockServer
};
static const IClassFactoryVtbl *CompositeMonikerCF = &CompositeMonikerCFVtbl;
HRESULT CompositeMonikerCF_Create(REFIID riid, LPVOID *ppv)
{
return IClassFactory_QueryInterface((IClassFactory *)&CompositeMonikerCF, riid, ppv);
}

View File

@ -4,10 +4,12 @@
extern const CLSID CLSID_FileMoniker;
extern const CLSID CLSID_ItemMoniker;
extern const CLSID CLSID_AntiMoniker;
extern const CLSID CLSID_CompositeMoniker;
HRESULT FileMonikerCF_Create(REFIID riid, LPVOID *ppv);
HRESULT ItemMonikerCF_Create(REFIID riid, LPVOID *ppv);
HRESULT AntiMonikerCF_Create(REFIID riid, LPVOID *ppv);
HRESULT CompositeMonikerCF_Create(REFIID riid, LPVOID *ppv);
HRESULT MonikerMarshal_Create(IMoniker *inner, IUnknown **outer);

View File

@ -1016,6 +1016,8 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid,LPVOID *ppv)
return ItemMonikerCF_Create(iid, ppv);
if (IsEqualCLSID(rclsid, &CLSID_AntiMoniker))
return AntiMonikerCF_Create(iid, ppv);
if (IsEqualCLSID(rclsid, &CLSID_CompositeMoniker))
return CompositeMonikerCF_Create(iid, ppv);
FIXME("\n\tCLSID:\t%s,\n\tIID:\t%s\n",debugstr_guid(rclsid),debugstr_guid(iid));
return CLASS_E_CLASSNOTAVAILABLE;