summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2018-07-29 23:45:12 +0200
committerZach Hilman <zachhilman@gmail.com>2018-08-01 06:16:54 +0200
commitcc8234fa89f1a7dcc2709e6d3be03f8458c841d4 (patch)
treec83060f2e045e20b84e8685519cddd804d19cf03 /src
parentMake XCI comply to review and style guidelines (diff)
downloadyuzu-cc8234fa89f1a7dcc2709e6d3be03f8458c841d4.tar
yuzu-cc8234fa89f1a7dcc2709e6d3be03f8458c841d4.tar.gz
yuzu-cc8234fa89f1a7dcc2709e6d3be03f8458c841d4.tar.bz2
yuzu-cc8234fa89f1a7dcc2709e6d3be03f8458c841d4.tar.lz
yuzu-cc8234fa89f1a7dcc2709e6d3be03f8458c841d4.tar.xz
yuzu-cc8234fa89f1a7dcc2709e6d3be03f8458c841d4.tar.zst
yuzu-cc8234fa89f1a7dcc2709e6d3be03f8458c841d4.zip
Diffstat (limited to 'src')
-rw-r--r--src/common/file_util.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp
index a26702f54..ed38c3ced 100644
--- a/src/common/file_util.cpp
+++ b/src/common/file_util.cpp
@@ -738,10 +738,11 @@ const std::string& GetUserPath(UserPath path, const std::string& new_path) {
std::string GetHactoolConfigurationPath() {
#ifdef _WIN32
- char path[MAX_PATH];
- if (SHGetFolderPathA(nullptr, CSIDL_PROFILE, nullptr, 0, path) != S_OK)
+ PWSTR pw_local_path = nullptr;
+ if (SHGetKnownFolderPath(FOLDERID_Profile, 0, nullptr, &pw_local_path) != S_OK)
return "";
- std::string local_path = Common::StringFromFixedZeroTerminatedBuffer(path, MAX_PATH);
+ std::string local_path = Common::UTF16ToUTF8(pw_local_path);
+ CoTaskMemFree(pw_local_path);
return local_path + "\\.switch";
#else
return GetHomeDirectory() + "/.switch";