mirror of
git://source.winehq.org/git/wine.git
synced 2024-07-27 18:12:06 +00:00
dmloader: Always return S_FALSE from DllCanUnloadNow.
This commit is contained in:
parent
6798b73452
commit
30e5892c98
|
@ -137,7 +137,6 @@ static ULONG WINAPI IDirectMusicContainerImpl_Release(IDirectMusicContainer *ifa
|
|||
if (This->pStream)
|
||||
destroy_dmcontainer(This);
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
unlock_module();
|
||||
}
|
||||
|
||||
return ref;
|
||||
|
@ -666,8 +665,6 @@ HRESULT create_dmcontainer(REFIID lpcGUID, void **ppobj)
|
|||
obj->pContainedObjects = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(struct list));
|
||||
list_init (obj->pContainedObjects);
|
||||
|
||||
lock_module();
|
||||
|
||||
hr = IDirectMusicContainer_QueryInterface(&obj->IDirectMusicContainer_iface, lpcGUID, ppobj);
|
||||
IDirectMusicContainer_Release(&obj->IDirectMusicContainer_iface);
|
||||
|
||||
|
|
|
@ -36,8 +36,6 @@
|
|||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(dmloader);
|
||||
|
||||
LONG module_ref = 0;
|
||||
|
||||
typedef struct {
|
||||
IClassFactory IClassFactory_iface;
|
||||
HRESULT (*fnCreateInstance)(REFIID riid, void **ppv);
|
||||
|
@ -73,15 +71,11 @@ static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID r
|
|||
|
||||
static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
|
||||
{
|
||||
lock_module();
|
||||
|
||||
return 2; /* non-heap based object */
|
||||
}
|
||||
|
||||
static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
|
||||
{
|
||||
unlock_module();
|
||||
|
||||
return 1; /* non-heap based object */
|
||||
}
|
||||
|
||||
|
@ -103,12 +97,6 @@ static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown
|
|||
static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL dolock)
|
||||
{
|
||||
TRACE("(%d)\n", dolock);
|
||||
|
||||
if (dolock)
|
||||
lock_module();
|
||||
else
|
||||
unlock_module();
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
@ -123,15 +111,6 @@ static const IClassFactoryVtbl classfactory_vtbl = {
|
|||
static IClassFactoryImpl dm_loader_CF = {{&classfactory_vtbl}, create_dmloader};
|
||||
static IClassFactoryImpl dm_container_CF = {{&classfactory_vtbl}, create_dmcontainer};
|
||||
|
||||
/******************************************************************
|
||||
* DllCanUnloadNow (DMLOADER.@)
|
||||
*/
|
||||
HRESULT WINAPI DllCanUnloadNow (void)
|
||||
{
|
||||
TRACE("() ref=%ld\n", module_ref);
|
||||
|
||||
return module_ref ? S_FALSE : S_OK;
|
||||
}
|
||||
|
||||
/******************************************************************
|
||||
* DllGetClassObject (DMLOADER.@)
|
||||
|
|
|
@ -44,11 +44,6 @@
|
|||
|
||||
#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
|
||||
|
||||
/* dmloader.dll global (for DllCanUnloadNow) */
|
||||
extern LONG module_ref;
|
||||
static inline void lock_module(void) { InterlockedIncrement( &module_ref ); }
|
||||
static inline void unlock_module(void) { InterlockedDecrement( &module_ref ); }
|
||||
|
||||
/*****************************************************************************
|
||||
* Interfaces
|
||||
*/
|
||||
|
|
|
@ -157,7 +157,6 @@ static ULONG WINAPI IDirectMusicLoaderImpl_Release(IDirectMusicLoader8 *iface)
|
|||
for (i = 0; i < ARRAY_SIZE(classes); i++)
|
||||
HeapFree(GetProcessHeap(), 0, This->search_paths[i]);
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
unlock_module();
|
||||
}
|
||||
|
||||
return ref;
|
||||
|
@ -940,7 +939,5 @@ HRESULT create_dmloader(REFIID lpcGUID, void **ppobj)
|
|||
dls->bInvalidDefaultDLS = TRUE;
|
||||
}
|
||||
|
||||
lock_module();
|
||||
|
||||
return IDirectMusicLoader_QueryInterface(&obj->IDirectMusicLoader8_iface, lpcGUID, ppobj);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue