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

Gabriel Ivăncescu gabrielopcode at gmail.com
Fri Sep 14 06:00:35 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 547267d..188dfb2 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