https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3fa57b8ff7fcee47b8e2e…
commit 3fa57b8ff7fcee47b8e2ed869aecaf4515603f3f
Author: Eric Kohl <eric.kohl(a)reactos.org>
AuthorDate: Thu Apr 15 21:49:32 2021 +0200
Commit: Eric Kohl <eric.kohl(a)reactos.org>
CommitDate: Thu Apr 15 21:49:32 2021 +0200
[NEWDEV] When a device install fails, set the 'Unknown' device class for that
device
CORE-17527
---
dll/win32/newdev/wizard.c | 40 +++++++++++++++++++++++-----------------
1 file changed, 23 insertions(+), 17 deletions(-)
diff --git a/dll/win32/newdev/wizard.c b/dll/win32/newdev/wizard.c
index 739795fef6e..9cf56a74c48 100644
--- a/dll/win32/newdev/wizard.c
+++ b/dll/win32/newdev/wizard.c
@@ -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);
}