- removed a few obsolete definitions from basictypes.h

This commit is contained in:
Christoph Oelckers 2019-06-26 22:13:12 +02:00
commit 1081338af2
5 changed files with 19 additions and 57 deletions

View file

@ -101,36 +101,14 @@ bool UseKnownFolders()
bool GetKnownFolder(int shell_folder, REFKNOWNFOLDERID known_folder, bool create, FString &path)
{
// SHGetKnownFolderPath knows about more folders than SHGetFolderPath, but is
// new to Vista, hence the reason we support both.
if (!SHGetKnownFolderPath)
PWSTR wpath;
if (FAILED(SHGetKnownFolderPath(known_folder, create ? KF_FLAG_CREATE : 0, NULL, &wpath)))
{
if (shell_folder < 0)
{ // Not supported by SHGetFolderPath
return false;
}
if (create)
{
shell_folder |= CSIDL_FLAG_CREATE;
}
if (FAILED(SHGetFolderPathW(NULL, shell_folder, NULL, 0, pathstr)))
{
return false;
}
path = pathstr;
return true;
}
else
{
PWSTR wpath;
if (FAILED(SHGetKnownFolderPath(known_folder, create ? KF_FLAG_CREATE : 0, NULL, &wpath)))
{
return false;
}
path = wpath;
CoTaskMemFree(wpath);
return true;
return false;
}
path = wpath;
CoTaskMemFree(wpath);
return true;
}
//===========================================================================