mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 10:35:28 +00:00
[NTVDM]
Start implementing the BaseVDM interface. svn path=/branches/ntvdm/; revision=62686
This commit is contained in:
parent
bd153df890
commit
e5a9861dc9
2 changed files with 67 additions and 6 deletions
|
@ -371,9 +371,14 @@ VOID ConsoleCleanup(VOID)
|
|||
INT wmain(INT argc, WCHAR *argv[])
|
||||
{
|
||||
#ifndef STANDALONE
|
||||
wprintf(L"\nReactOS Virtual DOS Machine\n\n"
|
||||
L"OS integration (BaseVDM) unimplemented\n");
|
||||
return 0;
|
||||
|
||||
VDM_COMMAND_INFO CommandInfo;
|
||||
CHAR CmdLine[MAX_PATH];
|
||||
CHAR AppName[MAX_PATH];
|
||||
CHAR PifFile[MAX_PATH];
|
||||
CHAR Desktop[MAX_PATH];
|
||||
CHAR Title[MAX_PATH];
|
||||
|
||||
#else
|
||||
|
||||
CHAR CommandLine[DOS_CMDLINE_LENGTH];
|
||||
|
@ -391,6 +396,8 @@ INT wmain(INT argc, WCHAR *argv[])
|
|||
|
||||
DPRINT1("\n\n\nNTVDM - Starting '%s'...\n\n\n", CommandLine);
|
||||
|
||||
#endif
|
||||
|
||||
/* Initialize the console */
|
||||
if (!ConsoleInit())
|
||||
{
|
||||
|
@ -419,6 +426,44 @@ INT wmain(INT argc, WCHAR *argv[])
|
|||
goto Cleanup;
|
||||
}
|
||||
|
||||
#ifndef STANDALONE
|
||||
|
||||
while (TRUE)
|
||||
{
|
||||
/* Clear the structure */
|
||||
ZeroMemory(&CommandInfo, sizeof(CommandInfo));
|
||||
|
||||
/* Initialize the structure members */
|
||||
CommandInfo.VDMState = VDM_NOT_LOADED;
|
||||
CommandInfo.CmdLine = CmdLine;
|
||||
CommandInfo.CmdLen = sizeof(CmdLine);
|
||||
CommandInfo.AppName = AppName;
|
||||
CommandInfo.AppLen = sizeof(AppName);
|
||||
CommandInfo.PifFile = PifFile;
|
||||
CommandInfo.PifLen = sizeof(PifFile);
|
||||
CommandInfo.Desktop = Desktop;
|
||||
CommandInfo.DesktopLen = sizeof(Desktop);
|
||||
CommandInfo.Title = Title;
|
||||
CommandInfo.TitleLen = sizeof(Title);
|
||||
|
||||
if (!GetNextVDMCommand(&CommandInfo)) break;
|
||||
|
||||
/* Start the process from the command line */
|
||||
if (!DosCreateProcess(AppName, 0))
|
||||
{
|
||||
DisplayMessage(L"Could not start program: %S", AppName);
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
/* Start simulation */
|
||||
EmulatorSimulate();
|
||||
|
||||
/* Perform another screen refresh */
|
||||
VgaRefreshDisplay();
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
/* Start the process from the command line */
|
||||
if (!DosCreateProcess(CommandLine, 0))
|
||||
{
|
||||
|
@ -429,6 +474,8 @@ INT wmain(INT argc, WCHAR *argv[])
|
|||
/* Start simulation */
|
||||
EmulatorSimulate();
|
||||
|
||||
#endif
|
||||
|
||||
/* Perform another screen refresh */
|
||||
VgaRefreshDisplay();
|
||||
|
||||
|
@ -437,11 +484,11 @@ Cleanup:
|
|||
EmulatorCleanup();
|
||||
ConsoleCleanup();
|
||||
|
||||
/* Quit the VDM */
|
||||
DPRINT1("\n\n\nNTVDM - Exiting...\n\n\n");
|
||||
ExitVDM(FALSE, 0);
|
||||
|
||||
return 0;
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -23,12 +23,26 @@
|
|||
#include <winnls.h>
|
||||
#include <winreg.h>
|
||||
#include <winuser.h>
|
||||
#include <subsys/win/vdm.h>
|
||||
|
||||
#include <vddsvc.h>
|
||||
|
||||
#include <debug.h>
|
||||
|
||||
/* DEFINES ********************************************************************/
|
||||
/* PROTOTYPES *****************************************************************/
|
||||
|
||||
BOOL
|
||||
WINAPI
|
||||
GetNextVDMCommand(
|
||||
IN OUT PVDM_COMMAND_INFO CommandData OPTIONAL
|
||||
);
|
||||
|
||||
VOID
|
||||
WINAPI
|
||||
ExitVDM(
|
||||
IN BOOL IsWow,
|
||||
IN ULONG iWowTask
|
||||
);
|
||||
|
||||
/* FUNCTIONS ******************************************************************/
|
||||
|
||||
|
|
Loading…
Reference in a new issue