=?UTF-8?Q?Bernhard=20=C3=9Cbelacker=20?=: user32: Let nulldrv return some dummy monitor information.
Alexandre Julliard
julliard at winehq.org
Sun Mar 3 13:21:28 CST 2019
Module: wine
Branch: oldstable
Commit: 178d9f1cb6f590298d4c66027e04aa159fb105fd
URL: https://source.winehq.org/git/wine.git/?a=commit;h=178d9f1cb6f590298d4c66027e04aa159fb105fd
Author: Bernhard Übelacker <bernhardu at mailbox.org>
Date: Tue Oct 2 16:27:41 2018 +0200
user32: Let nulldrv return some dummy monitor information.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=43187
Signed-off-by: Bernhard Übelacker <bernhardu at mailbox.org>
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit f5bb76f69a96e2b5a5b0953817035a8cbe94153a)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
---
dlls/user32/driver.c | 27 +++++++++++++++++++++++++--
1 file changed, 25 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/driver.c b/dlls/user32/driver.c
index d59a2ea..9201660 100644
--- a/dlls/user32/driver.c
+++ b/dlls/user32/driver.c
@@ -197,6 +197,8 @@ void USER_unload_driver(void)
* These are fallbacks for entry points that are not implemented in the real driver.
*/
+#define NULLDRV_DEFAULT_HMONITOR ((HMONITOR)(UINT_PTR)(0x10000 + 1))
+
static HKL CDECL nulldrv_ActivateKeyboardLayout( HKL layout, UINT flags )
{
return 0;
@@ -354,7 +356,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(NULLDRV_DEFAULT_HMONITOR, hdc, &r, lp);
+ return TRUE;
}
static BOOL CDECL nulldrv_EnumDisplaySettingsEx( LPCWSTR name, DWORD num, LPDEVMODEW mode, DWORD flags )
@@ -364,7 +371,23 @@ 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};
+ static const WCHAR device[] = {'W','i','n','D','i','s','c',0};
+
+ TRACE("(%p, %p)\n", handle, info);
+
+ if (handle != NULLDRV_DEFAULT_HMONITOR)
+ {
+ SetLastError(ERROR_INVALID_MONITOR_HANDLE);
+ return FALSE;
+ }
+
+ 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 )
More information about the wine-cvs
mailing list