update for HEAD-2003091401
[reactos.git] / drivers / input / psaux / mouse.c
index 76b4935..72daea3 100644 (file)
@@ -69,6 +69,9 @@ ps2_mouse_handler(PKINTERRUPT Interrupt, PVOID ServiceContext)
     DeviceExtension = (PDEVICE_EXTENSION)DeviceObject->DeviceExtension;
     Queue = DeviceExtension->ActiveQueue % 2;
 
+    /* Reset the buffer state. */
+    mouse_buffer_position = 0;
+
     /* Prevent buffer overflow */
     if (DeviceExtension->InputDataCount[Queue] == MOUSE_BUFFER_SIZE)
     {
@@ -76,9 +79,7 @@ ps2_mouse_handler(PKINTERRUPT Interrupt, PVOID ServiceContext)
     }
 
     Input = &DeviceExtension->MouseInputData[Queue]
-            [DeviceExtension->InputDataCount[Queue]];
-
-    mouse_buffer_position = 0;
+            [DeviceExtension->InputDataCount[Queue]];    
 
     /* Determine the current state of the buttons */
     Input->RawButtons = (mouse_buffer[0] & 1) /* * GPM_B_LEFT */ +
@@ -193,7 +194,7 @@ BOOLEAN detect_ps2_port(void)
 
   Millisecond_Timeout.QuadPart = 1;
 
-  return TRUE; // The rest of this code fails under BOCHs
+  //return TRUE; // The rest of this code fails under BOCHs
 
   /* Put the value 0x5A in the output buffer using the "WriteAuxiliary Device Output Buffer" command (0xD3).
      Poll the Status Register for a while to see if the value really turns up in the Data Register. If the