Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Side by Side Diff: device/serial/serial_device_enumerator_win.cc

Issue 616173003: Allow Registry Iterator functions to use a specified WOW64 mode when iterating. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "device/serial/serial_device_enumerator_win.h" 5 #include "device/serial/serial_device_enumerator_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 10 matching lines...) Expand all
21 21
22 SerialDeviceEnumeratorWin::SerialDeviceEnumeratorWin() {} 22 SerialDeviceEnumeratorWin::SerialDeviceEnumeratorWin() {}
23 23
24 SerialDeviceEnumeratorWin::~SerialDeviceEnumeratorWin() {} 24 SerialDeviceEnumeratorWin::~SerialDeviceEnumeratorWin() {}
25 25
26 // TODO(rockot): Query the system for more information than just device paths. 26 // TODO(rockot): Query the system for more information than just device paths.
27 // This may or may not require using a different strategy than scanning the 27 // This may or may not require using a different strategy than scanning the
28 // registry location below. 28 // registry location below.
29 mojo::Array<serial::DeviceInfoPtr> SerialDeviceEnumeratorWin::GetDevices() { 29 mojo::Array<serial::DeviceInfoPtr> SerialDeviceEnumeratorWin::GetDevices() {
30 base::win::RegistryValueIterator iter_key( 30 base::win::RegistryValueIterator iter_key(
31 HKEY_LOCAL_MACHINE, L"HARDWARE\\DEVICEMAP\\SERIALCOMM\\"); 31 HKEY_LOCAL_MACHINE, L"HARDWARE\\DEVICEMAP\\SERIALCOMM\\", 0);
32 mojo::Array<serial::DeviceInfoPtr> devices(0); 32 mojo::Array<serial::DeviceInfoPtr> devices(0);
33 for (; iter_key.Valid(); ++iter_key) { 33 for (; iter_key.Valid(); ++iter_key) {
34 serial::DeviceInfoPtr info(serial::DeviceInfo::New()); 34 serial::DeviceInfoPtr info(serial::DeviceInfo::New());
35 info->path = base::UTF16ToASCII(iter_key.Value()); 35 info->path = base::UTF16ToASCII(iter_key.Value());
36 devices.push_back(info.Pass()); 36 devices.push_back(info.Pass());
37 } 37 }
38 return devices.Pass(); 38 return devices.Pass();
39 } 39 }
40 40
41 } // namespace device 41 } // namespace device
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698