I have have already completed my training
How to get "FriendlyName" of a Device ContainerID (SPDRP_BASE_CONTAINERID)
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
eg:
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,
SPDRP_BASE_CONTAINERID, out _, sb, BUFSIZE, out _))
{
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")
7 answers
Sort by: Most helpful
-
-
ABDUS SAMAD 0 Reputation points
2023-11-23T23:09:59.3333333+00:00 Hybrid learning and lavenir I'd 7435.AbdusSamad@lavenir.cc