- Device Installations and System Restarts
- Avoiding System Restarts during Device Installations and Driver Updates
- Minimizing restarts when updating file-backed drivers
- DevCon Restart
- Parameters
- Comments
- How to restart Graphics Driver in Windows 10
- Restart Graphics Driver in Windows 10
- 1] Restart Graphics Driver using Win+Ctrl+Shift+B Shortcut
- 2] Remove & Update corrupt Display or Graphics Driver
- A] Uninstall the drivers using Device Manager
- B] Uninstall the drivers from Control Panel
- Как исправить ошибку thread stuck in device driver в Windows 10, 4 способа
- Что это за ошибка?
- Как исправить «thread_stuck_in_device_driver» в Windows 10
- Обновление BIOS
- Проверка актуальности драйверов видеокарты
- Замена видеокарты
- Отключение аппаратного ускорения
Device Installations and System Restarts
Device installations should not force the user to restart the system unless absolutely necessary. The following circumstances are the only ones for which a system restart should be necessary:
Installing or removing a non-Plug and Play device.
For these earlier devices, a user typically must shut down the system before physically adding or removing the device. After the power is turned back on, the system starts.
NoteВ В The device’s setup files should not initiate a system restart, regardless of whether the user installs the drivers before or after plugging in the hardware.
Updating a driver for a system boot device.
If a device can potentially hold the system’s paging, hibernation, or crash dump file, its drivers must service IRP_MN_DEVICE_USAGE_NOTIFICATION requests. The system sends this request before putting one of these files on the disk. If the drivers succeed the request, they must fail any subsequent IRP_MN_QUERY_REMOVE_DEVICE requests. When a driver for the device fails an IRP_MN_QUERY_REMOVE_DEVICE request, the system prompts the user to restart the system.
NoteВ В The device’s setup files should not initiate a system restart.
Installing a non-WDM filter driver.
If a filter driver is added to a non-WDM driver stack, the system must be restarted. In this case, the driver’s installer or co-installer should request a system restart (see Initiating System Restarts During Device Installations).
NoteВ В Adding a filter driver to a WDM driver stack does not require a system restart, unless an underlying device is a system boot device.
Avoiding System Restarts during Device Installations and Driver Updates
To avoid system restarts during device installations, use the following rules:
Never use Reboot or Restart entries in INF DDInstall sections. These directives were originally provided for compatibility with Windows 9x/Me and should not be used for Windows 2000 and later versions of Windows.
Do not use COPYFLG_FORCE_FILE_IN_USE, or COPYFLG_REPLACE_BOOT_FILE flags with INF CopyFiles directives, unless absolutely necessary.
Assign a new file name to each new version of a class installer or co-installer, or a service DLL. This avoids the need for a system restart if an older version is in use. (In fact, if a new file name is not used for an updated class installer or class co-installer, these new files will not be used for the installation.)
To update a device’s drivers, follow the rules that are listed under Updating Driver Files.
Minimizing restarts when updating file-backed drivers
Prior to WindowsВ 10, all kernel-mode drivers were backed by the system’s paging file. As a result, a driver binary could be overwritten on disk even while the driver was running.
To improve performance, starting with WindowsВ 10, most non-boot-start drivers are instead backed by the driver binary on disk.
Driver start types that are now file-backed include:
- SERVICE_SYSTEM_START (0x00000001)
- SERVICE_AUTO_START (0x00000002)
- SERVICE_DEMAND_START (0x00000003)
Boot start drivers continue to be backed by the paging file.
To update a file-backed driver, use the following best practices. Otherwise, the update might require two restarts, one to replace the file and a second to load the new version of the driver.
If you are using an INF file, follow these steps:
Modify your driver INF file’s CopyFiles section to use COPYFLG_IN_USE_RENAME, as follows:
If you use this flag, Windows attempts to replace the driver file on disk. For more info, see INF CopyFiles Directive.
If the INF is for a PnP driver, during device installation Windows attempts to unload the running driver and restart the devices that use it, in order to pick up the new version of the driver. If that fails, device installation indicates that the system should be rebooted.
If the INF is not for a PnP driver and you are using a method such as InstallHInfSection to process the INF, then manually stop and restart the driver:
Close all open handles to the driver and then stop the driver using one of the following:
- sc.exe stop
- ControlService(SERVICE_CONTROL_STOP)
If you are not using an INF file, use these steps:
- Stop the driver, as described above. Replace the old driver binary file with the new one.
- If you can’t stop the driver, rename the existing file, copy the new file into place, and set up the existing file to be deleted in the future (for example, using MoveFileEx with the MOVEFILE_DELAY_UNTIL_REBOOT flag). In order to start using the new version of the driver, the system will need to be restarted.
DevCon Restart
Stops and restarts the specified devices. Valid only on the local computer.
Parameters
/r Conditional reboot. Reboots the system after completing an operation only if a reboot is required to make a change effective.
* Represents all devices on the computer.
ID Specifies all or part of a hardware ID, compatible ID, or device instance ID of a device. When specifying multiple IDs, type a space between each ID. IDs that include an ampersand character (&) must be enclosed in quotation marks.
The following special characters modify the ID parameter.
Character | Description |
---|---|