ntoskrnl: Set SPDRP_CONFIGFLAGS in install_device_driver().

This commit is contained in:
Zebediah Figura 2022-11-16 19:53:54 -06:00 committed by Alexandre Julliard
parent b682102db4
commit f801ac97fb
2 changed files with 12 additions and 6 deletions

View file

@ -256,6 +256,7 @@ static BOOL install_device_driver( DEVICE_OBJECT *device, HDEVINFO set, SP_DEVIN
DIF_INSTALLDEVICE,
DIF_NEWDEVICEWIZARD_FINISHINSTALL,
};
static const DWORD config_flags = 0;
NTSTATUS status;
unsigned int i;
@ -281,6 +282,14 @@ static BOOL install_device_driver( DEVICE_OBJECT *device, HDEVINFO set, SP_DEVIN
sizeof_multiszW( ids ) * sizeof(WCHAR) );
ExFreePool( ids );
/* Set the config flags. setupapi won't do this for us if we couldn't find
* a driver to install, but raw devices should still have this key
* populated. */
if (!SetupDiSetDeviceRegistryPropertyW( set, sp_device, SPDRP_CONFIGFLAGS,
(BYTE *)&config_flags, sizeof(config_flags) ))
ERR("Failed to set config flags, error %#lx.\n", GetLastError());
if (!SetupDiBuildDriverInfoList( set, sp_device, SPDIT_COMPATDRIVER ))
{
ERR("Failed to build compatible driver list, error %#lx.\n", GetLastError());

View file

@ -1633,12 +1633,9 @@ static void test_pnp_devices(void)
ret = SetupDiGetDeviceRegistryPropertyA(set, &device, SPDRP_CONFIGFLAGS,
&type, (BYTE *)&dword, sizeof(dword), NULL);
todo_wine ok(ret, "got error %#lx\n", GetLastError());
if (ret)
{
ok(!dword, "got flags %#lx\n", dword);
ok(type == REG_DWORD, "got type %lu\n", type);
}
ok(ret, "got error %#lx\n", GetLastError());
ok(!dword, "got flags %#lx\n", dword);
ok(type == REG_DWORD, "got type %lu\n", type);
ret = SetupDiGetDeviceRegistryPropertyA(set, &device, SPDRP_DEVTYPE,
&type, (BYTE *)&dword, sizeof(dword), NULL);