[NTVDM]
authorAleksandar Andrejevic <aandrejevic@reactos.org>
Sat, 19 Sep 2015 22:42:13 +0000 (22:42 +0000)
committerAleksandar Andrejevic <aandrejevic@reactos.org>
Sat, 19 Sep 2015 22:42:13 +0000 (22:42 +0000)
Also save and restore the registers around other mouse callbacks
and the DOS driver routine calls.

svn path=/trunk/; revision=69299

reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/device.c
reactos/subsystems/mvdm/ntvdm/dos/mouse32.c

index 4f4fa7c..4a4bc76 100644 (file)
@@ -47,8 +47,15 @@ static PDOS_REQUEST_HEADER DeviceRequest;
 static VOID DosCallDriver(DWORD Driver, PDOS_REQUEST_HEADER Request)
 {
     PDOS_DRIVER DriverBlock = (PDOS_DRIVER)FAR_POINTER(Driver);
 static VOID DosCallDriver(DWORD Driver, PDOS_REQUEST_HEADER Request)
 {
     PDOS_DRIVER DriverBlock = (PDOS_DRIVER)FAR_POINTER(Driver);
-    WORD ES = getES();
+    WORD AX = getAX();
+    WORD CX = getCX();
+    WORD DX = getDX();
     WORD BX = getBX();
     WORD BX = getBX();
+    WORD BP = getBP();
+    WORD SI = getSI();
+    WORD DI = getDI();
+    WORD DS = getDS();
+    WORD ES = getES();
 
     /* Set ES:BX to the location of the request */
     setES(DOS_DATA_SEGMENT);
 
     /* Set ES:BX to the location of the request */
     setES(DOS_DATA_SEGMENT);
@@ -64,9 +71,16 @@ static VOID DosCallDriver(DWORD Driver, PDOS_REQUEST_HEADER Request)
     /* Get the request structure from ES:BX */
     RtlMoveMemory(Request, &Sda->Request, Request->RequestLength);
 
     /* Get the request structure from ES:BX */
     RtlMoveMemory(Request, &Sda->Request, Request->RequestLength);
 
-    /* Restore ES:BX */
-    setES(ES);
+    /* Restore the registers */
+    setAX(AX);
+    setCX(CX);
+    setDX(DX);
     setBX(BX);
     setBX(BX);
+    setBP(BP);
+    setSI(SI);
+    setDI(DI);
+    setDS(DS);
+    setES(ES);
 }
 
 static inline WORD NTAPI DosDriverReadInternal(PDOS_DEVICE_NODE DeviceNode,
 }
 
 static inline WORD NTAPI DosDriverReadInternal(PDOS_DEVICE_NODE DeviceNode,
index 257dac4..171bdfd 100644 (file)
@@ -310,8 +310,11 @@ static VOID CallMouseUserHandlers(USHORT CallMask)
             BX = getBX();
             CX = getCX();
             DX = getDX();
             BX = getBX();
             CX = getCX();
             DX = getDX();
+            BP = getBP();
             SI = getSI();
             DI = getDI();
             SI = getSI();
             DI = getDI();
+            DS = getDS();
+            ES = getES();
 
             setAX(CallMask);
             setBX(DriverState.ButtonState);
 
             setAX(CallMask);
             setBX(DriverState.ButtonState);
@@ -333,8 +336,11 @@ static VOID CallMouseUserHandlers(USHORT CallMask)
             setBX(BX);
             setCX(CX);
             setDX(DX);
             setBX(BX);
             setCX(CX);
             setDX(DX);
+            setBP(BP);
             setSI(SI);
             setDI(DI);
             setSI(SI);
             setDI(DI);
+            setDS(DS);
+            setES(ES);
         }
     }
 }
         }
     }
 }