Commit in reactos on MAIN
include/win32k/ntuser.h+1-11.129 -> 1.130
lib/user32/include/user32.h+3-61.22 -> 1.23
lib/user32/windows/cursor.c+13-51.20 -> 1.21
subsys/win32k/ntuser/misc.c+31-551.64 -> 1.65
+48-67
4 modified files
changed SetCursorPos() to use SendInput()

reactos/include/win32k
ntuser.h 1.129 -> 1.130
diff -u -r1.129 -r1.130
--- ntuser.h	29 Apr 2004 21:13:15 -0000	1.129
+++ ntuser.h	1 May 2004 09:31:58 -0000	1.130
@@ -177,6 +177,7 @@
 #define ONEPARAM_ROUTINE_ENUMCLIPBOARDFORMATS 0x09
 #define ONEPARAM_ROUTINE_GETWINDOWINSTANCE    0x10
 #define ONEPARAM_ROUTINE_SETMESSAGEEXTRAINFO  0x0a
+#define ONEPARAM_ROUTINE_GETCURSORPOSITION    0x0b
 DWORD
 STDCALL
 NtUserCallOneParam(
@@ -203,7 +204,6 @@
 #define TWOPARAM_ROUTINE_SWITCHTOTHISWINDOW 0x56
 #define TWOPARAM_ROUTINE_VALIDATERGN        0x57
 #define TWOPARAM_ROUTINE_SETWNDCONTEXTHLPID 0x58
-#define TWOPARAM_ROUTINE_CURSORPOSITION     0x59
 #define TWOPARAM_ROUTINE_SETCARETPOS        0x60
 #define TWOPARAM_ROUTINE_GETWINDOWINFO      0x61
 DWORD

reactos/lib/user32/include
user32.h 1.22 -> 1.23
diff -u -r1.22 -r1.23
--- user32.h	9 Apr 2004 20:03:14 -0000	1.22
+++ user32.h	1 May 2004 09:31:58 -0000	1.23
@@ -40,12 +40,6 @@
 #define NtUserSetCaretPos(X, Y) \
   (BOOL)NtUserCallTwoParam((DWORD)X, (DWORD)Y, TWOPARAM_ROUTINE_SETCARETPOS)
 
-#define NtUserGetCursorPos(lpPoint) \
-  (BOOL)NtUserCallTwoParam((DWORD)lpPoint, (DWORD)FALSE, TWOPARAM_ROUTINE_CURSORPOSITION)
-
-#define NtUserSetCursorPos(lpPoint) \
-  (BOOL)NtUserCallTwoParam((DWORD)lpPoint, (DWORD)TRUE, TWOPARAM_ROUTINE_CURSORPOSITION)
-
 #define NtUserSetGUIThreadHandle(field, hwnd) \
   (BOOL)NtUserCallTwoParam((DWORD)field, (DWORD)hwnd, TWOPARAM_ROUTINE_SETGUITHRDHANDLE)
 
@@ -88,6 +82,9 @@
 #define NtUserGetWindowInstance(hwnd) \
   (HINSTANCE)NtUserCallOneParam((DWORD)hwnd, ONEPARAM_ROUTINE_GETWINDOWINSTANCE)
 
+#define NtUserGetCursorPos(lpPoint) \
+  (BOOL)NtUserCallOneParam((DWORD)lpPoint, ONEPARAM_ROUTINE_GETCURSORPOSITION)
+
 LONG WINAPI RegCloseKey(HKEY);
 LONG WINAPI RegOpenKeyExW(HKEY,LPCWSTR,DWORD,REGSAM,PHKEY);
 LONG WINAPI RegQueryValueExW(HKEY,LPCWSTR,LPDWORD,LPDWORD,LPBYTE,LPDWORD);

reactos/lib/user32/windows
cursor.c 1.20 -> 1.21
diff -u -r1.20 -r1.21
--- cursor.c	9 Apr 2004 20:03:14 -0000	1.20
+++ cursor.c	1 May 2004 09:31:59 -0000	1.21
@@ -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: cursor.c,v 1.20 2004/04/09 20:03:14 navaraf Exp $
+/* $Id: cursor.c,v 1.21 2004/05/01 09:31:59 weiden Exp $
  *
  * PROJECT:         ReactOS user32.dll
  * FILE:            lib/user32/windows/cursor.c
@@ -260,10 +260,18 @@
 SetCursorPos(int X,
 	     int Y)
 {
-  POINT pos;
-  pos.x = (LONG)X;
-  pos.y = (LONG)Y;
-  return NtUserSetCursorPos(&pos);
+  INPUT Input;
+  
+  Input.type = INPUT_MOUSE;
+  Input.mi.dx = (LONG)X;
+  Input.mi.dy = (LONG)Y;
+  Input.mi.mouseData = 0;
+  Input.mi.dwFlags = MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE;
+  Input.mi.time = 0;
+  Input.mi.dwExtraInfo = 0;
+  
+  NtUserSendInput(1, &Input, sizeof(INPUT));
+  return TRUE;
 }
 
 

reactos/subsys/win32k/ntuser
misc.c 1.64 -> 1.65
diff -u -r1.64 -r1.65
--- misc.c	30 Apr 2004 22:18:00 -0000	1.64
+++ misc.c	1 May 2004 09:31:59 -0000	1.65
@@ -1,4 +1,4 @@
-/* $Id: misc.c,v 1.64 2004/04/30 22:18:00 weiden Exp $
+/* $Id: misc.c,v 1.65 2004/05/01 09:31:59 weiden Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -185,6 +185,36 @@
     
     case ONEPARAM_ROUTINE_SETMESSAGEEXTRAINFO:
       return (DWORD)MsqSetMessageExtraInfo((LPARAM)Param);
+    
+    case ONEPARAM_ROUTINE_GETCURSORPOSITION:
+    {
+      POINT Pos;
+      
+      if(!Param)
+        return (DWORD)FALSE;
+      Status = IntValidateWindowStationHandle(PROCESS_WINDOW_STATION(),
+                                              KernelMode,
+                                              0,
+                                              &WinStaObject);
+      if (!NT_SUCCESS(Status))
+        return (DWORD)FALSE;
+      
+      /* FIXME - check if process has WINSTA_READATTRIBUTES */
+      Pos.x = WinStaObject->SystemCursor.x;
+      Pos.y = WinStaObject->SystemCursor.y;
+      
+      Status = MmCopyToCaller((PPOINT)Param, &Pos, sizeof(POINT));
+      if(!NT_SUCCESS(Status))
+      {
+        ObDereferenceObject(WinStaObject);
+        SetLastNtError(Status);
+        return FALSE;
+      }
+      
+      ObDereferenceObject(WinStaObject);
+      
+      return (DWORD)TRUE;
+    }
   }
   DPRINT1("Calling invalid routine number 0x%x in NtUserCallOneParam()\n Param=0x%x\n", 
           Routine, Param);
@@ -205,8 +235,6 @@
 {
   NTSTATUS Status;
   PWINDOW_OBJECT WindowObject;
-  PWINSTATION_OBJECT WinStaObject;
-  POINT Pos;
   
   switch(Routine)
   {
@@ -315,58 +343,6 @@
       
       IntReleaseWindowObject(WindowObject);
       return (DWORD)TRUE;
-      
-    case TWOPARAM_ROUTINE_CURSORPOSITION:
-      if(!Param1)
-        return (DWORD)FALSE;
-      Status = IntValidateWindowStationHandle(PROCESS_WINDOW_STATION(),
-                                              KernelMode,
-                                              0,
-                                              &WinStaObject);
-      if (!NT_SUCCESS(Status))
-        return (DWORD)FALSE;
-      
-      if(Param2)
-      {
-        /* set cursor position */
-        MOUSEINPUT mi;
-        
-        Status = MmCopyFromCaller(&Pos, (PPOINT)Param1, sizeof(POINT));
-        if(!NT_SUCCESS(Status))
-        {
-          ObDereferenceObject(WinStaObject);
-          SetLastNtError(Status);
-          return FALSE;
-        }
-        
-        mi.dx = Pos.x;
-        mi.dy = Pos.y;
-        mi.mouseData = 0;
-        mi.dwFlags = MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE;
-        mi.time = 0;
-        mi.dwExtraInfo = 0;
-        IntMouseInput(&mi);
-      }
-      else
-      {
-        /* get cursor position */
-        /* FIXME - check if process has WINSTA_READATTRIBUTES */
-        Pos.x = WinStaObject->SystemCursor.x;
-        Pos.y = WinStaObject->SystemCursor.y;
-        
-        Status = MmCopyToCaller((PPOINT)Param1, &Pos, sizeof(POINT));
-        if(!NT_SUCCESS(Status))
-        {
-          ObDereferenceObject(WinStaObject);
-          SetLastNtError(Status);
-          return FALSE;
-        }
-        
-      }
-      
-      ObDereferenceObject(WinStaObject);
-      
-      return (DWORD)TRUE;
     
     case TWOPARAM_ROUTINE_SETCARETPOS:
       return (DWORD)IntSetCaretPos((int)Param1, (int)Param2);
CVSspam 0.2.8