Convert use of deprecated SHGetFolderPathW to SHGetKnownFolderPath
This commit is contained in:
parent
9db47334a9
commit
497d58df6f
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();
|
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) {
|
if(res != S_OK) {
|
||||||
//
|
//
|
||||||
// Crummy fallback path full of pain and suffering.
|
// Crummy fallback path full of pain and suffering.
|
||||||
|
|
Loading…
Add table
Reference in a new issue