look up SetupDiChangeState function in MSDN, pay attention to DICS_DISABLE flag. Disables the device. If the device is disableable but this function cannot disable the device dynamically, this function s the device to be disabled the next time the machine reboots.
Disables the device. If the device is disableable but this function cannot disable the device dynamically, this function s the device to be disabled the next time the machine reboots.