mirror of
https://github.com/reactos/wine.git
synced 2024-11-25 04:39:45 +00:00
mshtml: Removed the reference counting of the DLL.
This commit is contained in:
parent
22961e6560
commit
fdac425f7f
@ -214,8 +214,6 @@ static ULONG WINAPI HTMLDocument_Release(IHTMLDocument2 *iface)
|
||||
NSContainer_Release(This->nscontainer);
|
||||
|
||||
heap_free(This);
|
||||
|
||||
UNLOCK_MODULE();
|
||||
}
|
||||
|
||||
return ref;
|
||||
@ -1810,8 +1808,6 @@ HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject)
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
||||
LOCK_MODULE();
|
||||
|
||||
doc->nscontainer = NSContainer_Create(doc, NULL);
|
||||
update_nsdocument(doc);
|
||||
|
||||
|
@ -44,7 +44,6 @@
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
||||
|
||||
HINSTANCE hInst;
|
||||
LONG module_ref = 0;
|
||||
DWORD mshtml_tls = 0;
|
||||
|
||||
static HINSTANCE shdoclc = NULL;
|
||||
@ -141,7 +140,6 @@ static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
|
||||
|
||||
if(!ref) {
|
||||
heap_free(This);
|
||||
UNLOCK_MODULE();
|
||||
}
|
||||
|
||||
return ref;
|
||||
@ -158,11 +156,7 @@ static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL dolock)
|
||||
{
|
||||
TRACE("(%p)->(%x)\n", iface, dolock);
|
||||
|
||||
if(dolock)
|
||||
LOCK_MODULE();
|
||||
else
|
||||
UNLOCK_MODULE();
|
||||
|
||||
/* We never unload the DLL. See DllCanUnloadNow(). */
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@ -184,9 +178,7 @@ static HRESULT ClassFactory_Create(REFIID riid, void **ppv, CreateInstanceFunc f
|
||||
ret->fnCreateInstance = fnCreateInstance;
|
||||
|
||||
hres = IClassFactory_QueryInterface((IClassFactory*)ret, riid, ppv);
|
||||
if(SUCCEEDED(hres)) {
|
||||
LOCK_MODULE();
|
||||
}else {
|
||||
if(FAILED(hres)) {
|
||||
heap_free(ret);
|
||||
*ppv = NULL;
|
||||
}
|
||||
@ -230,8 +222,9 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
|
||||
*/
|
||||
HRESULT WINAPI DllCanUnloadNow(void)
|
||||
{
|
||||
TRACE("() ref=%d\n", module_ref);
|
||||
return module_ref ? S_FALSE : S_OK;
|
||||
TRACE("()\n");
|
||||
/* The cost of keeping this DLL in memory is small. */
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -668,10 +668,6 @@ DEFINE_GUID(CLSID_SysimageProtocol, 0x76E67A63, 0x06E9, 0x11D2, 0xA8,0x40, 0x00,
|
||||
|
||||
DEFINE_GUID(CLSID_CMarkup,0x3050f4fb,0x98b5,0x11cf,0xbb,0x82,0x00,0xaa,0x00,0xbd,0xce,0x0b);
|
||||
|
||||
extern LONG module_ref;
|
||||
#define LOCK_MODULE() InterlockedIncrement(&module_ref)
|
||||
#define UNLOCK_MODULE() InterlockedDecrement(&module_ref)
|
||||
|
||||
/* memory allocation functions */
|
||||
|
||||
static inline void * __WINE_ALLOC_SIZE(1) heap_alloc(size_t len)
|
||||
|
@ -77,17 +77,13 @@ static HRESULT WINAPI InternetProtocolInfo_QueryInterface(IInternetProtocolInfo
|
||||
|
||||
static ULONG WINAPI InternetProtocolInfo_AddRef(IInternetProtocolInfo *iface)
|
||||
{
|
||||
ProtocolFactory *This = PROTOCOLINFO_THIS(iface);
|
||||
TRACE("(%p)\n", This);
|
||||
LOCK_MODULE();
|
||||
TRACE("(%p)\n", iface);
|
||||
return 2;
|
||||
}
|
||||
|
||||
static ULONG WINAPI InternetProtocolInfo_Release(IInternetProtocolInfo *iface)
|
||||
{
|
||||
ProtocolFactory *This = PROTOCOLINFO_THIS(iface);
|
||||
TRACE("(%p)\n", This);
|
||||
UNLOCK_MODULE();
|
||||
TRACE("(%p)\n", iface);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -133,15 +129,7 @@ static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
|
||||
|
||||
static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL dolock)
|
||||
{
|
||||
ProtocolFactory *This = CLASSFACTORY_THIS(iface);
|
||||
|
||||
TRACE("(%p)->(%x)\n", This, dolock);
|
||||
|
||||
if(dolock)
|
||||
LOCK_MODULE();
|
||||
else
|
||||
UNLOCK_MODULE();
|
||||
|
||||
TRACE("(%p)->(%x)\n", iface, dolock);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@ -215,7 +203,6 @@ static ULONG WINAPI AboutProtocol_Release(IInternetProtocol *iface)
|
||||
if(!ref) {
|
||||
heap_free(This->data);
|
||||
heap_free(This);
|
||||
UNLOCK_MODULE();
|
||||
}
|
||||
|
||||
return pUnkOuter ? IUnknown_Release(pUnkOuter) : ref;
|
||||
@ -408,9 +395,7 @@ static HRESULT WINAPI AboutProtocolFactory_CreateInstance(IClassFactory *iface,
|
||||
hres = IInternetProtocol_QueryInterface(PROTOCOL(ret), riid, ppv);
|
||||
}
|
||||
|
||||
if(SUCCEEDED(hres))
|
||||
LOCK_MODULE();
|
||||
else
|
||||
if(FAILED(hres))
|
||||
heap_free(ret);
|
||||
|
||||
return hres;
|
||||
@ -583,7 +568,6 @@ static ULONG WINAPI ResProtocol_Release(IInternetProtocol *iface)
|
||||
if(!ref) {
|
||||
heap_free(This->data);
|
||||
heap_free(This);
|
||||
UNLOCK_MODULE();
|
||||
}
|
||||
|
||||
return pUnkOuter ? IUnknown_Release(pUnkOuter) : ref;
|
||||
@ -833,9 +817,7 @@ static HRESULT WINAPI ResProtocolFactory_CreateInstance(IClassFactory *iface, IU
|
||||
hres = IInternetProtocol_QueryInterface(PROTOCOL(ret), riid, ppv);
|
||||
}
|
||||
|
||||
if(SUCCEEDED(hres))
|
||||
LOCK_MODULE();
|
||||
else
|
||||
if(FAILED(hres))
|
||||
heap_free(ret);
|
||||
|
||||
return hres;
|
||||
|
Loading…
Reference in New Issue
Block a user