BOOLEAN
SetupDiSetSelectedDriver(
IN HDEVINFO DeviceInfoSet,
IN PSP_DEVINFO_DATA DeviceInfoData, /* optional */
IN OUT PSP_DRVINFO_DATA DriverInfoData /* optional */
);
SetupDiSetSelectedDriver sets the specified member of a driver list as the currently-selected driver. It can also be used to reset the driver list so that there is no currently-selected driver.
If the Reserved field of the SP_DEVINFO_DATA structure is 0, the caller is requesting a search for a driver node with the specified parameters (DriverType, Description, and ProviderName). If a match is found, that driver node is selected. The Reserved field is updated on output to reflect the actual driver node where the match was found. If a match is not found, the function fails and a call to GetLastError returns ERROR_INVALID_PARAMETER.
The function returns TRUE if it is successful. Otherwise it returns FALSE and the logged error can be retrieved with a call to GetLastError.