mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 01:20:42 +00:00
Handle SHGetKnownFolderPath failing - return empty string
* The calling code will handle this as an unknown path and fail upwards.
This commit is contained in:
@@ -354,9 +354,12 @@ string GetHomeFolderFilename()
|
||||
|
||||
string GetAppFolderFilename(const string &filename)
|
||||
{
|
||||
PWSTR appDataPath;
|
||||
SHGetKnownFolderPath(FOLDERID_RoamingAppData, KF_FLAG_SIMPLE_IDLIST | KF_FLAG_DONT_UNEXPAND, NULL,
|
||||
&appDataPath);
|
||||
PWSTR appDataPath = NULL;
|
||||
HRESULT hr = SHGetKnownFolderPath(
|
||||
FOLDERID_RoamingAppData, KF_FLAG_SIMPLE_IDLIST | KF_FLAG_DONT_UNEXPAND, NULL, &appDataPath);
|
||||
if(appDataPath == NULL || FAILED(hr))
|
||||
return "";
|
||||
|
||||
wstring appdata = appDataPath;
|
||||
CoTaskMemFree(appDataPath);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user