mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[NEWDEV] When a device install fails, set the 'Unknown' device class for that device
CORE-17527
This commit is contained in:
parent
0e3fce082e
commit
3fa57b8ff7
1 changed files with 23 additions and 17 deletions
|
@ -87,6 +87,26 @@ SetFailedInstall(
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if (Set)
|
||||
{
|
||||
/* Set the 'Unknown' device class */
|
||||
PWSTR pszUnknown = L"Unknown";
|
||||
SetupDiSetDeviceRegistryPropertyW(DeviceInfoSet,
|
||||
DevInfoData,
|
||||
SPDRP_CLASS,
|
||||
(PBYTE)pszUnknown,
|
||||
(wcslen(pszUnknown) + 1) * sizeof(WCHAR));
|
||||
|
||||
PWSTR pszUnknownGuid = L"{4D36E97E-E325-11CE-BFC1-08002BE10318}";
|
||||
SetupDiSetDeviceRegistryPropertyW(DeviceInfoSet,
|
||||
DevInfoData,
|
||||
SPDRP_CLASSGUID,
|
||||
(PBYTE)pszUnknownGuid,
|
||||
(wcslen(pszUnknownGuid) + 1) * sizeof(WCHAR));
|
||||
|
||||
/* FIXME: Set device problem code 28 (CM_PROB_FAILED_INSTALL) */
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -213,7 +233,6 @@ FindDriverProc(
|
|||
IN LPVOID lpParam)
|
||||
{
|
||||
PDEVINSTDATA DevInstData;
|
||||
DWORD config_flags;
|
||||
BOOL result = FALSE;
|
||||
|
||||
DevInstData = (PDEVINSTDATA)lpParam;
|
||||
|
@ -227,22 +246,9 @@ FindDriverProc(
|
|||
else
|
||||
{
|
||||
/* Update device configuration */
|
||||
if (SetupDiGetDeviceRegistryProperty(
|
||||
DevInstData->hDevInfo,
|
||||
&DevInstData->devInfoData,
|
||||
SPDRP_CONFIGFLAGS,
|
||||
NULL,
|
||||
(BYTE *)&config_flags,
|
||||
sizeof(config_flags),
|
||||
NULL))
|
||||
{
|
||||
config_flags |= CONFIGFLAG_FAILEDINSTALL;
|
||||
SetupDiSetDeviceRegistryPropertyW(
|
||||
DevInstData->hDevInfo,
|
||||
&DevInstData->devInfoData,
|
||||
SPDRP_CONFIGFLAGS,
|
||||
(BYTE *)&config_flags, sizeof(config_flags));
|
||||
}
|
||||
SetFailedInstall(DevInstData->hDevInfo,
|
||||
&DevInstData->devInfoData,
|
||||
TRUE);
|
||||
|
||||
PostMessage(DevInstData->hDialog, WM_SEARCH_FINISHED, 0, 0);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue