title: Trying to uniquely ID a USB device from WMI query using DeviceID field
body: <p>When WMI is queried and returns a list of devices, I've noted some information at the END of the DeviceID string that isn't documented anywhere I've looked so far. Here's an example of a DeviceID string returned from a WMI query looking at <strong>Win32_PnPEntity</strong>:</p>
  
  <p><strong>USB\VID_046D&amp;PID_082D&amp;MI_00\7&amp;3538A2BF&amp;0&amp;0000</strong></p>
  
  <p>Now, the first two parts - both the 'USB' and the VID and PID are really well documented, as is the 'interface number' - the &amp;MI_XX.  However, the last part of the string (shown below) isn't documented anywhere I've looked. I don't even know what to call this part of the DeviceID string: </p>
  
  <p><strong>\7&amp;3538A2BF&amp;0&amp;0000</strong></p>
  
  <p>Curiously, it comes in several flavors. I've noted that if I have two identical devices plugged into the PC, I'll get different values, which I've defaulted to calling 'instance id's' for lack of better documented reference info. Here's what I see when I have two identical USB Web cameras plugged into my PC:</p>
  
  <p><strong>USB\VID_046D&amp;PID_082D&amp;MI_00\6&amp;DB509D0&amp;0&amp;0000</strong>
  <strong>USB\VID_046D&amp;PID_082D&amp;MI_00\7&amp;3538A2BF&amp;0&amp;0000</strong></p>
  
  <p>So far, so good. I can pick out that I have two identical devices plugged into the PC and can parse against these unique values.  But wait! When the OS sees these devices, it also loads anything the drivers offers for different 'interfaces' or modes of operation, so along with the above entries when I make a WMI query against <strong>Win32_PnPEntity</strong>, I also get these nice entries in the DeviceID field as well:</p>
  
  <p><strong>USB\VID_046D&amp;PID_082D\195825EF</strong></p>
  
  <p><strong>USB\VID_046D&amp;PID_082D\36149BBF</strong></p>
  
  <p>So the problem is that without documentation that describes what this last part of the DeviceID is, I don't know to expect, and can't associate or separate these 'duplicate' entries from their brethren in the query results. </p>
  
  <p><strong><em>The goal</em></strong> is to be able to scan through the WMI result, identify ONE 'primary' entry for a given device and discard anything else. I could likely HACK the filtering by looking for "USB Composite Device" in the Description field, but this is rather ugly and would discard some devices that do not have an appropriate or vendor-specified 'description.'</p>
  
  <p>MSDN only provides that the DeviceID is a "Unique identifier of the USB controller. This property is inherited from CIM_LogicalDevice." -- and CIM_LogicalDevice doesn't detail the makeup of this field either. </p>
  
  <p>Anyone been down this path or know which hole to look in? Similar questions in here and in other forums remain unanswered. (Hey M$, Why is this so %$@#! mystical???)</p>