[PATCH v7 6/7] shell32/autocomplete: Remove the property after replacing the callback instead of before

Gabriel Ivăncescu gabrielopcode at gmail.com
Mon Sep 17 14:23:14 CDT 2018


Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
---

Avoids a race condition in extremely rare situations (i.e. if another thread
calls the window procedure while the property is removed, it will crash). It
should never happen since it should be tied to 1 thread, but there's no
harm to it anyway and it feels better to me. (other patches don't depend
on this one so it doesn't matter anyway if you feel it's pointless)

 dlls/shell32/autocomplete.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/shell32/autocomplete.c b/dlls/shell32/autocomplete.c
index 8513b0a..dc9e5c7 100644
--- a/dlls/shell32/autocomplete.c
+++ b/dlls/shell32/autocomplete.c
@@ -368,8 +368,8 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam,
         {
             WNDPROC proc = This->wpOrigEditProc;
 
-            RemovePropW(hwnd, autocomplete_propertyW);
             SetWindowLongPtrW(hwnd, GWLP_WNDPROC, (LONG_PTR)proc);
+            RemovePropW(hwnd, autocomplete_propertyW);
             destroy_autocomplete_object(This);
             return CallWindowProcW(proc, hwnd, uMsg, wParam, lParam);
         }
-- 
1.9.1




More information about the wine-devel mailing list