[NTVDM]: Zero-fill memory with RtlZeroMemory (that exists also in NT mode), and use...
[reactos.git] / reactos / subsystems / ntvdm / dos / mouse32.c
index 62ab8fa..acf3f83 100644 (file)
@@ -11,7 +11,8 @@
 #define NDEBUG
 
 #include "emulator.h"
-#include "callback.h"
+#include "cpu/cpu.h"
+#include "int32.h"
 
 #include "mouse32.h"
 #include "bios/bios.h"
@@ -108,8 +109,10 @@ static VOID CallMouseUserHandlers(USHORT CallMask)
         setSI(DriverState.MickeysPerCellHoriz);
         setDI(DriverState.MickeysPerCellVert);
 
-        DPRINT1("Calling Handler0 0x%08x with CallMask 0x%04x\n",
-                DriverState.Handler0.Callback, CallMask);
+        DPRINT1("Calling Handler0 %04X:%04X with CallMask 0x%04X\n",
+                HIWORD(DriverState.Handler0.Callback),
+                LOWORD(DriverState.Handler0.Callback),
+                CallMask);
 
         /* Call the callback */
         RunCallback16(&DosContext, DriverState.Handler0.Callback);
@@ -148,8 +151,11 @@ static VOID CallMouseUserHandlers(USHORT CallMask)
             setSI(DriverState.MickeysPerCellHoriz);
             setDI(DriverState.MickeysPerCellVert);
 
-            DPRINT1("Calling Handler[%d] 0x%08x with CallMask 0x%04x\n",
-                    i, DriverState.Handlers[i].Callback, CallMask);
+            DPRINT1("Calling Handler[%d] %04X:%04X with CallMask 0x%04X\n",
+                    i,
+                    HIWORD(DriverState.Handlers[i].Callback),
+                    LOWORD(DriverState.Handlers[i].Callback),
+                    CallMask);
 
             /* Call the callback */
             RunCallback16(&DosContext, DriverState.Handlers[i].Callback);
@@ -353,7 +359,7 @@ static VOID WINAPI BiosMouseService(LPWORD Stack)
             }
             else
             {
-                DPRINT1("Invalid BX value 0x%04x\n", BX);
+                DPRINT1("Invalid BX value 0x%04X\n", BX);
             }
 
             break;
@@ -376,8 +382,10 @@ static VOID WINAPI BiosMouseService(LPWORD Stack)
         {
             DriverState.Handler0.CallMask = getCX();
             DriverState.Handler0.Callback = MAKELONG(getDX(), getES()); // Far pointer to the callback
-            DPRINT1("Define callback 0x%04x, 0x%08x\n",
-                    DriverState.Handler0.CallMask, DriverState.Handler0.Callback);
+            DPRINT1("Define callback 0x%04X, %04X:%04X\n",
+                    DriverState.Handler0.CallMask,
+                    HIWORD(DriverState.Handler0.Callback),
+                    LOWORD(DriverState.Handler0.Callback));
             break;
         }
 
@@ -446,8 +454,8 @@ static VOID WINAPI BiosMouseService(LPWORD Stack)
             ULONG  Callback = MAKELONG(getDX(), getES()); // Far pointer to the callback
             BOOLEAN Success = FALSE;
 
-            DPRINT1("Define v6.0+ callback 0x%04x, 0x%08x\n",
-                    CallMask, Callback);
+            DPRINT1("Define v6.0+ callback 0x%04X, %04X:%04X\n",
+                    CallMask, HIWORD(Callback), LOWORD(Callback));
 
             if (CallMask == 0x0000)
             {
@@ -657,7 +665,7 @@ VOID MouseBiosUpdateButtons(WORD ButtonState)
 BOOLEAN DosMouseInitialize(VOID)
 {
     /* Clear the state */
-    ZeroMemory(&DriverState, sizeof(DriverState));
+    RtlZeroMemory(&DriverState, sizeof(DriverState));
 
     /* Initialize the interrupt handler */
     RegisterDosInt32(BIOS_MOUSE_INTERRUPT, BiosMouseService);