Commit 5155afd8 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

kernel32: Use the full path as an argument to winevdm.exe.

When starting a 16-bit process using CreateProcess() which resides in a subdirectory, the directory is changed but winevdm.exe still attempts to look for the whole path. Thus attempting to start "install\setup.exe" will cause winevdm.exe to look for "install\install\setup.exe", which fails. Signed-off-by: 's avatarZebediah Figura <z.figura12@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 8b5291bc
......@@ -2186,15 +2186,21 @@ static BOOL create_vdm_process( LPCWSTR filename, LPWSTR cmd_line, LPWSTR env, L
static const WCHAR argsW[] = {'%','s',' ','-','-','a','p','p','-','n','a','m','e',' ','"','%','s','"',' ','%','s',0};
BOOL ret;
LPWSTR new_cmd_line = HeapAlloc( GetProcessHeap(), 0,
(strlenW(filename) + strlenW(cmd_line) + 30) * sizeof(WCHAR) );
WCHAR buffer[MAX_PATH];
LPWSTR new_cmd_line;
if (!(ret = GetFullPathNameW(filename, MAX_PATH, buffer, NULL)))
return FALSE;
new_cmd_line = HeapAlloc(GetProcessHeap(), 0,
(strlenW(buffer) + strlenW(cmd_line) + 30) * sizeof(WCHAR));
if (!new_cmd_line)
{
SetLastError( ERROR_OUTOFMEMORY );
return FALSE;
}
sprintfW( new_cmd_line, argsW, winevdmW, filename, cmd_line );
sprintfW(new_cmd_line, argsW, winevdmW, buffer, cmd_line);
ret = create_process( 0, winevdmW, new_cmd_line, env, cur_dir, psa, tsa, inherit,
flags, startup, info, unixdir, binary_info, exec_only );
HeapFree( GetProcessHeap(), 0, new_cmd_line );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment