ole32: Hold a lock when checking is spy is already registered.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
cef4c7dc69
commit
7c0b1b6268
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue