Fix compilation with -O3 and fix bugs 484 and 505. win32k patches by Tinus.
Modified: trunk/reactos/hal/hal/hal.c
Modified: trunk/reactos/hal/halx86/generic/timer.c
Modified: trunk/reactos/ntoskrnl/cc/cacheman.c
Modified: trunk/reactos/ntoskrnl/ex/time.c
Modified: trunk/reactos/subsys/win32k/eng/mouse.c
Modified: trunk/reactos/subsys/win32k/ntuser/winsta.c
Modified: trunk/reactos/subsys/win32k/objects/dc.c

Modified: trunk/reactos/hal/hal/hal.c
--- trunk/reactos/hal/hal/hal.c	2005-02-16 16:45:51 UTC (rev 13597)
+++ trunk/reactos/hal/hal/hal.c	2005-02-16 16:52:51 UTC (rev 13598)
@@ -384,6 +384,8 @@
   PADAPTER_OBJECT AdapterObject)
 {
   UNIMPLEMENTED;
+  
+  return 0;
 }
 
 
@@ -682,6 +684,8 @@
 KdPortDisableInterrupts()
 {
   UNIMPLEMENTED;
+
+  return FALSE;
 }
 
 
@@ -690,6 +694,8 @@
 KdPortEnableInterrupts()
 {
   UNIMPLEMENTED;
+
+  return FALSE;
 }
 
 
@@ -709,6 +715,8 @@
   PKSPIN_LOCK SpinLock)
 {
   UNIMPLEMENTED;
+
+  return 0;
 }
 
 

Modified: trunk/reactos/hal/halx86/generic/timer.c
--- trunk/reactos/hal/halx86/generic/timer.c	2005-02-16 16:45:51 UTC (rev 13597)
+++ trunk/reactos/hal/halx86/generic/timer.c	2005-02-16 16:52:51 UTC (rev 13598)
@@ -99,7 +99,7 @@
  * For supported compilers we use inline assembler. For the others,
  * portable plain C.
  */
-VOID STDCALL
+VOID STDCALL __attribute__((noinline))
 __KeStallExecutionProcessor(ULONG Loops)
 {
   if (!Loops)

Modified: trunk/reactos/ntoskrnl/cc/cacheman.c
--- trunk/reactos/ntoskrnl/cc/cacheman.c	2005-02-16 16:45:51 UTC (rev 13597)
+++ trunk/reactos/ntoskrnl/cc/cacheman.c	2005-02-16 16:52:51 UTC (rev 13598)
@@ -1,4 +1,4 @@
-/* $Id:$
+/* $Id$
  * 
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
@@ -49,6 +49,8 @@
     )
 {
 	UNIMPLEMENTED;
+
+    return 0;
 }
 
 /*

Modified: trunk/reactos/ntoskrnl/ex/time.c
--- trunk/reactos/ntoskrnl/ex/time.c	2005-02-16 16:45:51 UTC (rev 13597)
+++ trunk/reactos/ntoskrnl/ex/time.c	2005-02-16 16:52:51 UTC (rev 13598)
@@ -290,6 +290,8 @@
     )
 {
 	UNIMPLEMENTED;
+
+    return 0;
 }
 
 

Modified: trunk/reactos/subsys/win32k/eng/mouse.c
--- trunk/reactos/subsys/win32k/eng/mouse.c	2005-02-16 16:45:51 UTC (rev 13597)
+++ trunk/reactos/subsys/win32k/eng/mouse.c	2005-02-16 16:52:51 UTC (rev 13598)
@@ -243,7 +243,7 @@
       RECTL DestRect;
       POINTL SrcPoint;
       SURFOBJ *ColorSurf;
-      SURFOBJ *MaskSurf;
+      SURFOBJ *MaskSurf = NULL;
 
       DestRect.left = max(pt.x, 0);
       DestRect.top = max(pt.y, 0);
@@ -257,7 +257,9 @@
       SrcPoint.x = max(-pt.x, 0);
       SrcPoint.y = max(-pt.y, 0);
 
-      MaskSurf = EngLockSurface(pgp->MaskSurface);
+      if (pgp->MaskSurface)
+        MaskSurf = EngLockSurface(pgp->MaskSurface);
+
       if (MaskSurf != NULL)
       {
         if (pgp->ColorSurface != NULL)

Modified: trunk/reactos/subsys/win32k/ntuser/winsta.c
--- trunk/reactos/subsys/win32k/ntuser/winsta.c	2005-02-16 16:45:51 UTC (rev 13597)
+++ trunk/reactos/subsys/win32k/ntuser/winsta.c	2005-02-16 16:52:51 UTC (rev 13598)
@@ -199,6 +199,9 @@
   
   NtUserAcquireOrReleaseInputOwnership(FALSE);
 
+  /* Setup the cursor */
+  IntLoadDefaultCursors();
+
   return TRUE;
 }
 

Modified: trunk/reactos/subsys/win32k/objects/dc.c
--- trunk/reactos/subsys/win32k/objects/dc.c	2005-02-16 16:45:51 UTC (rev 13597)
+++ trunk/reactos/subsys/win32k/objects/dc.c	2005-02-16 16:52:51 UTC (rev 13598)
@@ -664,6 +664,11 @@
       SurfaceRect.bottom = SurfObj->sizlBitmap.cy;
       /* FIXME - why does EngEraseSurface() sometimes crash?
         EngEraseSurface(SurfObj, &SurfaceRect, 0); */
+
+      /* Put the pointer in the center of the screen */
+      GDIDEV(SurfObj)->Pointer.Pos.x = (SurfaceRect.right - SurfaceRect.left) / 2;
+      GDIDEV(SurfObj)->Pointer.Pos.y = (SurfaceRect.bottom - SurfaceRect.top) / 2;
+
       EngUnlockSurface(SurfObj);
       IntShowDesktop(IntGetActiveDesktop(), SurfSize.cx, SurfSize.cy);
       break;