mirror of
https://github.com/reactos/reactos.git
synced 2024-11-18 13:01:40 +00:00
[DESK] Only try to restart graphic device after installation
If it fails, require a reboot. CORE-17675
This commit is contained in:
parent
a9a22aeffe
commit
a6005299c6
1 changed files with 25 additions and 7 deletions
|
@ -247,16 +247,34 @@ DisplayClassInstaller(
|
|||
/* FIXME: install OpenGLSoftwareSettings section */
|
||||
|
||||
/* Start the device */
|
||||
if (!SetupDiRestartDevices(DeviceInfoSet, DeviceInfoData))
|
||||
if (SetupDiRestartDevices(DeviceInfoSet, DeviceInfoData))
|
||||
{
|
||||
/* Reenumerate display devices ; this will rescan for potential new devices */
|
||||
DisplayDevice.cb = sizeof(DISPLAY_DEVICE);
|
||||
EnumDisplayDevices(NULL, 0, &DisplayDevice, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
rc = GetLastError();
|
||||
DPRINT1("SetupDiRestartDevices() failed with error 0x%lx\n", rc);
|
||||
goto cleanup;
|
||||
}
|
||||
DPRINT("SetupDiRestartDevices() failed with error 0x%lx. Will reboot later.\n", rc);
|
||||
|
||||
/* Reenumerate display devices ; this will rescan for potential new devices */
|
||||
DisplayDevice.cb = sizeof(DISPLAY_DEVICE);
|
||||
EnumDisplayDevices(NULL, 0, &DisplayDevice, 0);
|
||||
/* Mark device as needing a restart */
|
||||
InstallParams.cbSize = sizeof(InstallParams);
|
||||
if (!SetupDiGetDeviceInstallParams(DeviceInfoSet, DeviceInfoData, &InstallParams))
|
||||
{
|
||||
rc = GetLastError();
|
||||
DPRINT("SetupDiGetDeviceInstallParams() failed with error 0x%lx\n", rc);
|
||||
goto cleanup;
|
||||
}
|
||||
InstallParams.Flags |= DI_NEEDRESTART;
|
||||
result = SetupDiSetDeviceInstallParams(DeviceInfoSet, DeviceInfoData, &InstallParams);
|
||||
if (!result)
|
||||
{
|
||||
rc = GetLastError();
|
||||
DPRINT("SetupDiSetDeviceInstallParams() failed with error 0x%lx\n", rc);
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
rc = ERROR_SUCCESS;
|
||||
|
||||
|
|
Loading…
Reference in a new issue