From 15304ef9138107f32227eef5c8a8767bdb98c141 Mon Sep 17 00:00:00 2001 From: rainmakerv2 <30595646+jpau02@users.noreply.github.com> Date: Tue, 4 Mar 2025 16:17:06 +0800 Subject: [PATCH] Add global windows user folder --- src/common/path_util.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/common/path_util.cpp b/src/common/path_util.cpp index 6bc73ee43..702d0fabc 100644 --- a/src/common/path_util.cpp +++ b/src/common/path_util.cpp @@ -17,6 +17,8 @@ #ifdef _WIN32 // This is the maximum number of UTF-16 code units permissible in Windows file paths #define MAX_PATH 260 +#include +#include #else // This is the maximum number of UTF-8 code units permissible in all other OSes' file paths #define MAX_PATH 1024 @@ -106,6 +108,10 @@ static auto UserPaths = [] { } else { user_dir = std::filesystem::path(getenv("HOME")) / ".local" / "share" / "shadPS4"; } +#elif _WIN32 + TCHAR appdata[MAX_PATH] = {0}; + SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, 0, appdata); + user_dir = std::filesystem::path(appdata) / "shadPS4"; #endif }