SetupDiSetClassInstallParams

BOOLEAN
SetupDiSetClassInstallParams(
IN HDEVINFO DeviceInfoSet,
IN PSP_DEVINFO_DATA DeviceInfoData, /* optional */
IN PSP_CLASSINSTALL_HEADER ClassInstallParams, /* optional */
IN DWORD ClassInstallParamsSize
);

SetupDiSetClassInstallParams sets or clears class install parameters for a device information set or a particular device information element.

Parameters

DeviceInfoSet

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

DeviceInfoData

Supplies a pointer to an SP_DEVINFO_DATA structure that contains the class install parameters to set. If DeviceInfoData is not specified, the class install parameters to set are associated with the device information set.

ClassInstallParams

Supplies a pointer to a buffer that contains the new class install parameters to use. The SP_CLASSINSTALL_HEADER structure at the beginning of this buffer must have its cbSize field set to sizeof(SP_CLASSINSTALL_HEADER) and the InstallFunction field must be set to the DI_FUNCTION code that reflects the type of parameters contained in the rest of the buffer.

If ClassInstallParams is not specified, the current class install parameters, if any, are cleared for the specified device information set or element.

ClassInstallParamsSize

Supplies the size, in bytes, of the ClassInstallParams buffer. If the buffer is not supplied (that is, the class install parameters are being cleared), ClassInstallParamsSize must be 0.

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.

Comments

All parameters are validated before any changes are made. Therefore, a return value of FALSE indicates that no parameters where modified.

A consequence of setting class install parameters is that the DI_CLASSINSTALLPARAMS flag is set. If the caller wants to set the parameters, but disable their use, this flag must be cleared by a call to SetupDiSetDeviceInstallParams.

If the class install parameters are cleared, the DI_CLASSINSTALLPARAMS flag is reset.

See Also

SetupDiGetClassInstallParams, SetupDiSetDeviceInstallParams