Author: aandrejevic
Date: Fri May 2 23:00:10 2014
New Revision: 63122
URL: http://svn.reactos.org/svn/reactos?rev=63122&view=rev
Log:
[BASESRV]
Don't accept NULL as a valid console handle.
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/vd…
==============================================================================
--- branches/ntvdm/subsystems/win/basesrv/vdm.c [iso-8859-1] (original)
+++ branches/ntvdm/subsystems/win/basesrv/vdm.c [iso-8859-1] Fri May 2 23:00:10 2014
@@ -28,6 +28,9 @@
{
PLIST_ENTRY i;
PVDM_CONSOLE_RECORD CurrentRecord = NULL;
+
+ /* NULL is not a valid console handle */
+ if (ConsoleHandle == NULL) return STATUS_INVALID_PARAMETER;
/* Search for a record that has the same console handle */
for (i = VDMConsoleListHead.Flink; i != &VDMConsoleListHead; i = i->Flink)
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/vd…
==============================================================================
--- 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;
}