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: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2017-04-27 15:14:37 -05:00 committed by Alexandre Julliard
parent 8b5291bca6
commit 5155afd882
1 changed files with 9 additions and 3 deletions

View File

@ -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 );