From: Aleksandar Andrejevic Date: Fri, 2 May 2014 21:45:16 +0000 (+0000) Subject: [BASESRV] X-Git-Tag: backups/0.3.17@66124~1365^2~7 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=9c142126d323af26ae772b9658c9a21063fe4ed4 [BASESRV] In BaseSrvGetConsoleRecord and GetConsoleRecordBySessionId, check if the console record was not found instead of returning the last one in the list. In BaseSrvCheckVDM, return the session ID to the caller. svn path=/branches/ntvdm/; revision=63120 --- diff --git a/subsystems/win/basesrv/vdm.c b/subsystems/win/basesrv/vdm.c index a3c345f70bb..ba6866c34b4 100644 --- a/subsystems/win/basesrv/vdm.c +++ b/subsystems/win/basesrv/vdm.c @@ -36,6 +36,9 @@ NTSTATUS NTAPI BaseSrvGetConsoleRecord(HANDLE ConsoleHandle, PVDM_CONSOLE_RECORD if (CurrentRecord->ConsoleHandle == ConsoleHandle) break; } + /* Check if nothing was found */ + if (i == &VDMConsoleListHead) CurrentRecord = NULL; + *Record = CurrentRecord; return CurrentRecord ? STATUS_SUCCESS : STATUS_NOT_FOUND; } @@ -52,6 +55,9 @@ NTSTATUS NTAPI GetConsoleRecordBySessionId(ULONG TaskId, PVDM_CONSOLE_RECORD *Re if (CurrentRecord->SessionId == TaskId) break; } + /* Check if nothing was found */ + if (i == &VDMConsoleListHead) CurrentRecord = NULL; + *Record = CurrentRecord; return CurrentRecord ? STATUS_SUCCESS : STATUS_NOT_FOUND; } @@ -656,6 +662,7 @@ CSR_API(BaseSrvCheckVDM) InsertTailList(&VDMConsoleListHead, &ConsoleRecord->Entry); } + CheckVdmRequest->iTask = ConsoleRecord->SessionId; CheckVdmRequest->VDMState = NewConsoleRecord ? VDM_NOT_LOADED : VDM_READY; Status = STATUS_SUCCESS; }