| Index: cloud_print/virtual_driver/win/port_monitor/port_monitor.cc
|
| diff --git a/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc b/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc
|
| index 26f7b3f457ac55aaa159583d4256ef4998d48df1..28c4a3b92ca81bbf66c16a13588769267bcc798b 100644
|
| --- a/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc
|
| +++ b/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc
|
| @@ -106,14 +106,22 @@ MONITOR2 g_monitor_2 = {
|
| Monitor2Shutdown
|
| };
|
|
|
| +base::FilePath GetLocalAppDataLow() {
|
| + wchar_t system_buffer[MAX_PATH];
|
| + if (FAILED(SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, SHGFP_TYPE_CURRENT,
|
| + system_buffer)))
|
| + return base::FilePath();
|
| + return base::FilePath(system_buffer).DirName().AppendASCII("LocalLow");
|
| +}
|
| +
|
| base::FilePath GetAppDataDir() {
|
| base::FilePath file_path;
|
| - base::win::Version version = base::win::GetVersion();
|
| - int path_id = (version >= base::win::VERSION_VISTA) ?
|
| - base::DIR_LOCAL_APP_DATA_LOW : base::DIR_LOCAL_APP_DATA;
|
| - if (!PathService::Get(path_id, &file_path)) {
|
| - LOG(ERROR) << "Can't get DIR_LOCAL_APP_DATA";
|
| - return base::FilePath();
|
| + if (base::win::GetVersion() >= base::win::VERSION_VISTA)
|
| + file_path = GetLocalAppDataLow();
|
| + else
|
| + PathService::Get(base::DIR_LOCAL_APP_DATA, &file_path);
|
| + if (file_path.empty()) {
|
| + LOG(ERROR) << "Can't get app data dir";
|
| }
|
| return file_path.Append(kAppDataDir);
|
| }
|
|
|