From dd049f9da30733f9b361db5ca5e276ac43f97d54 Mon Sep 17 00:00:00 2001 From: Aleksandar Andrejevic Date: Mon, 28 Apr 2014 20:51:59 +0000 Subject: [PATCH] [BASESRV] Don't update the state of the old DOS records if the DOS program executed another program. svn path=/branches/ntvdm/; revision=63039 --- subsystems/win/basesrv/vdm.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/subsystems/win/basesrv/vdm.c b/subsystems/win/basesrv/vdm.c index 674f91cd7d1..ec4a144a128 100644 --- a/subsystems/win/basesrv/vdm.c +++ b/subsystems/win/basesrv/vdm.c @@ -850,18 +850,20 @@ CSR_API(BaseSrvGetNextVDMCommand) GetNextVdmCommandRequest->iTask = ConsoleRecord->SessionId; GetNextVdmCommandRequest->WaitObjectForVDM = NULL; - // HACK: I'm not sure if this should happen... - for (i = ConsoleRecord->DosListHead.Flink; i != &ConsoleRecord->DosListHead; i = i->Flink) + if (!(GetNextVdmCommandRequest->VDMState & VDM_NOT_READY)) { - DosRecord = CONTAINING_RECORD(i, VDM_DOS_RECORD, Entry); - if (DosRecord->State == VDM_NOT_READY) + for (i = ConsoleRecord->DosListHead.Flink; i != &ConsoleRecord->DosListHead; i = i->Flink) { - /* If NTVDM is asking for a new command, it means these are done */ - DosRecord->State = VDM_READY; + DosRecord = CONTAINING_RECORD(i, VDM_DOS_RECORD, Entry); + if (DosRecord->State == VDM_NOT_READY) + { + /* If NTVDM is asking for a new command, it means these are done */ + DosRecord->State = VDM_READY; - NtSetEvent(DosRecord->ServerEvent, NULL); - NtClose(DosRecord->ServerEvent); - DosRecord->ServerEvent = NULL; + NtSetEvent(DosRecord->ServerEvent, NULL); + NtClose(DosRecord->ServerEvent); + DosRecord->ServerEvent = NULL; + } } } -- 2.17.1