Better module locking.
This commit is contained in:
parent
c64432cebe
commit
132bc714fb
|
@ -82,8 +82,6 @@ static ULONG WINAPI SecManagerImpl_AddRef(IInternetSecurityManager* iface)
|
||||||
|
|
||||||
TRACE("(%p)->(ref before=%lu)\n",This, refCount - 1);
|
TRACE("(%p)->(ref before=%lu)\n",This, refCount - 1);
|
||||||
|
|
||||||
URLMON_LockModule();
|
|
||||||
|
|
||||||
return refCount;
|
return refCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,10 +95,9 @@ static ULONG WINAPI SecManagerImpl_Release(IInternetSecurityManager* iface)
|
||||||
/* destroy the object if there's no more reference on it */
|
/* destroy the object if there's no more reference on it */
|
||||||
if (!refCount){
|
if (!refCount){
|
||||||
HeapFree(GetProcessHeap(),0,This);
|
HeapFree(GetProcessHeap(),0,This);
|
||||||
|
URLMON_UnlockModule();
|
||||||
}
|
}
|
||||||
|
|
||||||
URLMON_UnlockModule();
|
|
||||||
|
|
||||||
return refCount;
|
return refCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -201,6 +198,9 @@ HRESULT SecManagerImpl_Construct(IUnknown *pUnkOuter, LPVOID *ppobj)
|
||||||
This->ref = 1;
|
This->ref = 1;
|
||||||
|
|
||||||
*ppobj = This;
|
*ppobj = This;
|
||||||
|
|
||||||
|
URLMON_LockModule();
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -247,8 +247,6 @@ static ULONG WINAPI ZoneMgrImpl_AddRef(IInternetZoneManager* iface)
|
||||||
|
|
||||||
TRACE("(%p)->(ref before=%lu)\n",This, refCount - 1);
|
TRACE("(%p)->(ref before=%lu)\n",This, refCount - 1);
|
||||||
|
|
||||||
URLMON_LockModule();
|
|
||||||
|
|
||||||
return refCount;
|
return refCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -262,10 +260,10 @@ static ULONG WINAPI ZoneMgrImpl_Release(IInternetZoneManager* iface)
|
||||||
|
|
||||||
TRACE("(%p)->(ref before=%lu)\n",This, refCount + 1);
|
TRACE("(%p)->(ref before=%lu)\n",This, refCount + 1);
|
||||||
|
|
||||||
if(!refCount)
|
if(!refCount) {
|
||||||
HeapFree(GetProcessHeap(), 0, This);
|
HeapFree(GetProcessHeap(), 0, This);
|
||||||
|
URLMON_UnlockModule();
|
||||||
URLMON_UnlockModule();
|
}
|
||||||
|
|
||||||
return refCount;
|
return refCount;
|
||||||
}
|
}
|
||||||
|
@ -457,6 +455,8 @@ HRESULT ZoneMgrImpl_Construct(IUnknown *pUnkOuter, LPVOID *ppobj)
|
||||||
ret->ref = 1;
|
ret->ref = 1;
|
||||||
*ppobj = (IInternetZoneManager*)ret;
|
*ppobj = (IInternetZoneManager*)ret;
|
||||||
|
|
||||||
|
URLMON_LockModule();
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -340,8 +340,6 @@ static ULONG WINAPI URLMonikerImpl_AddRef(IMoniker* iface)
|
||||||
|
|
||||||
TRACE("(%p)->(ref before=%lu)\n",This, refCount - 1);
|
TRACE("(%p)->(ref before=%lu)\n",This, refCount - 1);
|
||||||
|
|
||||||
URLMON_LockModule();
|
|
||||||
|
|
||||||
return refCount;
|
return refCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -359,9 +357,9 @@ static ULONG WINAPI URLMonikerImpl_Release(IMoniker* iface)
|
||||||
if (!refCount) {
|
if (!refCount) {
|
||||||
HeapFree(GetProcessHeap(),0,This->URLName);
|
HeapFree(GetProcessHeap(),0,This->URLName);
|
||||||
HeapFree(GetProcessHeap(),0,This);
|
HeapFree(GetProcessHeap(),0,This);
|
||||||
}
|
|
||||||
|
|
||||||
URLMON_UnlockModule();
|
URLMON_UnlockModule();
|
||||||
|
}
|
||||||
|
|
||||||
return refCount;
|
return refCount;
|
||||||
}
|
}
|
||||||
|
@ -1170,6 +1168,8 @@ static HRESULT URLMonikerImpl_Construct(URLMonikerImpl* This, LPCOLESTR lpszLeft
|
||||||
else
|
else
|
||||||
strcpyW(This->URLName,lpszURLName);
|
strcpyW(This->URLName,lpszURLName);
|
||||||
|
|
||||||
|
URLMON_LockModule();
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -125,8 +125,6 @@ CF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
|
||||||
static ULONG WINAPI CF_AddRef(LPCLASSFACTORY iface)
|
static ULONG WINAPI CF_AddRef(LPCLASSFACTORY iface)
|
||||||
{
|
{
|
||||||
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
||||||
URLMON_LockModule();
|
|
||||||
|
|
||||||
return InterlockedIncrement(&This->ref);
|
return InterlockedIncrement(&This->ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,10 +134,10 @@ static ULONG WINAPI CF_Release(LPCLASSFACTORY iface)
|
||||||
|
|
||||||
ULONG ref = InterlockedDecrement(&This->ref);
|
ULONG ref = InterlockedDecrement(&This->ref);
|
||||||
|
|
||||||
if (ref == 0)
|
if (ref == 0) {
|
||||||
HeapFree(GetProcessHeap(), 0, This);
|
HeapFree(GetProcessHeap(), 0, This);
|
||||||
|
URLMON_UnlockModule();
|
||||||
URLMON_UnlockModule();
|
}
|
||||||
|
|
||||||
return ref;
|
return ref;
|
||||||
}
|
}
|
||||||
|
@ -229,10 +227,12 @@ DWORD WINAPI URLMON_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
|
||||||
|
|
||||||
factory->ITF_IClassFactory.lpVtbl = &CF_Vtbl;
|
factory->ITF_IClassFactory.lpVtbl = &CF_Vtbl;
|
||||||
factory->ref = 1;
|
factory->ref = 1;
|
||||||
|
|
||||||
factory->pfnCreateInstance = object_creation[i].pfnCreateInstance;
|
factory->pfnCreateInstance = object_creation[i].pfnCreateInstance;
|
||||||
|
|
||||||
*ppv = &(factory->ITF_IClassFactory);
|
*ppv = &(factory->ITF_IClassFactory);
|
||||||
|
|
||||||
|
URLMON_LockModule();
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue