mscoree: Always return S_FALSE from DllCanUnloadNow.

We can't really unload after Mono is loaded unless we're exiting the process.
We could before that, but it's probably not worth the effort.
This commit is contained in:
Vincent Povirk 2011-02-23 15:29:58 -06:00 committed by Alexandre Julliard
parent d6582ae8bd
commit b92d834d36
5 changed files with 1 additions and 29 deletions

View File

@ -95,8 +95,6 @@ static HRESULT RuntimeHost_AddDomain(RuntimeHost *This, MonoDomain **result)
list_add_tail(&This->domains, &entry->entry);
MSCOREE_LockModule();
*result = entry->domain;
end:
@ -137,7 +135,6 @@ static void RuntimeHost_DeleteDomain(RuntimeHost *This, MonoDomain *domain)
if (This->default_domain == domain)
This->default_domain = NULL;
HeapFree(GetProcessHeap(), 0, entry);
MSCOREE_UnlockModule();
break;
}
}
@ -183,8 +180,6 @@ static ULONG WINAPI corruntimehost_AddRef(ICorRuntimeHost* iface)
{
RuntimeHost *This = impl_from_ICorRuntimeHost( iface );
MSCOREE_LockModule();
return InterlockedIncrement( &This->ref );
}
@ -193,8 +188,6 @@ static ULONG WINAPI corruntimehost_Release(ICorRuntimeHost* iface)
RuntimeHost *This = impl_from_ICorRuntimeHost( iface );
ULONG ref;
MSCOREE_UnlockModule();
ref = InterlockedDecrement( &This->ref );
return ref;

View File

@ -79,8 +79,6 @@ static ULONG WINAPI MetaDataDispenser_AddRef(IMetaDataDispenserEx* iface)
TRACE("%p ref=%u\n", This, ref);
MSCOREE_LockModule();
return ref;
}
@ -96,8 +94,6 @@ static ULONG WINAPI MetaDataDispenser_Release(IMetaDataDispenserEx* iface)
HeapFree(GetProcessHeap(), 0, This);
}
MSCOREE_UnlockModule();
return ref;
}

View File

@ -325,13 +325,11 @@ static HRESULT WINAPI CLRRuntimeInfo_QueryInterface(ICLRRuntimeInfo* iface,
static ULONG WINAPI CLRRuntimeInfo_AddRef(ICLRRuntimeInfo* iface)
{
MSCOREE_LockModule();
return 2;
}
static ULONG WINAPI CLRRuntimeInfo_Release(ICLRRuntimeInfo* iface)
{
MSCOREE_UnlockModule();
return 1;
}
@ -788,8 +786,6 @@ static ULONG WINAPI InstalledRuntimeEnum_AddRef(IEnumUnknown* iface)
struct InstalledRuntimeEnum *This = (struct InstalledRuntimeEnum*)iface;
ULONG ref = InterlockedIncrement(&This->ref);
MSCOREE_LockModule();
TRACE("(%p) refcount=%u\n", iface, ref);
return ref;
@ -800,8 +796,6 @@ static ULONG WINAPI InstalledRuntimeEnum_Release(IEnumUnknown* iface)
struct InstalledRuntimeEnum *This = (struct InstalledRuntimeEnum*)iface;
ULONG ref = InterlockedDecrement(&This->ref);
MSCOREE_UnlockModule();
TRACE("(%p) refcount=%u\n", iface, ref);
if (ref == 0)
@ -942,13 +936,11 @@ static HRESULT WINAPI CLRMetaHost_QueryInterface(ICLRMetaHost* iface,
static ULONG WINAPI CLRMetaHost_AddRef(ICLRMetaHost* iface)
{
MSCOREE_LockModule();
return 2;
}
static ULONG WINAPI CLRMetaHost_Release(ICLRMetaHost* iface)
{
MSCOREE_UnlockModule();
return 1;
}

View File

@ -47,8 +47,6 @@
WINE_DEFAULT_DEBUG_CHANNEL( mscoree );
LONG dll_refs = 0;
char *WtoA(LPCWSTR wstr)
{
int length;
@ -459,10 +457,7 @@ HRESULT WINAPI DllUnregisterServer(void)
HRESULT WINAPI DllCanUnloadNow(VOID)
{
if (dll_refs)
return S_FALSE;
else
return S_OK;
return S_FALSE;
}
INT WINAPI ND_RU1( const void *ptr, INT offset )

View File

@ -20,10 +20,6 @@
#ifndef __MSCOREE_PRIVATE__
#define __MSCOREE_PRIVATE__
extern LONG dll_refs;
static inline void MSCOREE_LockModule(void) { InterlockedIncrement(&dll_refs); }
static inline void MSCOREE_UnlockModule(void) { InterlockedDecrement(&dll_refs); }
extern char *WtoA(LPCWSTR wstr);
extern HRESULT CLRMetaHost_CreateInstance(REFIID riid, void **ppobj);