The SetupDiEnumDeviceInfo function returns a context structure for a device information element of a device information set. Each call returns information about one device; the function can be called repeatedly to get information about several devices.
WINSETUPAPI BOOL WINAPI
SetupDiEnumDeviceInfo(
IN HDEVINFO DeviceInfoSet,
IN DWORD MemberIndex,
OUT PSP_DEVINFO_DATA DeviceInfoData
);
The function returns TRUE if it is successful. Otherwise, it returns FALSE and the logged error can be retrieved with a call to GetLastError.
Declared in setupapi.h. Include setupapi.h.
To enumerate device information elements, an installer should initially call SetupDiEnumDeviceInfo with the MemberIndex parameter set to 0. The installer should then increment MemberIndex and call SetupDiEnumDeviceInfo until there are no more values (the function fails and a call to GetLastError returns ERROR_NO_MORE_ITEMS).
Call SetupDiEnumDeviceInterfaces to get a context structure for a device interface element (versus a device information element).
SetupDiCreateDeviceInfo, SetupDiDeleteDeviceInfo, SetupDiEnumDeviceInterfaces, SetupDiOpenDeviceInfo, SP_DEVINFO_DATA