Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/setupapi/devinst.c | 58 ++++++++++++++++++++++++++++++++++++- dlls/setupapi/setupapi.spec | 2 +- 2 files changed, 58 insertions(+), 2 deletions(-)
diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index 23707dc7d84..0919eec198e 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -3725,8 +3725,9 @@ BOOL WINAPI SetupDiCallClassInstaller(DI_FUNCTION function, HDEVINFO devinfo, SP return SetupDiInstallDriverFiles(devinfo, device_data); case DIF_INSTALLINTERFACES: return SetupDiInstallDeviceInterfaces(devinfo, device_data); - case DIF_FINISHINSTALL_ACTION: case DIF_INSTALLDEVICE: + return SetupDiInstallDevice(devinfo, device_data); + case DIF_FINISHINSTALL_ACTION: case DIF_PROPERTYCHANGE: case DIF_SELECTDEVICE: case DIF_UNREMOVE: @@ -4718,3 +4719,58 @@ BOOL WINAPI SetupDiInstallDriverFiles(HDEVINFO devinfo, SP_DEVINFO_DATA *device_ SetupCloseInfFile(hinf); return TRUE; } + +/*********************************************************************** + * SetupDiInstallDevice (SETUPAPI.@) + */ +BOOL WINAPI SetupDiInstallDevice(HDEVINFO devinfo, SP_DEVINFO_DATA *device_data) +{ + WCHAR section[LINE_LEN], section_ext[LINE_LEN]; + UINT install_flags = SPINST_ALL; + struct device *device; + struct driver *driver; + void *callback_ctx; + HKEY driver_key; + INFCONTEXT ctx; + HINF hinf; + LONG l; + + TRACE("devinfo %p, device_data %p.\n", devinfo, device_data); + + if (!(device = get_device(devinfo, device_data))) + return FALSE; + + if (!(driver = device->selected_driver)) + { + ERR("No driver selected for device %p.\n", devinfo); + SetLastError(ERROR_NO_DRIVER_SELECTED); + return FALSE; + } + + if ((hinf = SetupOpenInfFileW(driver->inf_path, NULL, INF_STYLE_WIN4, NULL)) == INVALID_HANDLE_VALUE) + return FALSE; + + SetupFindFirstLineW(hinf, driver->mfg_key, driver->description, &ctx); + SetupGetStringFieldW(&ctx, 1, section, ARRAY_SIZE(section), NULL); + SetupDiGetActualSectionToInstallW(hinf, section, section_ext, ARRAY_SIZE(section_ext), NULL, NULL); + + if ((l = create_driver_key(device, &driver_key))) + { + SetLastError(l); + SetupCloseInfFile(hinf); + return FALSE; + } + + if (device->params.Flags & DI_NOFILECOPY) + install_flags &= ~SPINST_FILES; + + callback_ctx = SetupInitDefaultQueueCallback(NULL); + + SetupInstallFromInfSectionW(NULL, hinf, section_ext, install_flags, driver_key, NULL, + SP_COPY_NEWER_ONLY, SetupDefaultQueueCallbackW, callback_ctx, NULL, NULL); + + SetupTermDefaultQueueCallback(callback_ctx); + SetupCloseInfFile(hinf); + RegCloseKey(driver_key); + return TRUE; +} diff --git a/dlls/setupapi/setupapi.spec b/dlls/setupapi/setupapi.spec index 9ecff232d8f..eee83075fd1 100644 --- a/dlls/setupapi/setupapi.spec +++ b/dlls/setupapi/setupapi.spec @@ -366,7 +366,7 @@ @ stub SetupDiInstallClassExA @ stub SetupDiInstallClassExW @ stdcall SetupDiInstallClassW(long wstr long ptr) -@ stub SetupDiInstallDevice +@ stdcall SetupDiInstallDevice(ptr ptr) @ stdcall SetupDiInstallDeviceInterfaces(ptr ptr) @ stdcall SetupDiInstallDriverFiles(ptr ptr) @ stdcall SetupDiLoadClassIcon(ptr ptr ptr)
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/setupapi/devinst.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index 0919eec198e..f565fec3590 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -4725,7 +4725,10 @@ BOOL WINAPI SetupDiInstallDriverFiles(HDEVINFO devinfo, SP_DEVINFO_DATA *device_ */ BOOL WINAPI SetupDiInstallDevice(HDEVINFO devinfo, SP_DEVINFO_DATA *device_data) { - WCHAR section[LINE_LEN], section_ext[LINE_LEN]; + static const WCHAR infpathW[] = {'I','n','f','P','a','t','h',0}; + static const WCHAR infsectionW[] = {'I','n','f','S','e','c','t','i','o','n',0}; + static const WCHAR infsectionextW[] = {'I','n','f','S','e','c','t','i','o','n','E','x','t',0}; + WCHAR section[LINE_LEN], section_ext[LINE_LEN], inf_path[MAX_PATH], *extptr, *filepart; UINT install_flags = SPINST_ALL; struct device *device; struct driver *driver; @@ -4752,7 +4755,7 @@ BOOL WINAPI SetupDiInstallDevice(HDEVINFO devinfo, SP_DEVINFO_DATA *device_data)
SetupFindFirstLineW(hinf, driver->mfg_key, driver->description, &ctx); SetupGetStringFieldW(&ctx, 1, section, ARRAY_SIZE(section), NULL); - SetupDiGetActualSectionToInstallW(hinf, section, section_ext, ARRAY_SIZE(section_ext), NULL, NULL); + SetupDiGetActualSectionToInstallW(hinf, section, section_ext, ARRAY_SIZE(section_ext), NULL, &extptr);
if ((l = create_driver_key(device, &driver_key))) { @@ -4771,6 +4774,15 @@ BOOL WINAPI SetupDiInstallDevice(HDEVINFO devinfo, SP_DEVINFO_DATA *device_data)
SetupTermDefaultQueueCallback(callback_ctx); SetupCloseInfFile(hinf); + + SetupCopyOEMInfW(driver->inf_path, NULL, SPOST_NONE, 0, inf_path, ARRAY_SIZE(inf_path), NULL, &filepart); + TRACE("Copied INF file %s to %s.\n", debugstr_w(driver->inf_path), debugstr_w(inf_path)); + + RegSetValueExW(driver_key, infpathW, 0, REG_SZ, (BYTE *)filepart, strlenW(filepart) * sizeof(WCHAR)); + RegSetValueExW(driver_key, infsectionW, 0, REG_SZ, (BYTE *)section, strlenW(section) * sizeof(WCHAR)); + if (extptr) + RegSetValueExW(driver_key, infsectionextW, 0, REG_SZ, (BYTE *)extptr, strlenW(extptr) * sizeof(WCHAR)); + RegCloseKey(driver_key); return TRUE; }
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/setupapi/devinst.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index f565fec3590..f9abf3a303b 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -4728,12 +4728,13 @@ BOOL WINAPI SetupDiInstallDevice(HDEVINFO devinfo, SP_DEVINFO_DATA *device_data) static const WCHAR infpathW[] = {'I','n','f','P','a','t','h',0}; static const WCHAR infsectionW[] = {'I','n','f','S','e','c','t','i','o','n',0}; static const WCHAR infsectionextW[] = {'I','n','f','S','e','c','t','i','o','n','E','x','t',0}; - WCHAR section[LINE_LEN], section_ext[LINE_LEN], inf_path[MAX_PATH], *extptr, *filepart; + static const WCHAR dothwW[] = {'.','H','W',0}; + WCHAR section[LINE_LEN], section_ext[LINE_LEN], subsection[LINE_LEN], inf_path[MAX_PATH], *extptr, *filepart; UINT install_flags = SPINST_ALL; + HKEY driver_key, device_key; struct device *device; struct driver *driver; void *callback_ctx; - HKEY driver_key; INFCONTEXT ctx; HINF hinf; LONG l; @@ -4764,6 +4765,15 @@ BOOL WINAPI SetupDiInstallDevice(HDEVINFO devinfo, SP_DEVINFO_DATA *device_data) return FALSE; }
+ if ((l = RegCreateKeyExW(device->key, DeviceParameters, 0, NULL, 0, + KEY_READ | KEY_WRITE, NULL, &device_key, NULL))) + { + SetLastError(l); + RegCloseKey(driver_key); + SetupCloseInfFile(hinf); + return FALSE; + } + if (device->params.Flags & DI_NOFILECOPY) install_flags &= ~SPINST_FILES;
@@ -4772,6 +4782,12 @@ BOOL WINAPI SetupDiInstallDevice(HDEVINFO devinfo, SP_DEVINFO_DATA *device_data) SetupInstallFromInfSectionW(NULL, hinf, section_ext, install_flags, driver_key, NULL, SP_COPY_NEWER_ONLY, SetupDefaultQueueCallbackW, callback_ctx, NULL, NULL);
+ strcpyW(subsection, section_ext); + strcatW(subsection, dothwW); + + SetupInstallFromInfSectionW(NULL, hinf, subsection, install_flags, device_key, NULL, + SP_COPY_NEWER_ONLY, SetupDefaultQueueCallbackW, callback_ctx, NULL, NULL); + SetupTermDefaultQueueCallback(callback_ctx); SetupCloseInfFile(hinf);
@@ -4783,6 +4799,7 @@ BOOL WINAPI SetupDiInstallDevice(HDEVINFO devinfo, SP_DEVINFO_DATA *device_data) if (extptr) RegSetValueExW(driver_key, infsectionextW, 0, REG_SZ, (BYTE *)extptr, strlenW(extptr) * sizeof(WCHAR));
+ RegCloseKey(device_key); RegCloseKey(driver_key); return TRUE; }
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/setupapi/devinst.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index f9abf3a303b..877286e2aae 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -4729,6 +4729,8 @@ BOOL WINAPI SetupDiInstallDevice(HDEVINFO devinfo, SP_DEVINFO_DATA *device_data) static const WCHAR infsectionW[] = {'I','n','f','S','e','c','t','i','o','n',0}; static const WCHAR infsectionextW[] = {'I','n','f','S','e','c','t','i','o','n','E','x','t',0}; static const WCHAR dothwW[] = {'.','H','W',0}; + static const WCHAR dotservicesW[] = {'.','S','e','r','v','i','c','e','s',0}; + static const WCHAR addserviceW[] = {'A','d','d','S','e','r','v','i','c','e',0}; WCHAR section[LINE_LEN], section_ext[LINE_LEN], subsection[LINE_LEN], inf_path[MAX_PATH], *extptr, *filepart; UINT install_flags = SPINST_ALL; HKEY driver_key, device_key; @@ -4788,6 +4790,26 @@ BOOL WINAPI SetupDiInstallDevice(HDEVINFO devinfo, SP_DEVINFO_DATA *device_data) SetupInstallFromInfSectionW(NULL, hinf, subsection, install_flags, device_key, NULL, SP_COPY_NEWER_ONLY, SetupDefaultQueueCallbackW, callback_ctx, NULL, NULL);
+ strcpyW(subsection, section_ext); + strcatW(subsection, dotservicesW); + SetupInstallServicesFromInfSectionW(hinf, subsection, 0); + + if (SetupFindFirstLineW(hinf, subsection, addserviceW, &ctx)) + { + do + { + INT flags; + + if (SetupGetIntField(&ctx, 2, &flags) && (flags & SPSVCINST_ASSOCSERVICE)) + { + WCHAR svc_name[LINE_LEN]; + if (SetupGetStringFieldW(&ctx, 1, svc_name, ARRAY_SIZE(svc_name), NULL) && svc_name[0]) + RegSetValueExW(device->key, Service, 0, REG_SZ, (BYTE *)svc_name, strlenW(svc_name) * sizeof(WCHAR)); + break; + } + } while (SetupFindNextMatchLineW(&ctx, addserviceW, &ctx)); + } + SetupTermDefaultQueueCallback(callback_ctx); SetupCloseInfFile(hinf);
--- dlls/setupapi/tests/devinst.c | 114 ++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+)
diff --git a/dlls/setupapi/tests/devinst.c b/dlls/setupapi/tests/devinst.c index fc912d8180e..a63fb4a8bce 100644 --- a/dlls/setupapi/tests/devinst.c +++ b/dlls/setupapi/tests/devinst.c @@ -2976,6 +2976,119 @@ static void test_install_device_ifaces(void) ok(!res, "Failed to delete interface class key, error %u.\n", res); }
+static void test_install_device(void) +{ + char dir[MAX_PATH], path[MAX_PATH], installed_inf_path[MAX_PATH]; + static const char hardware_id[] = "bogus_hardware_id\0"; + SP_DEVICE_INTERFACE_DATA iface = {sizeof(iface)}; + SP_DEVINSTALL_PARAMS_A params = {sizeof(params)}; + SP_DEVINFO_DATA device = {sizeof(device)}; + HKEY driver_key, class_key; + HDEVINFO set; + BOOL ret; + LONG res; + + static const char inf_data[] = "[Version]\n" + "Signature="$Chicago$"\n" + "ClassGuid={6a55b5a4-3f65-11db-b704-0011955c2bdb}\n" + "[Manufacturer]\n" + "mfg1=mfg1_key,NT" MYEXT ",NT" WOWEXT "\n" + "[mfg1_key.nt" MYEXT "]\n" + "desc1=dev1,bogus_hardware_id\n" + "[mfg1_key.nt" WOWEXT "]\n" + "desc1=dev1,bogus_hardware_id\n" + "[dev1.NT]\n" + "AddReg=dev1_sw_reg\n" + "CopyFiles=dev1_copy\n" + "[dev1_copy]\n" + "setupapi_test_one.txt\n" + "[dev1_sw_reg]\n" + "HKR,,foo,,bar\n" + "[dev1.NT.Services]\n" + "AddService = ,2\n"; + + res = RegCreateKeyA(HKEY_LOCAL_MACHINE, "System\CurrentControlSet\Control\Class" + "\{6a55b5a4-3f65-11db-b704-0011955c2bdb}", &class_key); + ok(!res, "Failed to create class key, error %u.\n", res); + + GetTempPathA(sizeof(dir), dir); + sprintf(path, "%s/setupapi_test_one.txt", dir); + create_file(path, ""); + sprintf(path, "%s/setupapi_test.inf", dir); + create_file(path, inf_data); + + set = SetupDiCreateDeviceInfoList(&guid, NULL); + ok(set != INVALID_HANDLE_VALUE, "Failed to create device list, error %#x.\n", GetLastError()); + ret = SetupDiCreateDeviceInfoA(set, "Root\BOGUS\0000", &guid, NULL, NULL, 0, &device); + ok(ret, "Failed to create device, error %#x.\n", GetLastError()); + ret = SetupDiSetDeviceRegistryPropertyA(set, &device, SPDRP_HARDWAREID, + (const BYTE *)hardware_id, sizeof(hardware_id)); + ok(ret, "Failed to set hardware ID, error %#x.\n", GetLastError()); + ret = SetupDiRegisterDeviceInfo(set, &device, 0, NULL, NULL, NULL); + ok(ret, "Failed to register device, error %#x.\n", GetLastError()); + + ret = SetupDiGetDeviceInstallParamsA(set, &device, ¶ms); + ok(ret, "Failed to get device install params, error %#x.\n", GetLastError()); + strcpy(params.DriverPath, path); + params.Flags = DI_ENUMSINGLEINF | DI_NOFILECOPY; + ret = SetupDiSetDeviceInstallParamsA(set, &device, ¶ms); + ok(ret, "Failed to set device install params, error %#x.\n", GetLastError()); + ret = SetupDiBuildDriverInfoList(set, &device, SPDIT_COMPATDRIVER); + ok(ret, "Failed to build driver list, error %#x.\n", GetLastError()); + ret = SetupDiSelectBestCompatDrv(set, &device); + ok(ret, "Failed to select driver, error %#x.\n", GetLastError()); + + /* This call is necessary for the next to succeed on Windows. */ + ret = SetupDiInstallDriverFiles(set, &device); + ok(ret, "Failed to install driver, error %#x.\n", GetLastError()); + ret = DeleteFileA("C:/windows/system32/setupapi_test_one.txt"); + ok(ret, "Failed to delete file, error %u.\n", GetLastError()); + + ret = SetupDiInstallDevice(set, &device); + ok(ret, "Failed to install driver, error %#x.\n", GetLastError()); + + driver_key = SetupDiOpenDevRegKey(set, &device, DICS_FLAG_GLOBAL, 0, DIREG_DRV, KEY_READ); + ok(driver_key != INVALID_HANDLE_VALUE, "Failed to open driver key, error %#x.\n", GetLastError()); + check_reg_str(driver_key, "foo", "bar"); + RegCloseKey(driver_key); + + /* We set DI_NOFILECOPY, so nothing should have been copied. */ + ret = GetFileAttributesA("C:/windows/system32/setupapi_test_one.txt"); + ok(ret == INVALID_FILE_ATTRIBUTES, "Expected file not to be installed.\n"); + + ret = SetupDiGetDeviceInstallParamsA(set, &device, ¶ms); + ok(ret, "Failed to get device install params, error %#x.\n", GetLastError()); + params.Flags &= ~DI_NOFILECOPY; + ret = SetupDiSetDeviceInstallParamsA(set, &device, ¶ms); + ok(ret, "Failed to set device install params, error %#x.\n", GetLastError()); + + ret = SetupDiInstallDevice(set, &device); + ok(ret, "Failed to install driver files, error %#x.\n", GetLastError()); + + driver_key = SetupDiOpenDevRegKey(set, &device, DICS_FLAG_GLOBAL, 0, DIREG_DRV, KEY_READ); + ok(driver_key != INVALID_HANDLE_VALUE, "Failed to open driver key, error %#x.\n", GetLastError()); + check_reg_str(driver_key, "foo", "bar"); + RegCloseKey(driver_key); + + ret = DeleteFileA("C:/windows/system32/setupapi_test_one.txt"); + ok(ret, "Failed to delete file, error %u.\n", GetLastError()); + + ret = SetupDiRemoveDevice(set, &device); + ok(ret, "Failed to remove device, error %#x.\n", GetLastError()); + SetupDiDestroyDeviceInfoList(set); + + sprintf(path, "%s/setupapi_test_one.txt", dir); + ret = DeleteFileA(path); + ok(ret, "Failed to delete %s, error %u.\n", path, GetLastError()); + sprintf(path, "%s/setupapi_test.inf", dir); + ret = DeleteFileA(path); + ok(ret, "Failed to delete %s, error %u.\n", path, GetLastError()); + + res = RegDeleteKeyA(class_key, ""); + ok(!res, "Failed to delete class key, error %u.\n", res); + RegCloseKey(class_key); +} + START_TEST(devinst) { static BOOL (WINAPI *pIsWow64Process)(HANDLE, BOOL *); @@ -3015,4 +3128,5 @@ START_TEST(devinst) test_call_class_installer(); test_install_driver_files(); test_install_device_ifaces(); + test_install_device(); }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=52825
Your paranoid android.
=== build (build log) ===
error: patch failed: dlls/setupapi/tests/devinst.c:2976 Task: Patch failed to apply
=== debian9 (build log) ===
error: patch failed: dlls/setupapi/tests/devinst.c:2976 Task: Patch failed to apply
=== debian9 (build log) ===
error: patch failed: dlls/setupapi/tests/devinst.c:2976 Task: Patch failed to apply
--- dlls/setupapi/tests/devinst.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
diff --git a/dlls/setupapi/tests/devinst.c b/dlls/setupapi/tests/devinst.c index a63fb4a8bce..61b2660d96e 100644 --- a/dlls/setupapi/tests/devinst.c +++ b/dlls/setupapi/tests/devinst.c @@ -2985,6 +2985,7 @@ static void test_install_device(void) SP_DEVINFO_DATA device = {sizeof(device)}; HKEY driver_key, class_key; HDEVINFO set; + DWORD size; BOOL ret; LONG res;
@@ -3050,6 +3051,19 @@ static void test_install_device(void) driver_key = SetupDiOpenDevRegKey(set, &device, DICS_FLAG_GLOBAL, 0, DIREG_DRV, KEY_READ); ok(driver_key != INVALID_HANDLE_VALUE, "Failed to open driver key, error %#x.\n", GetLastError()); check_reg_str(driver_key, "foo", "bar"); + check_reg_str(driver_key, "InfSection", "dev1"); + check_reg_str(driver_key, "InfSectionExt", ".NT"); + + /* Windows XP/2003 copies the file to the inf directory inside of + * SetupDiInstallDevice(). Vista+ copies it inside of + * UpdateDriverForPlugAndPlayDevices(), the expected caller. */ + size = sizeof(installed_inf_path); + res = RegQueryValueExA(driver_key, "InfPath", NULL, NULL, (BYTE *)&installed_inf_path, &size); + ok(!res, "Failed to get installed INF path.\n"); + sprintf(path, "C:/windows/inf/%s", installed_inf_path); + DeleteFileA(path); + path[strlen(path) - 3] = 'p'; + DeleteFileA(path); RegCloseKey(driver_key);
/* We set DI_NOFILECOPY, so nothing should have been copied. */ @@ -3068,6 +3082,16 @@ static void test_install_device(void) driver_key = SetupDiOpenDevRegKey(set, &device, DICS_FLAG_GLOBAL, 0, DIREG_DRV, KEY_READ); ok(driver_key != INVALID_HANDLE_VALUE, "Failed to open driver key, error %#x.\n", GetLastError()); check_reg_str(driver_key, "foo", "bar"); + check_reg_str(driver_key, "InfSection", "dev1"); + check_reg_str(driver_key, "InfSectionExt", ".NT"); + + size = sizeof(installed_inf_path); + res = RegQueryValueExA(driver_key, "InfPath", NULL, NULL, (BYTE *)&installed_inf_path, &size); + ok(!res, "Failed to get installed INF path.\n"); + sprintf(path, "C:/windows/inf/%s", installed_inf_path); + DeleteFileA(path); + path[strlen(path) - 3] = 'p'; + DeleteFileA(path); RegCloseKey(driver_key);
ret = DeleteFileA("C:/windows/system32/setupapi_test_one.txt");
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=52826
Your paranoid android.
=== build (build log) ===
error: patch failed: dlls/setupapi/tests/devinst.c:2976 error: patch failed: dlls/setupapi/tests/devinst.c:2985 Task: Patch failed to apply
=== debian9 (build log) ===
error: patch failed: dlls/setupapi/tests/devinst.c:2976 error: patch failed: dlls/setupapi/tests/devinst.c:2985 Task: Patch failed to apply
=== debian9 (build log) ===
error: patch failed: dlls/setupapi/tests/devinst.c:2976 error: patch failed: dlls/setupapi/tests/devinst.c:2985 Task: Patch failed to apply
--- dlls/setupapi/tests/devinst.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/dlls/setupapi/tests/devinst.c b/dlls/setupapi/tests/devinst.c index 61b2660d96e..451da0fd68e 100644 --- a/dlls/setupapi/tests/devinst.c +++ b/dlls/setupapi/tests/devinst.c @@ -2983,7 +2983,7 @@ static void test_install_device(void) SP_DEVICE_INTERFACE_DATA iface = {sizeof(iface)}; SP_DEVINSTALL_PARAMS_A params = {sizeof(params)}; SP_DEVINFO_DATA device = {sizeof(device)}; - HKEY driver_key, class_key; + HKEY driver_key, class_key, device_key; HDEVINFO set; DWORD size; BOOL ret; @@ -3005,6 +3005,10 @@ static void test_install_device(void) "setupapi_test_one.txt\n" "[dev1_sw_reg]\n" "HKR,,foo,,bar\n" + "[dev1.NT.HW]\n" + "AddReg=dev1_hw_reg\n" + "[dev1_hw_reg]\n" + "HKR,,foo,,qux\n" "[dev1.NT.Services]\n" "AddService = ,2\n";
@@ -3066,6 +3070,11 @@ static void test_install_device(void) DeleteFileA(path); RegCloseKey(driver_key);
+ device_key = SetupDiOpenDevRegKey(set, &device, DICS_FLAG_GLOBAL, 0, DIREG_DEV, KEY_READ); + ok(device_key != INVALID_HANDLE_VALUE, "Failed to open driver key, error %#x.\n", GetLastError()); + check_reg_str(device_key, "foo", "qux"); + RegCloseKey(device_key); + /* We set DI_NOFILECOPY, so nothing should have been copied. */ ret = GetFileAttributesA("C:/windows/system32/setupapi_test_one.txt"); ok(ret == INVALID_FILE_ATTRIBUTES, "Expected file not to be installed.\n"); @@ -3094,6 +3103,11 @@ static void test_install_device(void) DeleteFileA(path); RegCloseKey(driver_key);
+ device_key = SetupDiOpenDevRegKey(set, &device, DICS_FLAG_GLOBAL, 0, DIREG_DEV, KEY_READ); + ok(device_key != INVALID_HANDLE_VALUE, "Failed to open driver key, error %#x.\n", GetLastError()); + check_reg_str(device_key, "foo", "qux"); + RegCloseKey(device_key); + ret = DeleteFileA("C:/windows/system32/setupapi_test_one.txt"); ok(ret, "Failed to delete file, error %u.\n", GetLastError());
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=52827
Your paranoid android.
=== build (build log) ===
error: patch failed: dlls/setupapi/tests/devinst.c:2976 error: patch failed: dlls/setupapi/tests/devinst.c:2985 error: patch failed: dlls/setupapi/tests/devinst.c:2983 Task: Patch failed to apply
=== debian9 (build log) ===
error: patch failed: dlls/setupapi/tests/devinst.c:2976 error: patch failed: dlls/setupapi/tests/devinst.c:2985 error: patch failed: dlls/setupapi/tests/devinst.c:2983 Task: Patch failed to apply
=== debian9 (build log) ===
error: patch failed: dlls/setupapi/tests/devinst.c:2976 error: patch failed: dlls/setupapi/tests/devinst.c:2985 error: patch failed: dlls/setupapi/tests/devinst.c:2983 Task: Patch failed to apply