From 9f2a74bed2d0711b27a3f2f38c5d03e44cb1bdad Mon Sep 17 00:00:00 2001 From: fed <58637860+fedddddd@users.noreply.github.com> Date: Tue, 28 Feb 2023 20:05:04 +0100 Subject: [PATCH] Fix relaunch_self on w11 --- src/common/utils/nt.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/utils/nt.cpp b/src/common/utils/nt.cpp index 858f73f7..117d3312 100644 --- a/src/common/utils/nt.cpp +++ b/src/common/utils/nt.cpp @@ -237,7 +237,7 @@ namespace utils::nt ZeroMemory(&process_info, sizeof(process_info)); startup_info.cb = sizeof(startup_info); - char current_dir[MAX_PATH]; + char current_dir[MAX_PATH]{}; GetCurrentDirectoryA(sizeof(current_dir), current_dir); std::string command_line = GetCommandLineA(); @@ -253,8 +253,8 @@ namespace utils::nt } } - CreateProcessA(self.get_path().data(), command_line.data(), nullptr, nullptr, false, NULL, nullptr, current_dir, - &startup_info, &process_info); + CreateProcessA(self.get_path().data(), command_line.data(), nullptr, nullptr, false, + CREATE_NEW_CONSOLE, nullptr, current_dir, &startup_info, &process_info); if (process_info.hThread && process_info.hThread != INVALID_HANDLE_VALUE) CloseHandle(process_info.hThread); if (process_info.hProcess && process_info.hProcess != INVALID_HANDLE_VALUE) CloseHandle(process_info.hProcess);