Convert use of deprecated SHGetFolderPathW to SHGetKnownFolderPath
(cherry-picked from commit 497d58df6f
)
This commit is contained in:
parent
7cefbac1eb
commit
d053a875a4
1 changed files with 2 additions and 5 deletions
|
@ -554,12 +554,9 @@ void set_user_data_dir(std::string newprefdir)
|
|||
newprefdir = "Wesnoth" + get_version_path_suffix();
|
||||
}
|
||||
|
||||
wchar_t docs_path[MAX_PATH];
|
||||
PWSTR docs_path = nullptr;
|
||||
HRESULT res = SHGetKnownFolderPath(FOLDERID_Documents, KF_FLAG_CREATE, nullptr, &docs_path);
|
||||
|
||||
HRESULT res = SHGetFolderPathW(nullptr,
|
||||
CSIDL_PERSONAL | CSIDL_FLAG_CREATE, nullptr,
|
||||
SHGFP_TYPE_CURRENT,
|
||||
docs_path);
|
||||
if(res != S_OK) {
|
||||
//
|
||||
// Crummy fallback path full of pain and suffering.
|
||||
|
|
Loading…
Add table
Reference in a new issue