mirror of
https://github.com/reactos/reactos.git
synced 2026-05-22 15:20:29 +08:00
[NTVDM] Add otya128's WineVDM integration code into ReactOS (#4113)
This is an interim solution until a more integrated solution with NTVDM is developed. CORE-17852
This commit is contained in:
@@ -796,10 +796,49 @@ WORD DosCreateProcess(IN LPCSTR ProgramName,
|
||||
/* Those are handled by NTVDM */
|
||||
case SCS_WOW_BINARY:
|
||||
{
|
||||
DisplayMessage(L"Trying to load '%S'.\n"
|
||||
L"WOW16 applications are not supported internally by NTVDM at the moment.\n"
|
||||
L"Press 'OK' to continue.",
|
||||
ProgramName);
|
||||
static const PCSTR AppName = "\"%ProgramFiles%\\otvdm\\otvdmw.exe\" ";
|
||||
|
||||
STARTUPINFOA si;
|
||||
PROCESS_INFORMATION pi;
|
||||
CHAR ExpName[MAX_PATH];
|
||||
|
||||
ExpandEnvironmentStringsA(AppName, ExpName, ARRAYSIZE(ExpName) - 1);
|
||||
strcat(ExpName, "\""); // Add double-quote before ProgramName
|
||||
strcat(ExpName, ProgramName); // Append Program name
|
||||
strcat(ExpName, "\""); // Add double-quote after ProgramName
|
||||
|
||||
ZeroMemory(&pi, sizeof(pi));
|
||||
ZeroMemory(&si, sizeof(si));
|
||||
si.cb = sizeof(si);
|
||||
|
||||
/* Create the process */
|
||||
if (CreateProcessA(NULL, // No Application Name
|
||||
ExpName, // Just our Command Line
|
||||
NULL, // Cannot inherit Process Handle
|
||||
NULL, // Cannot inherit Thread Handle
|
||||
FALSE, // No handle inheritance
|
||||
0, // No extra creation flags
|
||||
NULL, // No environment block
|
||||
NULL, // No starting directory
|
||||
&si,
|
||||
&pi))
|
||||
{
|
||||
/* Close the handles */
|
||||
CloseHandle(pi.hThread);
|
||||
CloseHandle(pi.hProcess);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Retrieve the actual path to the "Program Files" directory for displaying the error */
|
||||
ExpandEnvironmentStringsA("%ProgramFiles%", ExpName, ARRAYSIZE(ExpName) - 1);
|
||||
|
||||
DisplayMessage(L"Trying to load '%S'.\n"
|
||||
L"WOW16 applications are not supported internally by NTVDM at the moment.\n"
|
||||
L"Consider installing WineVDM from the ReactOS Applications Manager in\n'%S'.\n\n"
|
||||
L"Click on OK to continue.",
|
||||
ProgramName, ExpName);
|
||||
}
|
||||
// Fall through
|
||||
}
|
||||
case SCS_DOS_BINARY:
|
||||
|
||||
Reference in New Issue
Block a user