SP_CLASSINSTALL_HEADER structure (setupapi.h)
An SP_CLASSINSTALL_HEADER is the first member of any class install parameters structure. It contains the device installation request code that defines the format of the rest of the install parameters structure.
Syntax
typedef struct _SP_CLASSINSTALL_HEADER {
DWORD cbSize;
DI_FUNCTION InstallFunction;
} SP_CLASSINSTALL_HEADER, *PSP_CLASSINSTALL_HEADER;
Members
cbSize
The size, in bytes, of the SP_CLASSINSTALL_HEADER structure.
InstallFunction
The device installation request (DIF code) for the class install parameters structure.
DIF codes have the format DIF_XXX and are defined in Setupapi.h. See Device Installation Function Codes for a complete description of DIF codes.
Remarks
When a component allocates a class install parameters structure, it typically initializes the header fields of the structure. Such a component sets the InstallFunction member to the DIF code for the installation request and sets cbSize to the size of the SP_CLASSINSTALL_HEADER structure. For example:
SP_REMOVEDEVICE_PARAMS RemoveDeviceParams;
RemoveDeviceParams.ClassInstallHeader.cbSize = sizeof(SP_CLASSINSTALL_HEADER);
RemoveDeviceParams.ClassInstallHeader.InstallFunction = DIF_REMOVE;
A component must set the InstallFunction member before passing a class install parameters structure to SetupDiSetClassInstallParams.
However, a component does not have to set this field when passing class install parameters to SetupDiGetClassInstallParams. This function sets the InstallFunction member in the structure it passes back to the caller. It sets InstallFunction to the DIF_XXX code for the currently active device installation request.
Requirements
Requirement | Value |
---|---|
Header | setupapi.h (include Setupapi.h) |