[PATCH 1/2] user32: Call DefWindowProc() in DesktopWndProc().

Józef Kucia jkucia at codeweavers.com
Mon Aug 20 12:20:42 CDT 2018


This fixes a regression introduced by commit
fc14753dc0188a52a05243d5d82c4062b93daaff.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45485
Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---

Tests included in the next patch show that DesktopWndProc() should not
ignore all messages.

Unfortunately, an ugly check is needed to skip processing message while
the graphics driver is being loaded. It is necessary because
WM_NCCALCSIZE initiates loading the graphics driver again.

Also, another way to fix the regression is to call DefWindowProc() in
winex11.desktop_wndproc_wrapper(), but fixing DesktopWndProc() looks
like a more correct solution to me.

---
 dlls/user32/desktop.c      | 6 +++++-
 dlls/user32/driver.c       | 5 +++++
 dlls/user32/user_private.h | 1 +
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/dlls/user32/desktop.c b/dlls/user32/desktop.c
index d22e732fd5b9..68d8ee9116be 100644
--- a/dlls/user32/desktop.c
+++ b/dlls/user32/desktop.c
@@ -32,6 +32,7 @@
 #include "wingdi.h"
 #include "winnls.h"
 #include "controls.h"
+#include "user_private.h"
 #include "wine/unicode.h"
 
 static HBRUSH hbrushPattern;
@@ -128,7 +129,10 @@ LRESULT WINAPI DesktopWndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lP
         return TRUE;
     }
     default:
-        return 0;  /* all other messages are ignored */
+        /* Processing messages may initiate loading a driver recursively. */
+        if (!USER_is_driver_loaded()) return 0;
+
+        return DefWindowProcW( hwnd, message, wParam, lParam );
     }
 }
 
diff --git a/dlls/user32/driver.c b/dlls/user32/driver.c
index 561a126bd666..211c3466a7ee 100644
--- a/dlls/user32/driver.c
+++ b/dlls/user32/driver.c
@@ -190,6 +190,11 @@ void USER_unload_driver(void)
         HeapFree( GetProcessHeap(), 0, prev );
 }
 
+BOOL USER_is_driver_loaded(void)
+{
+    return USER_Driver != &lazy_load_driver;
+}
+
 
 /**********************************************************************
  * Null user driver
diff --git a/dlls/user32/user_private.h b/dlls/user32/user_private.h
index 7a70ae9c433c..4bdfda8d6353 100644
--- a/dlls/user32/user_private.h
+++ b/dlls/user32/user_private.h
@@ -118,6 +118,7 @@ typedef struct tagUSER_DRIVER {
 extern const USER_DRIVER *USER_Driver DECLSPEC_HIDDEN;
 
 extern void USER_unload_driver(void) DECLSPEC_HIDDEN;
+extern BOOL USER_is_driver_loaded(void) DECLSPEC_HIDDEN;
 
 struct received_message_info;
 
-- 
2.16.4




More information about the wine-devel mailing list