From 291c2b99ef67b7884e4d1aebd458d7e459a9b0da Mon Sep 17 00:00:00 2001 From: James Tabor Date: Wed, 5 Dec 2007 22:30:44 +0000 Subject: [PATCH] Fix one wine test, from 75 to 23 no. svn path=/trunk/; revision=31031 --- reactos/subsystems/win32/win32k/ntuser/windc.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/reactos/subsystems/win32/win32k/ntuser/windc.c b/reactos/subsystems/win32/win32k/ntuser/windc.c index d6ffed42e0d..a8f03a5de01 100644 --- a/reactos/subsystems/win32/win32k/ntuser/windc.c +++ b/reactos/subsystems/win32/win32k/ntuser/windc.c @@ -108,7 +108,17 @@ UserGetWindowDC(PWINDOW_OBJECT Wnd) HDC STDCALL NtUserGetDC(HWND hWnd) { - return NtUserGetDCEx(hWnd, NULL, NULL == hWnd ? DCX_CACHE | DCX_WINDOW : DCX_USESTYLE); + if (!hWnd) + { // MSDN: + //"hWnd [in] Handle to the window whose DC is to be retrieved. + // If this value is NULL, GetDC retrieves the DC for the entire screen." + hWnd = IntGetDesktopWindow(); + if (hWnd) + return NtUserGetDCEx(hWnd, NULL, DCX_CACHE | DCX_WINDOW); + else + return NULL; + } + return NtUserGetDCEx(hWnd, NULL, DCX_USESTYLE); } PDCE FASTCALL