Implement ShowCursor, it is a issue with quake when you moving the mouse, the mousepo...
authorMagnus Olsen <magnus@greatlord.com>
Fri, 30 Dec 2005 22:02:59 +0000 (22:02 +0000)
committerMagnus Olsen <magnus@greatlord.com>
Fri, 30 Dec 2005 22:02:59 +0000 (22:02 +0000)
svn path=/trunk/; revision=20470

reactos/include/win32k/ntuser.h
reactos/lib/user32/include/user32p.h
reactos/lib/user32/windows/cursor.c
reactos/subsys/win32k/ntuser/misc.c

index 49dcdac..a931838 100644 (file)
@@ -379,6 +379,7 @@ NtUserCallNoParam(
 #define ONEPARAM_ROUTINE_MSQSETWAKEMASK       0x27
 #define ONEPARAM_ROUTINE_GETKEYBOARDTYPE      0x28
 #define ONEPARAM_ROUTINE_GETKEYBOARDLAYOUT    0x29
+#define ONEPARAM_ROUTINE_SHOWCURSOR           0x30 
 DWORD
 NTAPI
 NtUserCallOneParam(
index e4d9f03..352764f 100644 (file)
 #define NtUserEnableProcessWindowGhosting(bEnable) \
   NtUserCallOneParam((DWORD)bEnable, ONEPARAM_ROUTINE_ENABLEPROCWNDGHSTING)
 
+#define NtUserShowCursor(bShow) \
+  NtUserCallOneParam((DWORD)bShow, ONEPARAM_ROUTINE_SHOWCURSOR)
+  
+  
+
 /* Internal Thread Data */
 extern HINSTANCE User32Instance;
 
index a8814a2..f4c622c 100644 (file)
@@ -320,13 +320,12 @@ SetSystemCursor(HCURSOR hcur,
 
 
 /*
- * @unimplemented
+ * @implemented
  */
 int STDCALL
 ShowCursor(BOOL bShow)
 {
-  UNIMPLEMENTED;
-  return 0;
+  return NtUserShowCursor(bShow);
 }
 
 HCURSOR
index e2aced2..c2aff4a 100644 (file)
@@ -11,7 +11,8 @@
 
 #include <w32k.h>
 
-#define NDEBUG
+//#define NDEBUG
+#undef NDEBUG
 #include <debug.h>
 
 /* registered Logon process */
@@ -164,6 +165,7 @@ CLEANUP:
    END_CLEANUP;
 }
 
+
 /*
  * @implemented
  */
@@ -176,10 +178,90 @@ NtUserCallOneParam(
    DECLARE_RETURN(DWORD);
 
    DPRINT("Enter NtUserCallOneParam\n");
+
+
+   if (Routine == ONEPARAM_ROUTINE_SHOWCURSOR)
+   {
+      PWINSTATION_OBJECT WinSta = PsGetWin32Thread()->Desktop->WindowStation;
+      PSYSTEM_CURSORINFO CurInfo;
+                 
+      HDC Screen;
+      HBITMAP dcbmp;
+      SURFOBJ *SurfObj;         
+      BITMAPOBJ *BitmapObj;
+      GDIDEVICE *ppdev;
+      GDIPOINTER *pgp;
+                                                                                
+      if(!(Screen = IntGetScreenDC()))
+      {
+        return 1; /* No mouse */
+      }
+                       
+      PDC dc = DC_LockDc(Screen);
+
+      if (!dc)
+      {
+        return 1; /* No mouse */
+      }
+           
+      dcbmp = dc->w.hBitmap;
+      DC_UnlockDc(dc);
+
+      BitmapObj = BITMAPOBJ_LockBitmap(dcbmp);
+      if ( !BitmapObj )
+      {
+         BITMAPOBJ_UnlockBitmap(BitmapObj); 
+         return 1; /* No Mouse */
+      }
+              
+      SurfObj = &BitmapObj->SurfObj;
+      if (SurfObj == NULL)
+      {
+        BITMAPOBJ_UnlockBitmap(BitmapObj); 
+        return 1; /* No mouse */
+      }
+           
+      ppdev = GDIDEV(SurfObj);
+                                                                      
+      if(ppdev == NULL)
+      {
+        BITMAPOBJ_UnlockBitmap(BitmapObj); 
+        return 1; /* No mouse */
+      }
+                  
+      pgp = &ppdev->Pointer;
+      
+      CurInfo = IntGetSysCursorInfo(WinSta);
+           
+      if (Param == FALSE)
+      {
+          if (CurInfo->ShowingCursor != 0)
+          {
+             ppdev->SafetyRemoveCount = 1;
+             ppdev->SafetyRemoveLevel = 1;
+             EngMovePointer(SurfObj,-1,-1,NULL);               
+             CurInfo->ShowingCursor = 0;                
+           }
+           
+       }
+       else
+       {
+          /* Show Cursor */              
+          ppdev->SafetyRemoveCount = 0;
+          ppdev->SafetyRemoveLevel = 0;
+          EngMovePointer(SurfObj,-1,-1,NULL);
+          CurInfo->ShowingCursor = CURSOR_SHOWING;
+       }
+                                                    
+       BITMAPOBJ_UnlockBitmap(BitmapObj); 
+       return 0;                       
+       }
+         
+   
    UserEnterExclusive();
 
    switch(Routine)
-   {
+   {                
       case ONEPARAM_ROUTINE_GETMENU:
          {
             PWINDOW_OBJECT Window;