How to get "FriendlyName" of a Device ContainerID (SPDRP_BASE_CONTAINERID)

Greg Visser 11 Reputation points

I want to get the "FriendlyName" of a device containerID.

For example, when you open Device Manager, View => Devices By Container, each container has a friendly name. I can get the container GUID, but do not know how to get the friendly name. In the picture below, you can see the "Logitech Unifying Receiver" container name that contains all the HID devices.


To get the Container ID GUID to list all associated devices, i'm using SetupDi


Guid guid = Guid.Empty;  
IntPtr infoList = SetupDiGetClassDevs(ref guid, null, IntPtr.Zero, DIGCF_PRESENT | DIGCF_ALLCLASSES);  
for (uint i = 0; SetupDiEnumDeviceInfo(infoList, i, out spDevInfo); i++)  
    if (SetupDiGetDeviceRegistryPropertyW(infoList, ref spDevInfo,   
          dev.ContainerId = sb.ToString();  

dev.ContainerId will now be a unique GUID.

Using this containerid, I'm able to group all the devices that belong to this container. I cannot find how to retreive the friendly name of this container (such as the "Logitech Unifying Receiver")

Windows Hardware Performance
Windows Hardware Performance
Windows: A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.Hardware Performance: Delivering / providing hardware or hardware systems or adjusting / adapting hardware or hardware systems.
1,567 questions
0 comments No comments
{count} vote

7 answers

Sort by: Most helpful
  1. ABDUS SAMAD 0 Reputation points

    I have have already completed my training

    0 comments No comments

  2. ABDUS SAMAD 0 Reputation points

    Hybrid learning and lavenir I'd

    0 comments No comments