Author: aandrejevic Date: Fri May 2 21:45:16 2014 New Revision: 63120
URL: http://svn.reactos.org/svn/reactos?rev=63120&view=rev Log: [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.
Modified: branches/ntvdm/subsystems/win/basesrv/vdm.c
Modified: branches/ntvdm/subsystems/win/basesrv/vdm.c URL: http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/win/basesrv/vdm... ============================================================================== --- branches/ntvdm/subsystems/win/basesrv/vdm.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/win/basesrv/vdm.c [iso-8859-1] Fri May 2 21:45:16 2014 @@ -36,6 +36,9 @@ if (CurrentRecord->ConsoleHandle == ConsoleHandle) break; }
+ /* Check if nothing was found */ + if (i == &VDMConsoleListHead) CurrentRecord = NULL; + *Record = CurrentRecord; return CurrentRecord ? STATUS_SUCCESS : STATUS_NOT_FOUND; } @@ -51,6 +54,9 @@ CurrentRecord = CONTAINING_RECORD(i, VDM_CONSOLE_RECORD, Entry); 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 @@ InsertTailList(&VDMConsoleListHead, &ConsoleRecord->Entry); }
+ CheckVdmRequest->iTask = ConsoleRecord->SessionId; CheckVdmRequest->VDMState = NewConsoleRecord ? VDM_NOT_LOADED : VDM_READY; Status = STATUS_SUCCESS; }