Module: wine Branch: master Commit: b682102db4f685a818bbc9203f1f591c17e0a897 URL: https://gitlab.winehq.org/wine/wine/-/commit/b682102db4f685a818bbc9203f1f591...
Author: Zebediah Figura zfigura@codeweavers.com Date: Wed Nov 16 19:50:46 2022 -0600
setupapi: Set SPDRP_CONFIGFLAGS in SetupDiInstallDevice().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53387
---
dlls/ntoskrnl.exe/tests/ntoskrnl.c | 9 +++------ dlls/setupapi/devinst.c | 5 +++++ 2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/dlls/ntoskrnl.exe/tests/ntoskrnl.c b/dlls/ntoskrnl.exe/tests/ntoskrnl.c index 948253608ae..d2e02c7c130 100644 --- a/dlls/ntoskrnl.exe/tests/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/tests/ntoskrnl.c @@ -1820,12 +1820,9 @@ static void test_pnp_driver(struct testsign_context *ctx)
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);
/* Tests. */
diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index 896e77d9b38..ef7b4dccf0d 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -5163,6 +5163,7 @@ BOOL WINAPI SetupDiInstallDevice(HDEVINFO devinfo, SP_DEVINFO_DATA *device_data) static const WCHAR addserviceW[] = {'A','d','d','S','e','r','v','i','c','e',0}; static const WCHAR rootW[] = {'r','o','o','t','\',0}; WCHAR section_ext[LINE_LEN], subsection[LINE_LEN], inf_path[MAX_PATH], *extptr, *filepart; + static const DWORD config_flags = 0; UINT install_flags = SPINST_ALL; HKEY driver_key, device_key; SC_HANDLE manager, service; @@ -5210,6 +5211,10 @@ BOOL WINAPI SetupDiInstallDevice(HDEVINFO devinfo, SP_DEVINFO_DATA *device_data) return FALSE; }
+ if (!SETUPDI_SetDeviceRegistryPropertyW(device, SPDRP_CONFIGFLAGS, + (BYTE *)&config_flags, sizeof(config_flags))) + ERR("Failed to set config flags, error %#lx.\n", GetLastError()); + if (device->params.Flags & DI_NOFILECOPY) install_flags &= ~SPINST_FILES;