Fix one wine test, from 75 to 23 no.
authorJames Tabor <james.tabor@reactos.org>
Wed, 5 Dec 2007 22:30:44 +0000 (22:30 +0000)
committerJames Tabor <james.tabor@reactos.org>
Wed, 5 Dec 2007 22:30:44 +0000 (22:30 +0000)
svn path=/trunk/; revision=31031

reactos/subsystems/win32/win32k/ntuser/windc.c

index d6ffed4..a8f03a5 100644 (file)
@@ -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