I am attempting to list all devices currently plugged into the computer/laptop using Win32 API. When I say devices I mean; headphones, usb storage devices, HDMI connections(a TV or projector), a printer and etc.
Whats the best Native Win32 function to use to simply detect what devices are plugged in and what type they are?
Would the functions:
SetupDiClassGuidsFromNameA("Ports", 0, 0, &RequiredSize);
SetupDiClassGuidsFromNameA("Ports", (_GUID*)buf, RequiredSize*sizeof(GUID), &RequiredSize);
and
SetupDiEnumDeviceInfo(DeviceInfoSet,numDev,&DeviceInfoData);
be best?