Commit 9bd7fab4 authored by Yuxuan Shui's avatar Yuxuan Shui Committed by Alexandre Julliard

shell32: Use full path to current directory for finding executables.

So that the path returned by SHELL_FindExecutable would be fully qualified, otherwise CreateProcess will do its own path resolution which is not what we want.
parent 20f8758e
...@@ -1797,10 +1797,10 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) ...@@ -1797,10 +1797,10 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
if (*sei_tmp.lpDirectory) if (*sei_tmp.lpDirectory)
{ {
LPWSTR buf;
len = ExpandEnvironmentStringsW(sei_tmp.lpDirectory, NULL, 0); len = ExpandEnvironmentStringsW(sei_tmp.lpDirectory, NULL, 0);
if (len > 0) if (len > 0)
{ {
LPWSTR buf;
len++; len++;
buf = malloc(len * sizeof(WCHAR)); buf = malloc(len * sizeof(WCHAR));
ExpandEnvironmentStringsW(sei_tmp.lpDirectory, buf, len); ExpandEnvironmentStringsW(sei_tmp.lpDirectory, buf, len);
...@@ -1809,6 +1809,18 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) ...@@ -1809,6 +1809,18 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
wszDir = buf; wszDir = buf;
sei_tmp.lpDirectory = wszDir; sei_tmp.lpDirectory = wszDir;
} }
len = GetFullPathNameW(sei_tmp.lpDirectory, 0, NULL, NULL);
if (len > 0)
{
len++;
buf = malloc(len * sizeof(WCHAR));
GetFullPathNameW(sei_tmp.lpDirectory, len, buf, NULL);
if (wszDir != dirBuffer)
free(wszDir);
wszDir = buf;
sei_tmp.lpDirectory = wszDir;
}
} }
/* Else, try to execute the filename */ /* Else, try to execute the filename */
......
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