| OLD | NEW |
| 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_io_handler_win.h" | 5 #include "device/serial/serial_io_handler_win.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <setupapi.h> | 8 #include <setupapi.h> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/macros.h" |
| 11 #include "base/scoped_observer.h" | 12 #include "base/scoped_observer.h" |
| 12 #include "base/threading/thread_checker.h" | 13 #include "base/threading/thread_checker.h" |
| 13 #include "device/core/device_info_query_win.h" | 14 #include "device/core/device_info_query_win.h" |
| 14 #include "device/core/device_monitor_win.h" | 15 #include "device/core/device_monitor_win.h" |
| 15 #include "third_party/re2/src/re2/re2.h" | 16 #include "third_party/re2/src/re2/re2.h" |
| 16 | 17 |
| 17 namespace device { | 18 namespace device { |
| 18 | 19 |
| 19 namespace { | 20 namespace { |
| 20 | 21 |
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 533 std::string SerialIoHandler::MaybeFixUpPortName(const std::string& port_name) { | 534 std::string SerialIoHandler::MaybeFixUpPortName(const std::string& port_name) { |
| 534 // For COM numbers less than 9, CreateFile is called with a string such as | 535 // For COM numbers less than 9, CreateFile is called with a string such as |
| 535 // "COM1". For numbers greater than 9, a prefix of "\\\\.\\" must be added. | 536 // "COM1". For numbers greater than 9, a prefix of "\\\\.\\" must be added. |
| 536 if (port_name.length() > std::string("COM9").length()) | 537 if (port_name.length() > std::string("COM9").length()) |
| 537 return std::string("\\\\.\\").append(port_name); | 538 return std::string("\\\\.\\").append(port_name); |
| 538 | 539 |
| 539 return port_name; | 540 return port_name; |
| 540 } | 541 } |
| 541 | 542 |
| 542 } // namespace device | 543 } // namespace device |
| OLD | NEW |