Author: aandrejevic
Date: Sun Feb 9 17:37:35 2014
New Revision: 62078
URL:
http://svn.reactos.org/svn/reactos?rev=62078&view=rev
Log:
[BASESRV]
Add an (incomplete) definition for VDM console records and VDM DOS records.
Implement BaseSrvIsFirstVDM.
Start implementing BaseSrvCheckVDM.
Added:
branches/ntvdm/subsystems/win/basesrv/vdm.h (with props)
Modified:
branches/ntvdm/subsystems/win/basesrv/init.c
branches/ntvdm/subsystems/win/basesrv/vdm.c
Modified: branches/ntvdm/subsystems/win/basesrv/init.c
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/win/basesrv/in…
==============================================================================
--- branches/ntvdm/subsystems/win/basesrv/init.c [iso-8859-1] (original)
+++ branches/ntvdm/subsystems/win/basesrv/init.c [iso-8859-1] Sun Feb 9 17:37:35 2014
@@ -9,6 +9,7 @@
/* INCLUDES *******************************************************************/
#include "basesrv.h"
+#include "vdm.h"
#include <winreg.h>
@@ -591,6 +592,9 @@
/* Initialize DOS devices management */
BaseInitDefineDosDevice();
+ /* Initialize VDM support */
+ BaseInitializeVDM();
+
/* All done */
return STATUS_SUCCESS;
}
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] Sun Feb 9 17:37:35 2014
@@ -4,20 +4,90 @@
* FILE: subsystems/win/basesrv/vdm.c
* PURPOSE: Virtual DOS Machines (VDM) Support
* PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca(a)sfr.fr)
+ * Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
*/
/* INCLUDES *******************************************************************/
#include "basesrv.h"
+#include "vdm.h"
#define NDEBUG
#include <debug.h>
+
+/* GLOBALS ********************************************************************/
+
+BOOLEAN FirstVDM = TRUE;
+LIST_ENTRY VDMConsoleListHead;
+RTL_CRITICAL_SECTION DosCriticalSection;
+
+/* FUNCTIONS ******************************************************************/
+
+NTSTATUS NTAPI BaseSrvGetConsoleRecord(HANDLE ConsoleHandle, PVDM_CONSOLE_RECORD
*Record)
+{
+ PLIST_ENTRY i;
+ PVDM_CONSOLE_RECORD CurrentRecord = NULL;
+
+ /* Search for a record that has the same console handle */
+ for (i = VDMConsoleListHead.Flink; i != &VDMConsoleListHead; i = i->Flink)
+ {
+ CurrentRecord = CONTAINING_RECORD(i, VDM_CONSOLE_RECORD, Entry);
+ if (CurrentRecord->ConsoleHandle == ConsoleHandle) break;
+ }
+
+ *Record = CurrentRecord;
+ return CurrentRecord ? STATUS_SUCCESS : STATUS_NOT_FOUND;
+}
+
+VOID NTAPI BaseInitializeVDM(VOID)
+{
+ /* Initialize the list head */
+ InitializeListHead(&VDMConsoleListHead);
+
+ /* Initialize the critical section */
+ RtlInitializeCriticalSection(&DosCriticalSection);
+}
/* PUBLIC SERVER APIS *********************************************************/
CSR_API(BaseSrvCheckVDM)
{
- DPRINT1("%s not yet implemented\n", __FUNCTION__);
+ PBASE_CHECK_VDM CheckVdmRequest =
&((PBASE_API_MESSAGE)ApiMessage)->Data.CheckVDMRequest;
+
+ /* Validate the message buffers */
+ if (!CsrValidateMessageBuffer(ApiMessage,
+ (PVOID*)&CheckVdmRequest->CmdLine,
+ CheckVdmRequest->CmdLen,
+ sizeof(*CheckVdmRequest->CmdLine))
+ || !CsrValidateMessageBuffer(ApiMessage,
+ (PVOID*)&CheckVdmRequest->AppName,
+ CheckVdmRequest->AppLen,
+ sizeof(*CheckVdmRequest->AppName))
+ || !CsrValidateMessageBuffer(ApiMessage,
+ (PVOID*)&CheckVdmRequest->PifFile,
+ CheckVdmRequest->PifLen,
+ sizeof(*CheckVdmRequest->PifFile))
+ || !CsrValidateMessageBuffer(ApiMessage,
+ (PVOID*)&CheckVdmRequest->CurDirectory,
+ CheckVdmRequest->CurDirectoryLen,
+ sizeof(*CheckVdmRequest->CurDirectory))
+ || !CsrValidateMessageBuffer(ApiMessage,
+ (PVOID*)&CheckVdmRequest->Desktop,
+ CheckVdmRequest->DesktopLen,
+ sizeof(*CheckVdmRequest->Desktop))
+ || !CsrValidateMessageBuffer(ApiMessage,
+ (PVOID*)&CheckVdmRequest->Title,
+ CheckVdmRequest->TitleLen,
+ sizeof(*CheckVdmRequest->Title))
+ || !CsrValidateMessageBuffer(ApiMessage,
+ (PVOID*)&CheckVdmRequest->Reserved,
+ CheckVdmRequest->ReservedLen,
+ sizeof(*CheckVdmRequest->Reserved)))
+ {
+ return STATUS_INVALID_PARAMETER;
+ }
+
+ // TODO: NOT IMPLEMENTED
return STATUS_NOT_IMPLEMENTED;
}
@@ -41,8 +111,15 @@
CSR_API(BaseSrvIsFirstVDM)
{
- DPRINT1("%s not yet implemented\n", __FUNCTION__);
- return STATUS_NOT_IMPLEMENTED;
+ PBASE_IS_FIRST_VDM IsFirstVDMRequest =
&((PBASE_API_MESSAGE)ApiMessage)->Data.IsFirstVDMRequest;
+
+ /* Return the result */
+ IsFirstVDMRequest->FirstVDM = FirstVDM;
+
+ /* Clear the first VDM flag */
+ FirstVDM = FALSE;
+
+ return STATUS_SUCCESS;
}
CSR_API(BaseSrvGetVDMExitCode)
Added: branches/ntvdm/subsystems/win/basesrv/vdm.h
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/win/basesrv/vd…
==============================================================================
--- branches/ntvdm/subsystems/win/basesrv/vdm.h (added)
+++ branches/ntvdm/subsystems/win/basesrv/vdm.h [iso-8859-1] Sun Feb 9 17:37:35 2014
@@ -0,0 +1,33 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS Base API Server DLL
+ * FILE: subsystems/win/basesrv/vdm.h
+ * PURPOSE: VDM Definitions
+ * PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
+ */
+
+#ifndef __VDM_H__
+#define __VDM_H__
+
+/* DEFINITIONS ****************************************************************/
+
+typedef struct _VDM_CONSOLE_RECORD
+{
+ LIST_ENTRY Entry;
+ HANDLE ConsoleHandle;
+ LIST_ENTRY DosListHead;
+ // TODO: Structure incomplete!!!
+} VDM_CONSOLE_RECORD, *PVDM_CONSOLE_RECORD;
+
+typedef struct _VDM_DOS_RECORD
+{
+ LIST_ENTRY Entry;
+ // TODO: Structure incomplete!!!
+} VDM_DOS_RECORD, *PVDM_DOS_RECORD;
+
+/* FUNCTIONS ******************************************************************/
+
+NTSTATUS NTAPI BaseSrvGetConsoleRecord(HANDLE ConsoleHandle, PVDM_CONSOLE_RECORD
*Record);
+VOID NTAPI BaseInitializeVDM(VOID);
+
+#endif // __VDM_H__
Propchange: branches/ntvdm/subsystems/win/basesrv/vdm.h
------------------------------------------------------------------------------
svn:eol-style = native