Added implementation of DllCanUnloadNow.

This commit is contained in:
Jacek Caban 2005-03-17 10:24:42 +00:00 committed by Alexandre Julliard
parent f089de1f4d
commit 3475dcdb93
2 changed files with 24 additions and 2 deletions

View File

@ -1,4 +1,4 @@
1 stub DllCanUnloadNow 1 stdcall -private DllCanUnloadNow() ATL_DllCanUnloadNow
2 stdcall -private DllGetClassObject(ptr ptr ptr) ATL_DllGetClassObject 2 stdcall -private DllGetClassObject(ptr ptr ptr) ATL_DllGetClassObject
3 stdcall -private DllRegisterServer() ATL_DllRegisterServer 3 stdcall -private DllRegisterServer() ATL_DllRegisterServer
4 stdcall -private DllUnregisterServer() ATL_DllUnregisterServer 4 stdcall -private DllUnregisterServer() ATL_DllUnregisterServer

View File

@ -37,6 +37,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(atl); WINE_DEFAULT_DEBUG_CHANNEL(atl);
ULONG dll_count = 0;
/************************************************************** /**************************************************************
* ATLRegistrar implementation * ATLRegistrar implementation
*/ */
@ -478,6 +480,7 @@ static ULONG WINAPI Registrar_Release(IRegistrar *iface)
if(!ref) { if(!ref) {
IRegistrar_ClearReplacements(iface); IRegistrar_ClearReplacements(iface);
HeapFree(GetProcessHeap(), 0, This); HeapFree(GetProcessHeap(), 0, This);
InterlockedDecrement(&dll_count);
} }
return ref; return ref;
} }
@ -618,6 +621,8 @@ static HRESULT Registrar_create(LPUNKNOWN pUnkOuter, REFIID riid, void **ppvObje
ret->rep = NULL; ret->rep = NULL;
*ppvObject = ret; *ppvObject = ret;
InterlockedIncrement(&dll_count);
return S_OK; return S_OK;
} }
@ -639,11 +644,13 @@ static HRESULT WINAPI RegistrarCF_QueryInterface(IClassFactory *iface, REFIID ri
static ULONG WINAPI RegistrarCF_AddRef(IClassFactory *iface) static ULONG WINAPI RegistrarCF_AddRef(IClassFactory *iface)
{ {
InterlockedIncrement(&dll_count);
return 2; return 2;
} }
static ULONG WINAPI RegistrarCF_Release(IClassFactory *iface) static ULONG WINAPI RegistrarCF_Release(IClassFactory *iface)
{ {
InterlockedDecrement(&dll_count);
return 1; return 1;
} }
@ -656,7 +663,13 @@ static HRESULT WINAPI RegistrarCF_CreateInstance(IClassFactory *iface, LPUNKNOWN
static HRESULT WINAPI RegistrarCF_LockServer(IClassFactory *iface, BOOL lock) static HRESULT WINAPI RegistrarCF_LockServer(IClassFactory *iface, BOOL lock)
{ {
FIXME("(%p)->(%x)\n", iface, lock); TRACE("(%p)->(%x)\n", iface, lock);
if(lock)
InterlockedIncrement(&dll_count);
else
InterlockedDecrement(&dll_count);
return S_OK; return S_OK;
} }
@ -732,3 +745,12 @@ HRESULT WINAPI ATL_DllUnregisterServer(void)
TRACE("\n"); TRACE("\n");
return do_register_server(FALSE); return do_register_server(FALSE);
} }
/***********************************************************************
* DllCanUnloadNow (ATL.@)
*/
HRESULT WINAPI ATL_DllCanUnloadNow(void)
{
TRACE("dll_count = %lu\n", dll_count);
return dll_count ? S_FALSE : S_OK;
}