BOOLEAN
SetupDiRemoveDevice(
IN HDEVINFO DeviceInfoSet,
IN PSP_DEVINFO_DATA DeviceInfoData
);
SetupDiRemoveDevice is the default handler for the DIF_REMOVE installation request. It removes a device from the system.
The function returns TRUE if it is successful. Otherwise it returns FALSE and the logged error can be retrieved by a call to GetLastError.
This function removes the device from the system. It deletes both of the device's registry keys and dynamically stops the device if its DevInst is active. If the device cannot be dynamically stopped, flags are set in the Install Parameter block of the device information set that eventually cause the user to be prompted to shut down the system. Device removal is either global to all hardware profiles or specific to one hardware profile as specified by the ClassInstallParams field of the structure.