BOOLEAN
SetupDiInstallDevice(
IN HDEVINFO DeviceInfoSet,
IN OUT PSP_DEVINFO_DATA DeviceInfoData
);
SetupDiInstallDevice is the default handler for the DIF_INSTALLDEVICE class installation request. It installs a device by calling the SetupInstallFromInfSection function for the Install section of the selected driver’s INF file.
The function returns TRUE if it is successful. Otherwise it returns FALSE and the logged error can be retrieved with a call to GetLastError.
After a device is installed by the SetupDiInstallDevice function, the device is started if possible. If, however, the DI_NEEDRESTART, DI_NEEDREBOOT, or DI_DONOTCALLCONFIGMG flag in the SP_DEVINSTALL_PARAMS structure is set, the device is not started.