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

Alexandre Julliard julliard at winehq.org
Mon May 1 16:38:04 CDT 2017


Module: wine
Branch: master
Commit: 5155afd882d09c840d27a5f13681d3b09f564b1a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=5155afd882d09c840d27a5f13681d3b09f564b1a

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Thu Apr 27 15:14:37 2017 -0500

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 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/kernel32/process.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
index 5b8a3d3..4810965 100644
--- a/dlls/kernel32/process.c
+++ b/dlls/kernel32/process.c
@@ -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 );




More information about the wine-cvs mailing list