Also save and restore the registers around other mouse callbacks
and the DOS driver routine calls.


svn path=/trunk/; revision=69299
This commit is contained in:
Aleksandar Andrejevic 2015-09-19 22:42:13 +00:00
parent 7c44fa3b89
commit 97f2b6b128
2 changed files with 23 additions and 3 deletions

View file

@ -47,8 +47,15 @@ static PDOS_REQUEST_HEADER DeviceRequest;
static VOID DosCallDriver(DWORD Driver, PDOS_REQUEST_HEADER Request) static VOID DosCallDriver(DWORD Driver, PDOS_REQUEST_HEADER Request)
{ {
PDOS_DRIVER DriverBlock = (PDOS_DRIVER)FAR_POINTER(Driver); 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 */ /* Set ES:BX to the location of the request */
setES(DOS_DATA_SEGMENT); setES(DOS_DATA_SEGMENT);
@ -64,9 +71,16 @@ static VOID DosCallDriver(DWORD Driver, PDOS_REQUEST_HEADER Request)
/* Get the request structure from ES:BX */ /* Get the request structure from ES:BX */
RtlMoveMemory(Request, &Sda->Request, Request->RequestLength); RtlMoveMemory(Request, &Sda->Request, Request->RequestLength);
/* Restore ES:BX */ /* Restore the registers */
setES(ES); 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,

View file

@ -310,8 +310,11 @@ static VOID CallMouseUserHandlers(USHORT CallMask)
BX = getBX(); BX = getBX();
CX = getCX(); CX = getCX();
DX = getDX(); DX = getDX();
BP = getBP();
SI = getSI(); SI = getSI();
DI = getDI(); DI = getDI();
DS = getDS();
ES = getES();
setAX(CallMask); setAX(CallMask);
setBX(DriverState.ButtonState); setBX(DriverState.ButtonState);
@ -333,8 +336,11 @@ static VOID CallMouseUserHandlers(USHORT CallMask)
setBX(BX); setBX(BX);
setCX(CX); setCX(CX);
setDX(DX); setDX(DX);
setBP(BP);
setSI(SI); setSI(SI);
setDI(DI); setDI(DI);
setDS(DS);
setES(ES);
} }
} }
} }