| OLD | NEW | 
|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #include "base/sys_info.h" | 5 #include "base/sys_info.h" | 
| 6 | 6 | 
| 7 #include <windows.h> | 7 #include <windows.h> | 
| 8 #include <winioctl.h> | 8 #include <winioctl.h> | 
| 9 | 9 | 
| 10 #include "base/files/file.h" | 10 #include "base/files/file.h" | 
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 75   if (win::GetVersion() < win::VERSION_WIN7) | 75   if (win::GetVersion() < win::VERSION_WIN7) | 
| 76     return false; | 76     return false; | 
| 77 | 77 | 
| 78   std::vector<FilePath::StringType> components; | 78   std::vector<FilePath::StringType> components; | 
| 79   path.GetComponents(&components); | 79   path.GetComponents(&components); | 
| 80 | 80 | 
| 81   File drive(FilePath(L"\\\\.\\" + components[0]), File::FLAG_OPEN); | 81   File drive(FilePath(L"\\\\.\\" + components[0]), File::FLAG_OPEN); | 
| 82   if (!drive.IsValid()) | 82   if (!drive.IsValid()) | 
| 83     return false; | 83     return false; | 
| 84 | 84 | 
| 85   STORAGE_PROPERTY_QUERY query; | 85   STORAGE_PROPERTY_QUERY query = {}; | 
| 86   query.QueryType = PropertyStandardQuery; | 86   query.QueryType = PropertyStandardQuery; | 
| 87   query.PropertyId = StorageDeviceSeekPenaltyProperty; | 87   query.PropertyId = StorageDeviceSeekPenaltyProperty; | 
| 88 | 88 | 
| 89   DEVICE_SEEK_PENALTY_DESCRIPTOR result; | 89   DEVICE_SEEK_PENALTY_DESCRIPTOR result; | 
| 90   DWORD bytes_returned; | 90   DWORD bytes_returned; | 
| 91 | 91 | 
| 92   BOOL success = DeviceIoControl(drive.GetPlatformFile(), | 92   BOOL success = DeviceIoControl(drive.GetPlatformFile(), | 
| 93                                  IOCTL_STORAGE_QUERY_PROPERTY, | 93                                  IOCTL_STORAGE_QUERY_PROPERTY, | 
| 94                                  &query, sizeof(query), | 94                                  &query, sizeof(query), | 
| 95                                  &result, sizeof(result), | 95                                  &result, sizeof(result), | 
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 156 void SysInfo::OperatingSystemVersionNumbers(int32* major_version, | 156 void SysInfo::OperatingSystemVersionNumbers(int32* major_version, | 
| 157                                             int32* minor_version, | 157                                             int32* minor_version, | 
| 158                                             int32* bugfix_version) { | 158                                             int32* bugfix_version) { | 
| 159   win::OSInfo* os_info = win::OSInfo::GetInstance(); | 159   win::OSInfo* os_info = win::OSInfo::GetInstance(); | 
| 160   *major_version = os_info->version_number().major; | 160   *major_version = os_info->version_number().major; | 
| 161   *minor_version = os_info->version_number().minor; | 161   *minor_version = os_info->version_number().minor; | 
| 162   *bugfix_version = 0; | 162   *bugfix_version = 0; | 
| 163 } | 163 } | 
| 164 | 164 | 
| 165 }  // namespace base | 165 }  // namespace base | 
| OLD | NEW | 
|---|