mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 10:35:28 +00:00
[NTVDM][BASESRV]
- When a DOS application is started by a process that has no console, the ConsoleHandle in the VDM_CONSOLE_RECORD is initially NULL. Fix that by making an initial VDM_GET_FIRST_COMMAND call in NTVDM and setting the ConsoleHandle to the handle of NTVDM's console in BaseSrvGetNextVDMCommand. - Fix a bug in BaseSrvGetVDMExitCode (VDM_READY means the task has exited). svn path=/trunk/; revision=67961
This commit is contained in:
parent
47f56b8765
commit
e9fde4873d
2 changed files with 16 additions and 1 deletions
|
@ -217,6 +217,14 @@ CommandThreadProc(LPVOID Parameter)
|
|||
UNREFERENCED_PARAMETER(Parameter);
|
||||
ASSERT(Env);
|
||||
|
||||
/* Clear the structure */
|
||||
RtlZeroMemory(&CommandInfo, sizeof(CommandInfo));
|
||||
|
||||
/* Get the initial information */
|
||||
CommandInfo.TaskId = SessionId;
|
||||
CommandInfo.VDMState = VDM_GET_FIRST_COMMAND | VDM_FLAG_DOS;
|
||||
GetNextVDMCommand(&CommandInfo);
|
||||
|
||||
do
|
||||
{
|
||||
/* Clear the structure */
|
||||
|
|
|
@ -976,6 +976,13 @@ CSR_API(BaseSrvGetNextVDMCommand)
|
|||
goto Cleanup;
|
||||
}
|
||||
|
||||
/* Check if the console handle hasn't been set yet */
|
||||
if (ConsoleRecord->ConsoleHandle == NULL)
|
||||
{
|
||||
/* Set it now */
|
||||
ConsoleRecord->ConsoleHandle = GetNextVdmCommandRequest->ConsoleHandle;
|
||||
}
|
||||
|
||||
/* Fill the command information */
|
||||
Status = BaseSrvFillCommandInfo(DosRecord->CommandInfo, GetNextVdmCommandRequest);
|
||||
goto Cleanup;
|
||||
|
@ -1204,7 +1211,7 @@ CSR_API(BaseSrvGetVDMExitCode)
|
|||
}
|
||||
|
||||
/* Check if this task is still running */
|
||||
if (DosRecord->State == VDM_READY)
|
||||
if (DosRecord->State != VDM_READY)
|
||||
{
|
||||
GetVDMExitCodeRequest->ExitCode = STATUS_PENDING;
|
||||
goto Cleanup;
|
||||
|
|
Loading…
Reference in a new issue