Skip to content

Commit

Permalink
Merge pull request #39 from elfmimi/singular-guid
Browse files Browse the repository at this point in the history
windows: Also try to read DeviceInterfaceGUID
  • Loading branch information
kevinmehall authored Feb 25, 2024
2 parents 6668fa1 + cd4aed7 commit e19bb41
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/platform/windows_winusb/enumeration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,17 @@ fn probe_interface(cdev: DevInst) -> Option<(u8, WCString)> {
let reg_key = cdev.registry_key().unwrap();
let guid = match reg_key.query_value_guid("DeviceInterfaceGUIDs") {
Ok(s) => s,
Err(e) => {
error!("Failed to get DeviceInterfaceGUIDs from registry: {e}");
return None;
}
Err(e) => match reg_key.query_value_guid("DeviceInterfaceGUID") {
Ok(s) => s,
Err(f) => {
if e.kind() == f.kind() {
error!("Failed to get DeviceInterfaceGUID or DeviceInterfaceGUIDs from registry: {e}");
} else {
error!("Failed to get DeviceInterfaceGUID or DeviceInterfaceGUIDs from registry: {e}, {f}");
}
return None;
}
},
};

let paths = cdev.interfaces(guid);
Expand Down

0 comments on commit e19bb41

Please sign in to comment.