Sync with trunk head (r49139)
[reactos.git] / subsystems / win32 / win32k / ntuser / monitor.c
index e080e92..2f587bf 100644 (file)
@@ -492,7 +492,6 @@ NtUserEnumDisplayMonitors(
    if (hDC != NULL)
    {
       PDC dc;
-      HRGN dcVisRgn;
       INT regionType;
 
       /* get visible region bounding rect */
@@ -503,10 +502,9 @@ NtUserEnumDisplayMonitors(
          /* FIXME: setlasterror? */
          return -1;
       }
-      dcVisRgn = dc->prgnVis->BaseObject.hHmgr;
+      regionType = REGION_GetRgnBox(dc->prgnVis, &dcRect);
       DC_UnlockDc(dc);
 
-      regionType = NtGdiGetRgnBox(dcVisRgn, &dcRect);
       if (regionType == 0)
       {
          DPRINT("NtGdiGetRgnBox() failed!\n");
@@ -887,7 +885,7 @@ NtUserMonitorFromWindow(
    IN HWND hWnd,
    IN DWORD dwFlags)
 {
-   PWINDOW_OBJECT Window;
+   PWND Window;
    HMONITOR hMonitor = NULL;
    RECTL Rect;
    DECLARE_RETURN(HMONITOR);
@@ -905,11 +903,8 @@ NtUserMonitorFromWindow(
       RETURN(hMonitor);
    }
 
-   if (!Window->Wnd)
-      RETURN(hMonitor);
-
-   Rect.left = Rect.right = Window->Wnd->rcWindow.left;
-   Rect.top = Rect.bottom = Window->Wnd->rcWindow.bottom;
+   Rect.left = Rect.right = Window->rcWindow.left;
+   Rect.top = Rect.bottom = Window->rcWindow.bottom;
 
    IntGetMonitorsFromRect(&Rect, &hMonitor, NULL, 1, dwFlags);