Module: wine Branch: master Commit: f801ac97fbcbef5618eadf1fb922a2d0f0873c4d URL: https://gitlab.winehq.org/wine/wine/-/commit/f801ac97fbcbef5618eadf1fb922a2d...
Author: Zebediah Figura zfigura@codeweavers.com Date: Wed Nov 16 19:53:54 2022 -0600
ntoskrnl: Set SPDRP_CONFIGFLAGS in install_device_driver().
---
dlls/ntoskrnl.exe/pnp.c | 9 +++++++++ dlls/ntoskrnl.exe/tests/ntoskrnl.c | 9 +++------ 2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/dlls/ntoskrnl.exe/pnp.c b/dlls/ntoskrnl.exe/pnp.c index a70190db7ce..7c77a9a7145 100644 --- a/dlls/ntoskrnl.exe/pnp.c +++ b/dlls/ntoskrnl.exe/pnp.c @@ -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()); diff --git a/dlls/ntoskrnl.exe/tests/ntoskrnl.c b/dlls/ntoskrnl.exe/tests/ntoskrnl.c index d2e02c7c130..02af7ca230b 100644 --- a/dlls/ntoskrnl.exe/tests/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/tests/ntoskrnl.c @@ -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);