locked
Getting Driver name and Friendly name

    Question

  • I have enumerated some printers using the WInRT device enumeration API Windows.Devices.Enumeration.DeviceInformation::FindAllAsync. The below is the sample dev node info of a particular dev node of a printer obtained using the device enumeration API.

    System.Devices.HardwareIds = XXXXXXXX

    System.Devices.CompatibleIds =  GenPrintQueue  SWD\GenericRaw  SWD\Generic 
    System.Devices.ContainerId =  {XXXXXXXX}
    System.Devices.DeviceCapabilities =  240
    System.Devices.DeviceInstanceId  =XXXXX
    System.ItemNameDisplay = XXXXXX

    Since each dev node of a device is related to some function( service)of the device, can we obtain the driver name and friendly name of  that particualr  dev node? 

    Monday, April 9, 2012 2:03 PM

Answers

  • A single device (and its driver) can implement more than one service (device interface) in PnP.  Printers are a special case where there is a one to one correspondence.

    It is possible to retrieve all of the information you mention.  You did not specify why you need the information so allow me make a few observations. 

    The best name to display to the user is System.ItemNameDisplay from the Device Container related to the Device or Device Interface.  This property takes into account custom names that the user may have assigned to the device and picks overall the best name to identify devices.  The DeviceInformation::Name property already contains the container’s System.ItemNameDisplay property since this is such a common thing to want to do for an device interface.

    System.ItemNameDisplay on the device corresponds to the friendly name assigned to the device, or the name from the INF if the friendly name does not exist. 

    If you always want the name from the INF for the matching driver, then the property is DEVPKEY_Device_DeviceDesc.  You will need to retrieve it using the GUID PID method.  See devpkey.h for the right guid pid value.

    • Proposed as answer by Bertus Greeff Monday, April 30, 2012 7:28 PM
    • Marked as answer by Bob_Bao Monday, May 7, 2012 3:21 AM
    Monday, April 30, 2012 7:28 PM

All replies

  • its_me_here,

    I will look into this for you.

    Best Wishes - Eric 

    Monday, April 9, 2012 5:11 PM
    Moderator
  • Is it possible to get these details via the GUID PID format?
    Monday, April 30, 2012 4:07 AM
  • A single device (and its driver) can implement more than one service (device interface) in PnP.  Printers are a special case where there is a one to one correspondence.

    It is possible to retrieve all of the information you mention.  You did not specify why you need the information so allow me make a few observations. 

    The best name to display to the user is System.ItemNameDisplay from the Device Container related to the Device or Device Interface.  This property takes into account custom names that the user may have assigned to the device and picks overall the best name to identify devices.  The DeviceInformation::Name property already contains the container’s System.ItemNameDisplay property since this is such a common thing to want to do for an device interface.

    System.ItemNameDisplay on the device corresponds to the friendly name assigned to the device, or the name from the INF if the friendly name does not exist. 

    If you always want the name from the INF for the matching driver, then the property is DEVPKEY_Device_DeviceDesc.  You will need to retrieve it using the GUID PID method.  See devpkey.h for the right guid pid value.

    • Proposed as answer by Bertus Greeff Monday, April 30, 2012 7:28 PM
    • Marked as answer by Bob_Bao Monday, May 7, 2012 3:21 AM
    Monday, April 30, 2012 7:28 PM