Commit b92d834d authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

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.
parent d6582ae8
...@@ -95,8 +95,6 @@ static HRESULT RuntimeHost_AddDomain(RuntimeHost *This, MonoDomain **result) ...@@ -95,8 +95,6 @@ static HRESULT RuntimeHost_AddDomain(RuntimeHost *This, MonoDomain **result)
list_add_tail(&This->domains, &entry->entry); list_add_tail(&This->domains, &entry->entry);
MSCOREE_LockModule();
*result = entry->domain; *result = entry->domain;
end: end:
...@@ -137,7 +135,6 @@ static void RuntimeHost_DeleteDomain(RuntimeHost *This, MonoDomain *domain) ...@@ -137,7 +135,6 @@ static void RuntimeHost_DeleteDomain(RuntimeHost *This, MonoDomain *domain)
if (This->default_domain == domain) if (This->default_domain == domain)
This->default_domain = NULL; This->default_domain = NULL;
HeapFree(GetProcessHeap(), 0, entry); HeapFree(GetProcessHeap(), 0, entry);
MSCOREE_UnlockModule();
break; break;
} }
} }
...@@ -183,8 +180,6 @@ static ULONG WINAPI corruntimehost_AddRef(ICorRuntimeHost* iface) ...@@ -183,8 +180,6 @@ static ULONG WINAPI corruntimehost_AddRef(ICorRuntimeHost* iface)
{ {
RuntimeHost *This = impl_from_ICorRuntimeHost( iface ); RuntimeHost *This = impl_from_ICorRuntimeHost( iface );
MSCOREE_LockModule();
return InterlockedIncrement( &This->ref ); return InterlockedIncrement( &This->ref );
} }
...@@ -193,8 +188,6 @@ static ULONG WINAPI corruntimehost_Release(ICorRuntimeHost* iface) ...@@ -193,8 +188,6 @@ static ULONG WINAPI corruntimehost_Release(ICorRuntimeHost* iface)
RuntimeHost *This = impl_from_ICorRuntimeHost( iface ); RuntimeHost *This = impl_from_ICorRuntimeHost( iface );
ULONG ref; ULONG ref;
MSCOREE_UnlockModule();
ref = InterlockedDecrement( &This->ref ); ref = InterlockedDecrement( &This->ref );
return ref; return ref;
......
...@@ -79,8 +79,6 @@ static ULONG WINAPI MetaDataDispenser_AddRef(IMetaDataDispenserEx* iface) ...@@ -79,8 +79,6 @@ static ULONG WINAPI MetaDataDispenser_AddRef(IMetaDataDispenserEx* iface)
TRACE("%p ref=%u\n", This, ref); TRACE("%p ref=%u\n", This, ref);
MSCOREE_LockModule();
return ref; return ref;
} }
...@@ -96,8 +94,6 @@ static ULONG WINAPI MetaDataDispenser_Release(IMetaDataDispenserEx* iface) ...@@ -96,8 +94,6 @@ static ULONG WINAPI MetaDataDispenser_Release(IMetaDataDispenserEx* iface)
HeapFree(GetProcessHeap(), 0, This); HeapFree(GetProcessHeap(), 0, This);
} }
MSCOREE_UnlockModule();
return ref; return ref;
} }
......
...@@ -325,13 +325,11 @@ static HRESULT WINAPI CLRRuntimeInfo_QueryInterface(ICLRRuntimeInfo* iface, ...@@ -325,13 +325,11 @@ static HRESULT WINAPI CLRRuntimeInfo_QueryInterface(ICLRRuntimeInfo* iface,
static ULONG WINAPI CLRRuntimeInfo_AddRef(ICLRRuntimeInfo* iface) static ULONG WINAPI CLRRuntimeInfo_AddRef(ICLRRuntimeInfo* iface)
{ {
MSCOREE_LockModule();
return 2; return 2;
} }
static ULONG WINAPI CLRRuntimeInfo_Release(ICLRRuntimeInfo* iface) static ULONG WINAPI CLRRuntimeInfo_Release(ICLRRuntimeInfo* iface)
{ {
MSCOREE_UnlockModule();
return 1; return 1;
} }
...@@ -788,8 +786,6 @@ static ULONG WINAPI InstalledRuntimeEnum_AddRef(IEnumUnknown* iface) ...@@ -788,8 +786,6 @@ static ULONG WINAPI InstalledRuntimeEnum_AddRef(IEnumUnknown* iface)
struct InstalledRuntimeEnum *This = (struct InstalledRuntimeEnum*)iface; struct InstalledRuntimeEnum *This = (struct InstalledRuntimeEnum*)iface;
ULONG ref = InterlockedIncrement(&This->ref); ULONG ref = InterlockedIncrement(&This->ref);
MSCOREE_LockModule();
TRACE("(%p) refcount=%u\n", iface, ref); TRACE("(%p) refcount=%u\n", iface, ref);
return ref; return ref;
...@@ -800,8 +796,6 @@ static ULONG WINAPI InstalledRuntimeEnum_Release(IEnumUnknown* iface) ...@@ -800,8 +796,6 @@ static ULONG WINAPI InstalledRuntimeEnum_Release(IEnumUnknown* iface)
struct InstalledRuntimeEnum *This = (struct InstalledRuntimeEnum*)iface; struct InstalledRuntimeEnum *This = (struct InstalledRuntimeEnum*)iface;
ULONG ref = InterlockedDecrement(&This->ref); ULONG ref = InterlockedDecrement(&This->ref);
MSCOREE_UnlockModule();
TRACE("(%p) refcount=%u\n", iface, ref); TRACE("(%p) refcount=%u\n", iface, ref);
if (ref == 0) if (ref == 0)
...@@ -942,13 +936,11 @@ static HRESULT WINAPI CLRMetaHost_QueryInterface(ICLRMetaHost* iface, ...@@ -942,13 +936,11 @@ static HRESULT WINAPI CLRMetaHost_QueryInterface(ICLRMetaHost* iface,
static ULONG WINAPI CLRMetaHost_AddRef(ICLRMetaHost* iface) static ULONG WINAPI CLRMetaHost_AddRef(ICLRMetaHost* iface)
{ {
MSCOREE_LockModule();
return 2; return 2;
} }
static ULONG WINAPI CLRMetaHost_Release(ICLRMetaHost* iface) static ULONG WINAPI CLRMetaHost_Release(ICLRMetaHost* iface)
{ {
MSCOREE_UnlockModule();
return 1; return 1;
} }
......
...@@ -47,8 +47,6 @@ ...@@ -47,8 +47,6 @@
WINE_DEFAULT_DEBUG_CHANNEL( mscoree ); WINE_DEFAULT_DEBUG_CHANNEL( mscoree );
LONG dll_refs = 0;
char *WtoA(LPCWSTR wstr) char *WtoA(LPCWSTR wstr)
{ {
int length; int length;
...@@ -459,10 +457,7 @@ HRESULT WINAPI DllUnregisterServer(void) ...@@ -459,10 +457,7 @@ HRESULT WINAPI DllUnregisterServer(void)
HRESULT WINAPI DllCanUnloadNow(VOID) HRESULT WINAPI DllCanUnloadNow(VOID)
{ {
if (dll_refs)
return S_FALSE; return S_FALSE;
else
return S_OK;
} }
INT WINAPI ND_RU1( const void *ptr, INT offset ) INT WINAPI ND_RU1( const void *ptr, INT offset )
......
...@@ -20,10 +20,6 @@ ...@@ -20,10 +20,6 @@
#ifndef __MSCOREE_PRIVATE__ #ifndef __MSCOREE_PRIVATE__
#define __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 char *WtoA(LPCWSTR wstr);
extern HRESULT CLRMetaHost_CreateInstance(REFIID riid, void **ppobj); extern HRESULT CLRMetaHost_CreateInstance(REFIID riid, void **ppobj);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment