I am developing custom HID device. I can see the name in device manager (MyCustomDevice). However when I find the device using DeviceWatcher
, the DeviceInformation.Name
property has value Unknown USB Device (Port Reset Failed)
. Other applications using WIN32 apis can get correct name of device without problem.
My code:
// Selector for enabled HID devices
string selector = "System.Devices.InterfaceClassGuid:="{4D1E55B2-F16F-11CF-88CB-001111000030}" AND System.Devices.InterfaceEnabled:=System.StructuredQueryType.Boolean#True";
_watcher = DeviceInformation.CreateWatcher(selector, properties);
_watcher.Added += (s, deviceInformation) => {
Console.WriteLine(deviceInformation.Name); // prints "Unknown USB Device (Port Reset Failed)"
};
Device functions correctly, I can communicate with it - the only problem is this Name
. Is there possibility to fix it other than going back to WIN32?
To clarify things:
The device uses standard hidusb.sys
driver, and there are no yellow exclamation marks in device manager.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…