diff --git a/dlls/dmloader/container.c b/dlls/dmloader/container.c index 68ee5738395..871c8b0f433 100644 --- a/dlls/dmloader/container.c +++ b/dlls/dmloader/container.c @@ -909,7 +909,8 @@ static const IPersistStreamVtbl DirectMusicContainer_PersistStream_Vtbl = { }; /* for ClassFactory */ -HRESULT WINAPI DMUSIC_CreateDirectMusicContainerImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) { +HRESULT WINAPI create_dmcontainer(REFIID lpcGUID, void **ppobj) +{ IDirectMusicContainerImpl* obj; obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicContainerImpl)); diff --git a/dlls/dmloader/dmloader_main.c b/dlls/dmloader/dmloader_main.c index eaed6339a91..38faa8e22e1 100644 --- a/dlls/dmloader/dmloader_main.c +++ b/dlls/dmloader/dmloader_main.c @@ -27,7 +27,7 @@ LONG module_ref = 0; typedef struct { IClassFactory IClassFactory_iface; - HRESULT WINAPI (*fnCreateInstance)(REFIID riid, void **ppv, IUnknown *pUnkOuter); + HRESULT WINAPI (*fnCreateInstance)(REFIID riid, void **ppv); } IClassFactoryImpl; /****************************************************************** @@ -73,13 +73,18 @@ static ULONG WINAPI ClassFactory_Release(IClassFactory *iface) } static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown *pUnkOuter, - REFIID riid, void **ppv) + REFIID riid, void **ret_iface) { IClassFactoryImpl *This = impl_from_IClassFactory(iface); - TRACE ("(%p, %s, %p)\n", pUnkOuter, debugstr_dmguid(riid), ppv); + TRACE ("(%s, %p)\n", debugstr_dmguid(riid), ret_iface); - return This->fnCreateInstance(riid, ppv, pUnkOuter); + if (pUnkOuter) { + *ret_iface = NULL; + return CLASS_E_NOAGGREGATION; + } + + return This->fnCreateInstance(riid, ret_iface); } static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL dolock) @@ -102,9 +107,8 @@ static const IClassFactoryVtbl classfactory_vtbl = { ClassFactory_LockServer }; -static IClassFactoryImpl dm_loader_CF = {{&classfactory_vtbl}, DMUSIC_CreateDirectMusicLoaderImpl}; -static IClassFactoryImpl dm_container_CF = {{&classfactory_vtbl}, - DMUSIC_CreateDirectMusicContainerImpl}; +static IClassFactoryImpl dm_loader_CF = {{&classfactory_vtbl}, create_dmloader}; +static IClassFactoryImpl dm_container_CF = {{&classfactory_vtbl}, create_dmcontainer}; /****************************************************************** * DllMain diff --git a/dlls/dmloader/dmloader_private.h b/dlls/dmloader/dmloader_private.h index e3930809c03..f01acfc0538 100644 --- a/dlls/dmloader/dmloader_private.h +++ b/dlls/dmloader/dmloader_private.h @@ -65,8 +65,8 @@ typedef struct IDirectMusicLoaderGenericStream IDirectMusicLoaderGenericStream; /***************************************************************************** * Creation helpers */ -extern HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN; -extern HRESULT WINAPI DMUSIC_CreateDirectMusicContainerImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN; +extern HRESULT WINAPI create_dmloader(REFIID riid, void **ret_iface) DECLSPEC_HIDDEN; +extern HRESULT WINAPI create_dmcontainer(REFIID riid, void **ret_iface) DECLSPEC_HIDDEN; extern HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderFileStream (LPVOID *ppobj) DECLSPEC_HIDDEN; extern HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderResourceStream (LPVOID *ppobj) DECLSPEC_HIDDEN; extern HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderGenericStream (LPVOID *ppobj) DECLSPEC_HIDDEN; diff --git a/dlls/dmloader/loader.c b/dlls/dmloader/loader.c index 39f00a0301f..967b093f135 100644 --- a/dlls/dmloader/loader.c +++ b/dlls/dmloader/loader.c @@ -888,14 +888,14 @@ static HRESULT DMUSIC_GetDefaultGMPath (WCHAR wszPath[MAX_PATH]) { } /* for ClassFactory */ -HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderImpl(const GUID *lpcGUID, void **ppobj, IUnknown *pUnkOuter) +HRESULT WINAPI create_dmloader(REFIID lpcGUID, void **ppobj) { IDirectMusicLoaderImpl *obj; DMUS_OBJECTDESC Desc; LPWINE_LOADER_ENTRY pDefaultDLSEntry; struct list *pEntry; - TRACE("(%s, %p, %p)\n", debugstr_dmguid(lpcGUID), ppobj, pUnkOuter); + TRACE("(%s, %p)\n", debugstr_dmguid(lpcGUID), ppobj); obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicLoaderImpl)); if (NULL == obj) { *ppobj = NULL;