Commit in reactos on MAIN
iface/addsys/w32ksvc.db+5-11.53 -> 1.54
include/win32k/ntuser.h+41-21.138 -> 1.139
lib/user32/misc/display.c+133-101.12 -> 1.13
               /stubs.c+1-431.67 -> 1.68
subsys/win32k/main/dllmain.c+9-11.80 -> 1.81
subsys/win32k/ntuser/stubs.c+1-141.46 -> 1.47
subsys/win32k/objects/dc.c+7-11.146 -> 1.147
subsys/win32k/w32k.h+11.5 -> 1.6
+198-72
8 modified files
Simple implementation of some multi-monitor APIs.

reactos/iface/addsys
w32ksvc.db 1.53 -> 1.54
diff -u -r1.53 -r1.54
--- w32ksvc.db	9 Jul 2004 20:28:19 -0000	1.53
+++ w32ksvc.db	16 Nov 2004 16:27:48 -0000	1.54
@@ -345,7 +345,7 @@
 NtUserEndMenu                           0
 NtUserEndPaint                          2
 NtUserEnumDisplayDevices                4
-NtUserEnumDisplayMonitors               4
+NtUserEnumDisplayMonitors               5
 NtUserEnumDisplaySettings               4
 NtUserEvent                             1
 NtUserExcludeUpdateRgn                  2
@@ -399,6 +399,7 @@
 NtUserGetMenuItemRect                   4
 NtUserGetMessage                        4
 NtUserGetMinMaxInfo                     3
+NtUserGetMonitorInfo                    2
 NtUserGetMouseMovePointsEx              5
 NtUserGetObjectInformation              5
 NtUserGetOpenClipboardWindow            0
@@ -443,6 +444,9 @@
 NtUserMNDragLeave                       0
 NtUserMNDragOver                        2
 NtUserModifyUserStartupInfoFlags        2
+NtUserMonitorFromPoint                  3
+NtUserMonitorFromRect                   2
+NtUserMonitorFromWindow                 2
 NtUserMoveWindow                        6
 NtUserNotifyIMEStatus                   3
 NtUserNotifyWinEvent                    4

reactos/include/win32k
ntuser.h 1.138 -> 1.139
diff -u -r1.138 -r1.139
--- ntuser.h	6 Sep 2004 21:15:45 -0000	1.138
+++ ntuser.h	16 Nov 2004 16:27:48 -0000	1.139
@@ -489,13 +489,27 @@
   PDISPLAY_DEVICE lpDisplayDevice, /* device information */
   DWORD dwFlags ); /* reserved */
 
-BOOL
+/*BOOL
 STDCALL
 NtUserEnumDisplayMonitors (
   HDC hdc,
   LPCRECT lprcClip,
   MONITORENUMPROC lpfnEnum,
-  LPARAM dwData );
+  LPARAM dwData );*/
+
+#define MONITORINFOF_PRIMARY 1
+#define MONITOR_DEFAULTTONULL 0
+#define MONITOR_DEFAULTTOPRIMARY 1
+#define MONITOR_DEFAULTTONEAREST 2
+INT
+STDCALL
+NtUserEnumDisplayMonitors(
+  OPTIONAL IN HDC hDC,
+  OPTIONAL IN LPCRECT pRect,
+  OPTIONAL OUT HMONITOR *hMonitorList,
+  OPTIONAL OUT LPRECT monitorRectList,
+  OPTIONAL IN DWORD listSize );
+
 
 BOOL
 STDCALL
@@ -762,6 +776,12 @@
   UINT wMsgFilterMin,
   UINT wMsgFilterMax);
 
+BOOL
+STDCALL
+NtUserGetMonitorInfo(
+  IN HMONITOR hMonitor,
+  OUT LPMONITORINFO pMonitorInfo);
+
 DWORD
 STDCALL
 NtUserGetMouseMovePointsEx(
@@ -996,6 +1016,25 @@
   DWORD Unknown0,
   DWORD Unknown1);
 
+HMONITOR
+STDCALL
+NtUserMonitorFromPoint(
+  IN POINT point,
+  IN DWORD dwFlags);
+
+HMONITOR
+STDCALL
+NtUserMonitorFromRect(
+  IN LPCRECT pRect,
+  IN DWORD dwFlags);
+
+HMONITOR
+STDCALL
+NtUserMonitorFromWindow(
+  IN HWND hWnd,
+  IN DWORD dwFlags);
+
+
 BOOL
 STDCALL
 NtUserMoveWindow(      

reactos/lib/user32/misc
display.c 1.12 -> 1.13
diff -u -r1.12 -r1.13
--- display.c	15 Aug 2004 21:36:28 -0000	1.12
+++ display.c	16 Nov 2004 16:27:48 -0000	1.13
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: display.c,v 1.12 2004/08/15 21:36:28 chorns Exp $
+/* $Id: display.c,v 1.13 2004/11/16 16:27:48 blight Exp $
  *
  * PROJECT:         ReactOS user32.dll
  * FILE:            lib/user32/misc/dde.c
@@ -110,7 +110,63 @@
   MONITORENUMPROC lpfnEnum,
   LPARAM dwData)
 {
-  return NtUserEnumDisplayMonitors ( hdc, lprcClip, lpfnEnum, dwData );
+  INT iCount, i;
+  HMONITOR *hMonitorList;
+  LPRECT pRectList;
+  HANDLE hHeap;
+
+  /* get list of monitors/rects */
+  iCount = NtUserEnumDisplayMonitors(hdc, lprcClip, NULL, NULL, 0);
+  if (iCount < 0)
+    {
+      /* FIXME: SetLastError() */
+      return FALSE;
+    }
+  if (iCount == 0)
+    {
+      return TRUE;
+    }
+
+  hHeap = GetProcessHeap();
+  hMonitorList = HeapAlloc(hHeap, 0, sizeof (HMONITOR) * iCount);
+  if (hMonitorList == NULL)
+    {
+      SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+      return FALSE;
+    }
+  pRectList = HeapAlloc(hHeap, 0, sizeof (RECT) * iCount);
+  if (pRectList == NULL)
+    {
+      HeapFree(hHeap, 0, hMonitorList);
+      SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+      return FALSE;
+    }
+
+  iCount = NtUserEnumDisplayMonitors(hdc, lprcClip, hMonitorList, pRectList, iCount);
+  if (iCount <= 0)
+    {
+      /* FIXME: SetLastError() */
+      return FALSE;
+    }
+
+  /* enumerate list */
+  for (i = 0; i < iCount; i++)
+    {
+      HMONITOR hMonitor = hMonitorList[i];
+      LPRECT pMonitorRect = pRectList + i;
+      HDC hMonitorDC = NULL;
+
+      if (hdc != NULL)
+        {
+          /* make monitor DC */
+          hMonitorDC = hdc;
+        }
+
+      if (!lpfnEnum(hMonitor, hMonitorDC, pMonitorRect, dwData))
+        break;
+    }
+
+  return TRUE;
 }
 
 
@@ -156,7 +212,7 @@
   DWORD iModeNum,
   LPDEVMODEA lpDevMode)
 {
-	return EnumDisplaySettingsExA ( lpszDeviceName, iModeNum, lpDevMode, 0 );
+  return EnumDisplaySettingsExA ( lpszDeviceName, iModeNum, lpDevMode, 0 );
 }
 
 
@@ -194,12 +250,12 @@
   DWORD iModeNum,
   LPDEVMODEW lpDevMode)
 {
-	return EnumDisplaySettingsExW ( lpszDeviceName, iModeNum, lpDevMode, 0 );
+  return EnumDisplaySettingsExW ( lpszDeviceName, iModeNum, lpDevMode, 0 );
 }
 
 
 /*
- * @unimplemented
+ * @implemented
  */
 BOOL
 STDCALL
@@ -207,13 +263,42 @@
   HMONITOR hMonitor,
   LPMONITORINFO lpmi)
 {
-  UNIMPLEMENTED;
-  return FALSE;
+  if (lpmi->cbSize == sizeof (MONITORINFO))
+    {
+      return NtUserGetMonitorInfo(hMonitor, lpmi);
+    }
+  else if (lpmi->cbSize != sizeof (MONITORINFOEXA))
+    {
+      SetLastError(ERROR_INVALID_PARAMETER);
+      return FALSE;
+    }
+  else
+    {
+      MONITORINFOEXW miExW;
+      INT res;
+
+      miExW.cbSize = sizeof (MONITORINFOEXW);
+      if (!NtUserGetMonitorInfo(hMonitor, (LPMONITORINFO)&miExW))
+        {
+          return FALSE;
+        }
+      memcpy(lpmi, &miExW, sizeof (MONITORINFO));
+      res = WideCharToMultiByte(CP_THREAD_ACP, 0, miExW.szDevice, -1,
+                                ((LPMONITORINFOEXA)lpmi)->szDevice, CCHDEVICENAME,
+                                NULL, NULL);
+      if (res == 0)
+        {
+          DPRINT("WideCharToMultiByte() failed!\n");
+          return FALSE;
+        }
+    }
+
+  return TRUE;
 }
 
 
 /*
- * @unimplemented
+ * @implemented
  */
 BOOL
 STDCALL
@@ -221,8 +306,46 @@
   HMONITOR hMonitor,
   LPMONITORINFO lpmi)
 {
-  UNIMPLEMENTED;
-  return FALSE;
+  return NtUserGetMonitorInfo(hMonitor, lpmi);
+}
+
+
+/*
+ * @implemented
+ */
+HMONITOR
+STDCALL
+MonitorFromPoint(
+	IN POINT ptPoint,
+	IN DWORD dwFlags )
+{
+  return NtUserMonitorFromPoint(ptPoint, dwFlags);
+}
+
+
+/*
+ * @implemented
+ */
+HMONITOR
+STDCALL
+MonitorFromRect(
+	IN LPCRECT lpcRect,
+	IN DWORD dwFlags )
+{
+  return NtUserMonitorFromRect(lpcRect, dwFlags);
+}
+
+
+/*
+ * @implemented
+ */
+HMONITOR
+STDCALL
+MonitorFromWindow(
+	IN HWND hWnd,
+	IN DWORD dwFlags )
+{
+  return NtUserMonitorFromWindow(hWnd, dwFlags);
 }
 
 

reactos/lib/user32/misc
stubs.c 1.67 -> 1.68
diff -u -r1.67 -r1.68
--- stubs.c	12 Sep 2004 19:47:49 -0000	1.67
+++ stubs.c	16 Nov 2004 16:27:48 -0000	1.68
@@ -1,4 +1,4 @@
-/* $Id: stubs.c,v 1.67 2004/09/12 19:47:49 weiden Exp $
+/* $Id: stubs.c,v 1.68 2004/11/16 16:27:48 blight Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS user32.dll
@@ -112,48 +112,6 @@
 /*
  * @unimplemented
  */
-HMONITOR
-STDCALL
-MonitorFromPoint(
-  POINT pt,
-  DWORD dwFlags)
-{
-  UNIMPLEMENTED;
-  return (HMONITOR)0;
-}
-
-
-/*
- * @unimplemented
- */
-HMONITOR
-STDCALL
-MonitorFromRect(
-  LPRECT lprc,
-  DWORD dwFlags)
-{
-  UNIMPLEMENTED;
-  return (HMONITOR)0;
-}
-
-
-/*
- * @unimplemented
- */
-HMONITOR
-STDCALL
-MonitorFromWindow(
-  HWND hwnd,
-  DWORD dwFlags)
-{
-  UNIMPLEMENTED;
-  return (HMONITOR)0;
-}
-
-
-/*
- * @unimplemented
- */
 DWORD
 STDCALL
 MsgWaitForMultipleObjects(

reactos/subsys/win32k/main
dllmain.c 1.80 -> 1.81
diff -u -r1.80 -r1.81
--- dllmain.c	28 Sep 2004 15:02:30 -0000	1.80
+++ dllmain.c	16 Nov 2004 16:27:48 -0000	1.81
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: dllmain.c,v 1.80 2004/09/28 15:02:30 weiden Exp $
+/* $Id: dllmain.c,v 1.81 2004/11/16 16:27:48 blight Exp $
  *
  *  Entry Point for win32k.sys
  */
@@ -104,6 +104,7 @@
 	  IntRemoveProcessWndProcHandles((HANDLE)Process->UniqueProcessId);
       IntCleanupMenus(Process, Win32Process);
       IntCleanupCurIcons(Process, Win32Process);
+      CleanupMonitorImpl();
 
       CleanupForProcess(Process, Process->UniqueProcessId);
 
@@ -277,6 +278,13 @@
       return(Status);
     }
 
+  Status = InitMonitorImpl();
+  if (!NT_SUCCESS(Status))
+    {
+      DbgPrint("Failed to initialize monitor implementation!\n");
+      return STATUS_UNSUCCESSFUL;
+    }
+
   Status = MsqInitializeImpl();
   if (!NT_SUCCESS(Status))
     {

reactos/subsys/win32k/ntuser
stubs.c 1.46 -> 1.47
diff -u -r1.46 -r1.47
--- stubs.c	3 Aug 2004 19:55:57 -0000	1.46
+++ stubs.c	16 Nov 2004 16:27:49 -0000	1.47
@@ -1,4 +1,4 @@
-/* $Id: stubs.c,v 1.46 2004/08/03 19:55:57 blight Exp $
+/* $Id: stubs.c,v 1.47 2004/11/16 16:27:49 blight Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -246,19 +246,6 @@
   return 0;
 }
 
-BOOL
-STDCALL
-NtUserEnumDisplayMonitors(
-  HDC hdc,
-  LPCRECT lprcClip,
-  MONITORENUMPROC lpfnEnum,
-  LPARAM dwData)
-{
-  UNIMPLEMENTED
-
-  return 0;
-}
-
 DWORD
 STDCALL
 NtUserEvent(

reactos/subsys/win32k/objects
dc.c 1.146 -> 1.147
diff -u -r1.146 -r1.147
--- dc.c	3 Aug 2004 19:55:58 -0000	1.146
+++ dc.c	16 Nov 2004 16:27:49 -0000	1.147
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: dc.c,v 1.146 2004/08/03 19:55:58 blight Exp $
+/* $Id: dc.c,v 1.147 2004/11/16 16:27:49 blight Exp $
  *
  * DC.C - Device context functions
  *
@@ -648,6 +648,9 @@
          continue;
       }
 
+      /* attach monitor */
+      IntAttachMonitor(&PrimarySurface, DisplayNumber);
+
       SurfObj = EngLockSurface((HSURF)PrimarySurface.Handle);
       SurfObj->dhpdev = PrimarySurface.PDev;
       SurfSize = SurfObj->sizlBitmap;
@@ -664,6 +667,9 @@
   {
     DRIVER_UnreferenceDriver(L"DISPLAY");
 
+    /* detach monitor */
+    IntDetachMonitor(&PrimarySurface);
+
     /*
      * FIXME: Hide a mouse pointer there. Also because we have to prevent
      * memory leaks with the Eng* mouse routines.

reactos/subsys/win32k
w32k.h 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- w32k.h	28 Sep 2004 15:02:31 -0000	1.5
+++ w32k.h	16 Nov 2004 16:27:49 -0000	1.6
@@ -50,6 +50,7 @@
 #include <include/inteng.h>
 #include <include/intgdi.h>
 #include <include/menu.h>
+#include <include/monitor.h>
 #include <include/mouse.h>
 #include <include/msgqueue.h>
 #include <include/object.h>
CVSspam 0.2.8