Move app data from %PROGRAMDATA% to %LOCALAPPDATA%

PiperOrigin-RevId: 513355549
This commit is contained in:
hai007
2023-03-01 15:22:23 -08:00
committed by Copybara-Service
parent 4727861f5d
commit d2965024ca
2 changed files with 3 additions and 3 deletions
@@ -387,7 +387,7 @@ std::optional<std::filesystem::path> DeviceInfo::GetTemporaryPath() const {
std::optional<std::filesystem::path> DeviceInfo::GetLogPath() const {
PWSTR path;
HRESULT result = SHGetKnownFolderPath(FOLDERID_ProgramData, KF_FLAG_DEFAULT,
HRESULT result = SHGetKnownFolderPath(FOLDERID_LocalAppData, KF_FLAG_DEFAULT,
/*hToken=*/nullptr, &path);
if (result == S_OK) {
std::filesystem::path prefixPath = path;
@@ -134,8 +134,8 @@ std::string ImplementationPlatform::GetAppDataPath(
// KNOWNFOLDERID.
// https://docs.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-shgetknownfolderpath
SHGetKnownFolderPath(
FOLDERID_ProgramData, // rfid: A reference to the KNOWNFOLDERID that
// identifies the folder.
FOLDERID_LocalAppData, // rfid: A reference to the KNOWNFOLDERID that
// identifies the folder.
0, // dwFlags: Flags that specify special retrieval options.
NULL, // hToken: An access token that represents a particular user.
&basePath); // ppszPath: When this method returns, contains the address