From 20d911a91508c16bd01272ae94a3ca239a4d984e Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 2 Oct 2017 13:57:55 -0700 Subject: [vcpkg] Fix use of UNICODE-sensitive Windows APIs --- toolsrc/src/commands_integrate.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'toolsrc/src/commands_integrate.cpp') diff --git a/toolsrc/src/commands_integrate.cpp b/toolsrc/src/commands_integrate.cpp index 1bf26910c..fd2f11294 100644 --- a/toolsrc/src/commands_integrate.cpp +++ b/toolsrc/src/commands_integrate.cpp @@ -113,19 +113,20 @@ namespace vcpkg::Commands::Integrate static ElevationPromptChoice elevated_cmd_execute(const std::string& param) { - SHELLEXECUTEINFO sh_ex_info = {0}; + SHELLEXECUTEINFOW sh_ex_info = {0}; sh_ex_info.cbSize = sizeof(sh_ex_info); sh_ex_info.fMask = SEE_MASK_NOCLOSEPROCESS; sh_ex_info.hwnd = nullptr; - sh_ex_info.lpVerb = "runas"; - sh_ex_info.lpFile = "cmd"; // Application to start + sh_ex_info.lpVerb = L"runas"; + sh_ex_info.lpFile = L"cmd"; // Application to start - sh_ex_info.lpParameters = param.c_str(); // Additional parameters + auto wparam = Strings::to_utf16(param); + sh_ex_info.lpParameters = wparam.c_str(); // Additional parameters sh_ex_info.lpDirectory = nullptr; sh_ex_info.nShow = SW_HIDE; sh_ex_info.hInstApp = nullptr; - if (!ShellExecuteExA(&sh_ex_info)) + if (!ShellExecuteExW(&sh_ex_info)) { return ElevationPromptChoice::NO; } -- cgit v1.2.3