SetupDiGetDeviceInfoListClass function (setupapi.h)

The SetupDiGetDeviceInfoListClass function retrieves the GUID for the device setup class associated with a device information set if the set has an associated class.


WINSETUPAPI BOOL SetupDiGetDeviceInfoListClass(
  [in]  HDEVINFO DeviceInfoSet,
  [out] LPGUID   ClassGuid


[in] DeviceInfoSet

A handle to the device information set to query.

[out] ClassGuid

A pointer to variable of type GUID that receives the GUID for the associated class.

Return value

The function returns TRUE if it is successful. Otherwise, it returns FALSE and the logged error can be retrieved with a call to GetLastError.


If the specified device information set does not have an associated class because a class GUID was not specified when the set was created with SetupDiCreateDeviceInfoList, the function fails. In this case, a call to GetLastError returns ERROR_NO_ASSOCIATED_CLASS.

If a device information set is for a remote computer, use SetupDiGetDeviceInfoListDetail to get the associated remote computer handle and computer name.


Minimum supported client Available in Microsoft Windows 2000 and later versions of Windows.
Target Platform Desktop
Header setupapi.h (include Setupapi.h)
Library Setupapi.lib
DLL Setupapi.dll

See also