SetupDiGetClassInstallParamsA function

The SetupDiGetClassInstallParams function retrieves class installation parameters for a device information set or a particular device information element.


WINSETUPAPI BOOL SetupDiGetClassInstallParamsA(
  HDEVINFO                DeviceInfoSet,
  PSP_DEVINFO_DATA        DeviceInfoData,
  DWORD                   ClassInstallParamsSize,
  PDWORD                  RequiredSize



A handle to a device information set that contains the class install parameters to retrieve.


A pointer to an SP_DEVINFO_DATA structure that specified a device information element in DeviceInfoSet. This parameter is optional and can be NULL. If this parameter is specified, SetupDiGetClassInstallParams retrieves the class installation parameters for the specified device. If this parameter is NULL, SetupDiGetClassInstallParams retrieves the class install parameters for the global class driver list that is associated with DeviceInfoSet.


A pointer to a buffer that contains an SP_CLASSINSTALL_HEADER structure. This structure must have its cbSize member set to sizeof(SP_CLASSINSTALL_HEADER) on input or the buffer is considered to be invalid. On output, the InstallFunction member is filled with the device installation function code for the class installation parameters being retrieved. If the buffer is large enough, it also receives the class installation parameters structure specific to the function code. If ClassInstallParams is not specified, ClassInstallParamsSize must be 0.


The size, in bytes, of the ClassInstallParams buffer. If the buffer is supplied, it must be at least as large as sizeof(SP_CLASSINSTALL_HEADER). If the buffer is not supplied, ClassInstallParamsSize must be 0.


A pointer to a variable of type DWORD that receives the number of bytes required to store the class install parameters. This parameter is optional and can be NULL.

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.


The class install parameters are specific to a particular device installation function code that is stored in the ClassInstallHeader field located at the beginning of the ClassInstallParams buffer.


Windows version Available in Microsoft Windows 2000 and later versions of Windows.
Target Platform Desktop
Header setupapi.h (include Setupapi.h)
Library Setupapi.lib

See Also