SetupDiGetClassInstallParamsA function (setupapi.h)
The SetupDiGetClassInstallParams function retrieves class installation parameters for a device information set or a particular device information element.
Syntax
WINSETUPAPI BOOL SetupDiGetClassInstallParamsA(
[in] HDEVINFO DeviceInfoSet,
[in, optional] PSP_DEVINFO_DATA DeviceInfoData,
[out, optional] PSP_CLASSINSTALL_HEADER ClassInstallParams,
[in] DWORD ClassInstallParamsSize,
[out, optional] PDWORD RequiredSize
);
Parameters
[in] DeviceInfoSet
A handle to a device information set that contains the class install parameters to retrieve.
[in, optional] DeviceInfoData
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.
[out, optional] ClassInstallParams
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.
[in] ClassInstallParamsSize
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.
[out, optional] RequiredSize
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.
Remarks
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.
Note
The setupapi.h header defines SetupDiGetClassInstallParams as an alias that automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that is not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
Requirements
Requirement | Value |
---|---|
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 |