mirror of
https://github.com/reactos/reactos.git
synced 2024-10-22 13:56:16 +00:00
[NTVDM]
Allow COM programs to exit with a simple near return to PSP:0000. Spotted by Thomas Faber. svn path=/branches/ntvdm/; revision=60904
This commit is contained in:
parent
f4f6809d67
commit
81a5adf885
|
@ -1203,6 +1203,12 @@ BOOLEAN DosCreateProcess(LPCSTR CommandLine, WORD EnvBlock)
|
|||
/* Set the stack to the last word of the segment */
|
||||
EmulatorSetStack(Segment, 0xFFFE);
|
||||
|
||||
/*
|
||||
* Set the value on the stack to 0, so that a near return
|
||||
* jumps to PSP:0000 which has the exit code.
|
||||
*/
|
||||
*((LPWORD)SEG_OFF_TO_PTR(Segment, 0xFFFE)) = 0;
|
||||
|
||||
/* Execute */
|
||||
CurrentPsp = Segment;
|
||||
DiskTransferArea = MAKELONG(0x80, Segment);
|
||||
|
|
Loading…
Reference in a new issue