SetupDiGetClassDevs

HDEVINFO
SetupDiGetClassDevs(
IN PGUID ClassGuid, /* optional */
IN PCTSTR Enumerator, /* optional */
IN HWND hwndParent, /* optional */
IN DWORD Flags
);

SetupDiGetClassDevs returns a device information set that contains all installed devices of a specified class.

Parameters

ClassGuid

Supplies a pointer to the class GUID to use when creating the list of devices. If the DIGCF_ALLCLASSES flag is set, this parameter is ignored and the resulting list contains all installed classes.

Enumerator

Supplies the name of the key under the Enum registry branch that contains device instances for which information is to be retrieved. If this parameter is not specified, device information is retrieved for all device instances in the entire Enum tree.

hwndParent

Supplies the handle of the top-level window to be used for any user interface relating to the members of this set.

Flags

Supplies control options used in building the device information set. Can be one of the following values:

DIGCF_PRESENT

Return only devices that are currently present.

DIGCF_ALLCLASSES

Return a list of installed devices for all classes. If this flag is set, the ClassGuid parameter is ignored.

DIGCF_PROFILE

Return only devices that are a part of the current hardware profile.

Return Value

If the function succeeds, it returns a handle to a device information set containing all installed devices matching the specified parameters.

If the function fails, it returns INVALID_HANDLE_VALUE. To get extended error information, call GetLastError.

See Also

SetupDiCreateDeviceInfoList, SetupDiDestroyDeviceInfoList