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

Gabriel Ivăncescu gabrielopcode at gmail.com
Wed Sep 12 14:42:20 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.

 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 23db919..30190ef 100644
--- a/dlls/shell32/autocomplete.c
+++ b/dlls/shell32/autocomplete.c
@@ -345,8 +345,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