mirror of
https://github.com/reactos/reactos.git
synced 2025-04-04 04:26:32 +00:00
Avoid attempts to reinstall a driver on reboot when a previous attempt has already failed.
[NEWDEV] Set the CONFIGFLAG_FAILEDINSTALL flag in the new hardware wizards welcome page and remove it only when the driver was successfully installed. [UMPNPMGR] Do not invoke the device installer if the devices CONFIGFLAG_FAILEDINSTALL flag is set. svn path=/trunk/; revision=74348
This commit is contained in:
parent
1313fd5c76
commit
dd0e23b691
2 changed files with 65 additions and 2 deletions
|
@ -21,7 +21,7 @@
|
|||
* PROJECT: ReactOS kernel
|
||||
* FILE: base/services/umpnpmgr/umpnpmgr.c
|
||||
* PURPOSE: User-mode Plug and Play manager
|
||||
* PROGRAMMER: Eric Kohl
|
||||
* PROGRAMMER: Eric Kohl (eric.kohl@reactos.org)
|
||||
* Hervé Poussineau (hpoussin@reactos.org)
|
||||
* Colin Finck (colin@reactos.org)
|
||||
*/
|
||||
|
@ -3230,6 +3230,22 @@ InstallDevice(PCWSTR DeviceInstance, BOOL ShowWizard)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
BytesWritten = sizeof(DWORD);
|
||||
if (RegQueryValueExW(DeviceKey,
|
||||
L"ConfigFlags",
|
||||
NULL,
|
||||
NULL,
|
||||
(PBYTE)&Value,
|
||||
&BytesWritten) == ERROR_SUCCESS)
|
||||
{
|
||||
if (Value & CONFIGFLAG_FAILEDINSTALL)
|
||||
{
|
||||
DPRINT("No need to install: %S\n", DeviceInstance);
|
||||
RegCloseKey(DeviceKey);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
RegCloseKey(DeviceKey);
|
||||
}
|
||||
|
||||
|
|
|
@ -51,6 +51,44 @@ CenterWindow(
|
|||
SWP_NOSIZE);
|
||||
}
|
||||
|
||||
static BOOL
|
||||
SetFailedInstall(
|
||||
IN HDEVINFO DeviceInfoSet,
|
||||
IN PSP_DEVINFO_DATA DevInfoData OPTIONAL,
|
||||
IN BOOLEAN Set)
|
||||
{
|
||||
DWORD dwType, dwSize, dwFlags = 0;
|
||||
|
||||
dwSize = sizeof(dwFlags);
|
||||
if (!SetupDiGetDeviceRegistryProperty(DeviceInfoSet,
|
||||
DevInfoData,
|
||||
SPDRP_CONFIGFLAGS,
|
||||
&dwType,
|
||||
(PBYTE)&dwFlags,
|
||||
dwSize,
|
||||
&dwSize))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (Set)
|
||||
dwFlags |= CONFIGFLAG_FAILEDINSTALL;
|
||||
else
|
||||
dwFlags &= ~CONFIGFLAG_FAILEDINSTALL;
|
||||
|
||||
if (!SetupDiSetDeviceRegistryProperty(DeviceInfoSet,
|
||||
DevInfoData,
|
||||
SPDRP_CONFIGFLAGS,
|
||||
(PBYTE)&dwFlags,
|
||||
dwSize))
|
||||
{
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL
|
||||
CanDisableDevice(
|
||||
IN DEVINST DevInst,
|
||||
|
@ -462,6 +500,10 @@ WelcomeDlgProc(
|
|||
BM_SETCHECK,
|
||||
(WPARAM)TRUE,
|
||||
(LPARAM)0);
|
||||
|
||||
SetFailedInstall(DevInstData->hDevInfo,
|
||||
&DevInstData->devInfoData,
|
||||
TRUE);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -807,8 +849,13 @@ InstallDrvDlgProc(
|
|||
hThread = 0;
|
||||
if (wParam == 0)
|
||||
{
|
||||
/* Should we reboot? */
|
||||
SP_DEVINSTALL_PARAMS installParams;
|
||||
|
||||
SetFailedInstall(DevInstData->hDevInfo,
|
||||
&DevInstData->devInfoData,
|
||||
FALSE);
|
||||
|
||||
/* Should we reboot? */
|
||||
installParams.cbSize = sizeof(SP_DEVINSTALL_PARAMS);
|
||||
if (SetupDiGetDeviceInstallParams(
|
||||
DevInstData->hDevInfo,
|
||||
|
|
Loading…
Reference in a new issue