summaryrefslogtreecommitdiff
path: root/src/common/file_util.cpp
diff options
context:
space:
mode:
authorGravatar Zach Hilman2018-07-29 17:45:12 -0400
committerGravatar Zach Hilman2018-08-01 00:16:54 -0400
commitcc8234fa89f1a7dcc2709e6d3be03f8458c841d4 (patch)
treec83060f2e045e20b84e8685519cddd804d19cf03 /src/common/file_util.cpp
parentMake XCI comply to review and style guidelines (diff)
downloadyuzu-cc8234fa89f1a7dcc2709e6d3be03f8458c841d4.tar.gz
yuzu-cc8234fa89f1a7dcc2709e6d3be03f8458c841d4.tar.xz
yuzu-cc8234fa89f1a7dcc2709e6d3be03f8458c841d4.zip
Use SHGetKnownFolderPath instead of SHGetFolderPathA
Diffstat (limited to 'src/common/file_util.cpp')
-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) {
738 738
739std::string GetHactoolConfigurationPath() { 739std::string GetHactoolConfigurationPath() {
740#ifdef _WIN32 740#ifdef _WIN32
741 char path[MAX_PATH]; 741 PWSTR pw_local_path = nullptr;
742 if (SHGetFolderPathA(nullptr, CSIDL_PROFILE, nullptr, 0, path) != S_OK) 742 if (SHGetKnownFolderPath(FOLDERID_Profile, 0, nullptr, &pw_local_path) != S_OK)
743 return ""; 743 return "";
744 std::string local_path = Common::StringFromFixedZeroTerminatedBuffer(path, MAX_PATH); 744 std::string local_path = Common::UTF16ToUTF8(pw_local_path);
745 CoTaskMemFree(pw_local_path);
745 return local_path + "\\.switch"; 746 return local_path + "\\.switch";
746#else 747#else
747 return GetHomeDirectory() + "/.switch"; 748 return GetHomeDirectory() + "/.switch";