Do only dereference the desktop window if the handle was valid in IntMouseInput.
Modified: trunk/reactos/subsys/win32k/ntuser/input.c

Modified: trunk/reactos/subsys/win32k/ntuser/input.c
--- trunk/reactos/subsys/win32k/ntuser/input.c	2005-04-02 15:58:25 UTC (rev 14444)
+++ trunk/reactos/subsys/win32k/ntuser/input.c	2005-04-02 16:13:11 UTC (rev 14445)
@@ -611,8 +611,8 @@
         MousePos.x = DesktopWindow->ClientRect.right - 1;
       if(MousePos.y >= DesktopWindow->ClientRect.bottom)
         MousePos.y = DesktopWindow->ClientRect.bottom - 1;
+      ObmDereferenceObject(DesktopWindow);
     }
-    ObmDereferenceObject(DesktopWindow);
 
     if(MousePos.x < 0)
       MousePos.x = 0;