[PATCH v2 1/2] user32: Let nulldrv return some dummy monitor information.

Bernhard Übelacker bernhardu at mailbox.org
Fri Sep 28 16:08:01 CDT 2018


Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=43187

Signed-off-by: Bernhard Übelacker <bernhardu at mailbox.org>
---
Supersedes patch 151898.

v2: No changes to v1.
---
 dlls/user32/driver.c | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/dlls/user32/driver.c b/dlls/user32/driver.c
index 561a126bd6..03296d518c 100644
--- a/dlls/user32/driver.c
+++ b/dlls/user32/driver.c
@@ -354,7 +354,12 @@ static LONG CDECL nulldrv_ChangeDisplaySettingsEx( LPCWSTR name, LPDEVMODEW mode
 
 static BOOL CDECL nulldrv_EnumDisplayMonitors( HDC hdc, LPRECT rect, MONITORENUMPROC proc, LPARAM lp )
 {
-    return FALSE;
+    RECT r = {0, 0, 640, 480};
+
+    TRACE("(%p, %p, %p, 0x%lx)\n", hdc, rect, proc, lp);
+
+    proc(NULL, hdc, &r, lp);
+    return TRUE;
 }
 
 static BOOL CDECL nulldrv_EnumDisplaySettingsEx( LPCWSTR name, DWORD num, LPDEVMODEW mode, DWORD flags )
@@ -364,7 +369,17 @@ static BOOL CDECL nulldrv_EnumDisplaySettingsEx( LPCWSTR name, DWORD num, LPDEVM
 
 static BOOL CDECL nulldrv_GetMonitorInfo( HMONITOR handle, LPMONITORINFO info )
 {
-    return FALSE;
+    RECT r = {0, 0, 640, 480};
+    const WCHAR device[] = {'W','i','n','D','i','s','c',0};
+
+    TRACE("(%p, %p)\n", handle, info);
+
+    info->rcMonitor = r;
+    info->rcWork = r;
+    info->dwFlags = MONITORINFOF_PRIMARY;
+    if (info->cbSize >= sizeof(MONITORINFOEXW))
+        lstrcpyW( ((MONITORINFOEXW *)info)->szDevice, device );
+    return TRUE;
 }
 
 static BOOL CDECL nulldrv_CreateDesktopWindow( HWND hwnd )
-- 
2.19.0




More information about the wine-devel mailing list