OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // devguid requires Windows.h be imported first. | 5 // devguid requires Windows.h be imported first. |
| 6 #include "chrome/browser/extensions/api/image_writer_private/removable_storage_p
rovider.h" |
| 7 |
6 #include <windows.h> | 8 #include <windows.h> |
7 #include <setupapi.h> | 9 #include <setupapi.h> |
8 #include <winioctl.h> | 10 #include <winioctl.h> |
9 | 11 |
| 12 #include <memory> |
| 13 |
10 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
11 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
12 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
13 #include "base/win/scoped_handle.h" | 17 #include "base/win/scoped_handle.h" |
14 #include "chrome/browser/extensions/api/image_writer_private/removable_storage_p
rovider.h" | |
15 | 18 |
16 namespace extensions { | 19 namespace extensions { |
17 | 20 |
18 namespace { | 21 namespace { |
19 | 22 |
20 bool AddDeviceInfo(HANDLE interface_enumerator, | 23 bool AddDeviceInfo(HANDLE interface_enumerator, |
21 SP_DEVICE_INTERFACE_DATA* interface_data, | 24 SP_DEVICE_INTERFACE_DATA* interface_data, |
22 scoped_refptr<StorageDeviceList> device_list) { | 25 scoped_refptr<StorageDeviceList> device_list) { |
23 // Get the required buffer size by calling with a null output buffer. | 26 // Get the required buffer size by calling with a null output buffer. |
24 DWORD interface_detail_data_size; | 27 DWORD interface_detail_data_size; |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 PLOG(ERROR) << "SetupDiEnumDeviceInterfaces failed"; | 208 PLOG(ERROR) << "SetupDiEnumDeviceInterfaces failed"; |
206 SetupDiDestroyDeviceInfoList(interface_enumerator); | 209 SetupDiDestroyDeviceInfoList(interface_enumerator); |
207 return false; | 210 return false; |
208 } | 211 } |
209 | 212 |
210 SetupDiDestroyDeviceInfoList(interface_enumerator); | 213 SetupDiDestroyDeviceInfoList(interface_enumerator); |
211 return true; | 214 return true; |
212 } | 215 } |
213 | 216 |
214 } // namespace extensions | 217 } // namespace extensions |
OLD | NEW |