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)
{
PDOS_DRIVER DriverBlock = (PDOS_DRIVER)FAR_POINTER(Driver);
WORD ES = getES();
WORD AX = getAX();
WORD CX = getCX();
WORD DX = getDX();
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);
@ -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);
/* Restore ES:BX */
setES(ES);
/* Restore the registers */
setAX(AX);
setCX(CX);
setDX(DX);
setBX(BX);
setBP(BP);
setSI(SI);
setDI(DI);
setDS(DS);
setES(ES);
}
static inline WORD NTAPI DosDriverReadInternal(PDOS_DEVICE_NODE DeviceNode,

View file

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