Commit 7c0b1b62 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

ole32: Hold a lock when checking is spy is already registered.

parent cef4c7dc
......@@ -467,11 +467,12 @@ HRESULT WINAPI CoRegisterMallocSpy(LPMALLOCSPY pMallocSpy)
TRACE("%p\n", pMallocSpy);
if(!pMallocSpy) return E_INVALIDARG;
if(Malloc32.pSpy) return CO_E_OBJISREG;
EnterCriticalSection(&IMalloc32_SpyCS);
if (SUCCEEDED(IMallocSpy_QueryInterface(pMallocSpy, &IID_IMallocSpy, (void**)&pSpy))) {
if (Malloc32.pSpy)
hres = CO_E_OBJISREG;
else if (SUCCEEDED(IMallocSpy_QueryInterface(pMallocSpy, &IID_IMallocSpy, (void**)&pSpy))) {
Malloc32.pSpy = pSpy;
hres = S_OK;
}
......
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