SetupDiSelectDevice function (setupapi.h)
The SetupDiSelectDevice function is the default handler for the DIF_SELECTDEVICE request.
Syntax
WINSETUPAPI BOOL SetupDiSelectDevice(
[in] HDEVINFO DeviceInfoSet,
[in, out] PSP_DEVINFO_DATA DeviceInfoData
);
Parameters
[in] DeviceInfoSet
A handle to a device information set that contains a device information element that represents the device for which to select a driver.
[in, out] DeviceInfoData
A pointer to an SP_DEVINFO_DATA structure that specifies the device information element. This parameter is optional and can be NULL. If this parameter is specified, SetupDiSelectDevice selects the driver for the specified device and sets DeviceInfoData.ClassGuid to the GUID of the device setup class for the selected driver. If this parameter is NULL, SetupDiSelectDevice sets the selected driver in the global class driver list for DeviceInfoSet.
Return value
The function returns TRUE if it is successful. Otherwise, it returns FALSE and the logged error can be retrieved by a call to GetLastError.
Remarks
SetupDiSelectDevice handles the user interface that allows the user to select a driver for the specified device, or a device information set if a device is not specified. By setting the Flags field of the SP_DEVINSTALL_PARAMS structure for the device, or the device information set if a device is not specified, the caller can specify special handling of the user interface, for example, to allow users to select a driver from an OEM installation disk.
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 |
DLL | Setupapi.dll |