c# - Get parent device -
i have 2 usb device ids, e.g. usb\vid_e4f1&pid_0661\00000115fa9ce7750000000000000000
, usb\vid_e4f1&pid_0661&mi_00\7&b5a5ddf&0&0000
how verify device #2 direct child of device #1 (physically they’re different parts of same usb composite device)?
in real-life scenarios many of them connected same usb controller. moreover, it's possible they'll of same maker , model. that's why cant verify vid, pid, , use win32_usbcontrollerdevice
wmi query verify they're plugged same usb controller - need somehow verify parent-child relation, not fact they're plugged same controller.
if matters, need support windows 8+.
the pnp configuration manager api friend here:
cm_locate_devnode opens device handle given device id;
cm_get_parent finds parent device;
cm_get_device_id_size , cm_get_device_id take device handle , return device id.
Comments
Post a Comment