Reputation: 70
The Windows.Devices.Enumeration namespace has functionality for watching device arrivals and utilizes the DeviceInformation class in the event callback to expose information about which device has arrived.
The DeviceInformation class exposes some properties of the device interface detected, including an 'Id' property which is supposedly the System.Devices.DeviceInstanceId property, which is described as 'The identity of the device. This is also the value of DeviceInformation.Id.'
I expected this value to be a Device Instance Id, as that is what it is named. However, it does not seem to conform to the same format or include the same information as other Device Instance ID's elsewhere on Windows.
The device I am capturing is a removable disk drive over SCSI, plugged in via thunderbolt. When utilizing WMI to capture Win32_PnPEntity classes corresponding to the disk PNP entity, it's device ID does not resemble the System.Devices.DeviceInstanceId from the WinRT API.
My application requires me to be able to correlate the device received from the WinRT API with the equivalent device in WMI. I am aware that you can process device arrivals with a WMI callback as well, however that is not appropriate for the context of the code used in device arrivals versus what is consuming them.
I am looking for a direct way to go from the DeviceInformation object received to a concrete WMI object. I am hoping that I will not have to iterate over all WMI objects but that may also be an acceptable solution if it's necessary.
I can update with more details and clarification if this is not clear.
Upvotes: 0
Views: 134