From 65646a75a227b39d4467931840b439c3ca4cd5d6 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Fri, 25 Dec 2020 19:14:09 +0100 Subject: [PATCH] [DEVMGR] Report property changes by the device manager to the installer --- dll/win32/devmgr/properties/advprop.cpp | 31 +++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/dll/win32/devmgr/properties/advprop.cpp b/dll/win32/devmgr/properties/advprop.cpp index 27cd2faad2a..37c7d7ce4d2 100644 --- a/dll/win32/devmgr/properties/advprop.cpp +++ b/dll/win32/devmgr/properties/advprop.cpp @@ -3035,6 +3035,37 @@ Cleanup: } } + if (Ret != 1) + { + SP_DEVINSTALL_PARAMS_W DeviceInstallParams; + + DeviceInstallParams.cbSize = sizeof(DeviceInstallParams); + if (SetupDiGetDeviceInstallParamsW(DeviceInfoSet, + DeviceInfoData, + &DeviceInstallParams)) + { + SP_PROPCHANGE_PARAMS PropChangeParams; + PropChangeParams.ClassInstallHeader.cbSize = sizeof(PropChangeParams.ClassInstallHeader); + PropChangeParams.ClassInstallHeader.InstallFunction = DIF_PROPERTYCHANGE; + PropChangeParams.Scope = DICS_FLAG_GLOBAL; + PropChangeParams.StateChange = DICS_PROPCHANGE; + + SetupDiSetClassInstallParamsW(DeviceInfoSet, + DeviceInfoData, + (PSP_CLASSINSTALL_HEADER)&PropChangeParams, + sizeof(PropChangeParams)); + + SetupDiCallClassInstaller(DIF_PROPERTYCHANGE, + DeviceInfoSet, + DeviceInfoData); + + DeviceInstallParams.FlagsEx &= ~DI_FLAGSEX_PROPCHANGE_PENDING; + SetupDiSetDeviceInstallParamsW(DeviceInfoSet, + DeviceInfoData, + &DeviceInstallParams); + } + } + if (DevAdvPropInfo != NULL) { if (DevAdvPropInfo->FreeDevPropSheets)