Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/steam_helper/steam.cpp b/steam_helper/steam.cpp
- index 79fa95d24c5..e97281b3f81 100644
- --- a/steam_helper/steam.cpp
- +++ b/steam_helper/steam.cpp
- @@ -952,7 +952,9 @@ static BOOL should_use_shell_execute(const WCHAR *cmdline)
- static HANDLE run_process(BOOL *should_await)
- {
- - WCHAR *cmdline = GetCommandLineW();
- + typedef HRESULT (WINAPI *PathCchRemoveFileSpecFunc)(WCHAR *path, SIZE_T size);
- + PathCchRemoveFileSpecFunc pPathCchRemoveFileSpec;
- + WCHAR *cmdline = GetCommandLineW(), *current_directory = NULL;
- STARTUPINFOW si = { sizeof(si) };
- PROCESS_INFORMATION pi;
- DWORD flags = CREATE_UNICODE_ENVIRONMENT;
- @@ -983,7 +985,7 @@ static HANDLE run_process(BOOL *should_await)
- WCHAR *scratchW;
- char *scratchA;
- WCHAR *start, *end, *dos, *remainder, *new_cmdline;
- - size_t argv0_len;
- + size_t argv0_len, length;
- int r;
- DWORD_PTR console;
- SHFILEINFOW sfi;
- @@ -1054,11 +1056,17 @@ static HANDLE run_process(BOOL *should_await)
- lstrcatW(new_cmdline, dquoteW);
- lstrcatW(new_cmdline, remainder);
- + pPathCchRemoveFileSpec = (PathCchRemoveFileSpecFunc)GetProcAddress(LoadLibraryA("kernelbase.dll"), "PathCchRemoveFileSpec");
- + length = lstrlenW(dos) + 1;
- + current_directory = (WCHAR *)HeapAlloc(GetProcessHeap(), 0, length * sizeof(WCHAR));
- + lstrcpyW(current_directory, dos);
- + pPathCchRemoveFileSpec(current_directory, length);
- +
- cmdline = new_cmdline;
- }
- run:
- - WINE_TRACE("Running command %s\n", wine_dbgstr_w(cmdline));
- + WINE_TRACE("Running command %s in %s\n", wine_dbgstr_w(cmdline), wine_dbgstr_w(current_directory));
- SetConsoleCtrlHandler( console_ctrl_handler, TRUE );
- @@ -1077,7 +1085,7 @@ run:
- if (use_shell_execute)
- {
- static const WCHAR verb[] = { 'o', 'p', 'e', 'n', 0 };
- - ShellExecuteW(NULL, verb, cmdline, NULL, NULL, hide_window ? SW_HIDE : SW_SHOWNORMAL);
- + ShellExecuteW(NULL, verb, cmdline, NULL, current_directory, hide_window ? SW_HIDE : SW_SHOWNORMAL);
- return INVALID_HANDLE_VALUE;
- }
- @@ -1089,7 +1097,7 @@ run:
- si.wShowWindow = SW_HIDE;
- }
- - if (!CreateProcessW(NULL, cmdline, NULL, NULL, FALSE, flags, NULL, NULL, &si, &pi))
- + if (!CreateProcessW(NULL, cmdline, NULL, NULL, FALSE, flags, NULL, current_directory, &si, &pi))
- {
- WINE_ERR("Failed to create process %s: %u\n", wine_dbgstr_w(cmdline), GetLastError());
- return INVALID_HANDLE_VALUE;
- diff --git a/wine b/wine
- --- a/wine
- +++ b/wine
- @@ -1 +1 @@
- -Subproject commit df982e6865c2041ae994ee20ed2a2075ae7ddfb7
- +Subproject commit df982e6865c2041ae994ee20ed2a2075ae7ddfb7-dirty
Advertisement
Add Comment
Please, Sign In to add comment