Nikolay Sivov : ole32: Hold a lock when checking is spy is already registered.
Module: wine Branch: master Commit: 7c0b1b62688258c3478b218e62691a44295f57c9 URL: http://source.winehq.org/git/wine.git/?a=commit;h=7c0b1b62688258c3478b218e62... Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Mar 4 11:24:32 2016 +0300 ole32: Hold a lock when checking is spy is already registered. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/ifs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/ole32/ifs.c b/dlls/ole32/ifs.c index 7469fb2..c9e5625 100644 --- a/dlls/ole32/ifs.c +++ b/dlls/ole32/ifs.c @@ -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; }
participants (1)
-
Alexandre Julliard