SetupDiBuildClassInfoList function

The SetupDiBuildClassInfoList function returns a list of setup class GUIDs that identify the classes that are installed on a local computer.


WINSETUPAPI BOOL SetupDiBuildClassInfoList(
  DWORD  Flags,
  LPGUID ClassGuidList,
  DWORD  ClassGuidListSize,
  PDWORD RequiredSize



Flags used to control exclusion of classes from the list. If no flags are specified, all setup classes are included in the list. Can be a combination of the following values:


Exclude a class if it has the NoInstallClass value entry in its registry key.


Exclude a class if it has the NoDisplayClass value entry in its registry key.


A pointer to a GUID-typed array that receives a list of setup class GUIDs. This pointer is optional and can be NULL.


The number of GUIDs in the array that is pointed to by the ClassGuildList parameter. If ClassGuidList is NULL, ClassGuidSize must be zero.


A pointer to a DWORD-typed variable that receives the number of GUIDs that are returned (if the number is less than or equal to the size, in GUIDs, of the array that is pointed to by the ClassGuidList parameter).

If this number is greater than the size of the ClassGuidList array, it indicates how large the ClassGuidList array must be in order to contain all the class GUIDs.

Return Value

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


To retrieve the number of classes that are installed on a local computer, call SetupDiBuildClassInfoList with ClassGuidList set to NULL and ClassGuidSize set to zero. In response to such a call, the function returns the number of classes in *RequiredSize.

SetupDiBuildClassInfoList does not return a class GUID for a class if the NoUseClass value entry exists in the registry key of the class.

To retrieve the list of setup class GUIDs installed on a remote system use SetupDiBuildClassInfoListEx.


Windows version 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