[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
This commit is contained in:
Aleksandar Andrejevic 2014-05-02 21:45:16 +00:00
parent fdf472cb6e
commit 9c142126d3

View file

@ -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;
}