From 63acafc433cd1aae3bf2fa313259f75a120a6f10 Mon Sep 17 00:00:00 2001 From: 13038267101 Date: Thu, 20 Apr 2023 18:45:15 +0800 Subject: [PATCH] =?UTF-8?q?name=20=E4=BD=BF=E7=94=A8root=E4=BC=9A=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E4=B8=80=E4=B8=AAio=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- device/win_usb/win_usb.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/device/win_usb/win_usb.cpp b/device/win_usb/win_usb.cpp index 2a2a027..d6e6952 100644 --- a/device/win_usb/win_usb.cpp +++ b/device/win_usb/win_usb.cpp @@ -552,7 +552,7 @@ int usb_device::open(libusb_device_handle** dev_handle) std::string fmt("\\%d"), root(""); if (udev_.driver_key.length()) - root = usb_device::usb_scan_name(udev_.driver_key.c_str()); + root = usb_device::usb_scan_name(udev_.driver_key.c_str());//name使用root时会导致 IO一个异常 if (root.empty()) { VLOG_MINI_1(LOG_LEVEL_WARNING, "Cannot find '\\\\.\\Usbscan' name for '%s', try run in Administrator!\r\n", udev_.name.c_str()); @@ -563,7 +563,7 @@ int usb_device::open(libusb_device_handle** dev_handle) { VLOG_MINI_2(LOG_LEVEL_WARNING, "Nice: '%s' for '%s'.\r\n", root.c_str(), udev_.name.c_str()); } - h = open_usb(root.c_str()); + h = open_usb(udev_.name.c_str()); if (h == INVALID_HANDLE_VALUE) { *dev_handle = NULL;