Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/setupapi/devinst.c | 43 ++++++++++++++++++++++++++++++++++++- dlls/setupapi/setupapi.spec | 2 +- 2 files changed, 43 insertions(+), 2 deletions(-)
diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index 71311238c3..41573908ac 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -3715,9 +3715,10 @@ BOOL WINAPI SetupDiCallClassInstaller(DI_FUNCTION function, HDEVINFO devinfo, SP return SetupDiSelectBestCompatDrv(devinfo, device_data); case DIF_REGISTER_COINSTALLERS: return SetupDiRegisterCoDeviceInstallers(devinfo, device_data); + case DIF_INSTALLDEVICEFILES: + return SetupDiInstallDriverFiles(devinfo, device_data); case DIF_FINISHINSTALL_ACTION: case DIF_INSTALLDEVICE: - case DIF_INSTALLDEVICEFILES: case DIF_INSTALLINTERFACES: case DIF_PROPERTYCHANGE: case DIF_SELECTDEVICE: @@ -4593,3 +4594,43 @@ BOOL WINAPI SetupDiSelectBestCompatDrv(HDEVINFO devinfo, SP_DEVINFO_DATA *device
return TRUE; } + +/*********************************************************************** + * SetupDiInstallDriverFiles (SETUPAPI.@) + */ +BOOL WINAPI SetupDiInstallDriverFiles(HDEVINFO devinfo, SP_DEVINFO_DATA *device_data) +{ + WCHAR section[LINE_LEN], section_ext[LINE_LEN]; + struct device *device; + struct driver *driver; + void *callback_ctx; + INFCONTEXT ctx; + HINF hinf; + + 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); + + callback_ctx = SetupInitDefaultQueueCallback(NULL); + SetupInstallFromInfSectionW(NULL, hinf, section_ext, SPINST_FILES, NULL, NULL, + SP_COPY_NEWER_ONLY, SetupDefaultQueueCallbackW, callback_ctx, NULL, NULL); + SetupTermDefaultQueueCallback(callback_ctx); + + SetupCloseInfFile(hinf); + return TRUE; +} diff --git a/dlls/setupapi/setupapi.spec b/dlls/setupapi/setupapi.spec index 892a8031bf..9ecff232d8 100644 --- a/dlls/setupapi/setupapi.spec +++ b/dlls/setupapi/setupapi.spec @@ -368,7 +368,7 @@ @ stdcall SetupDiInstallClassW(long wstr long ptr) @ stub SetupDiInstallDevice @ stdcall SetupDiInstallDeviceInterfaces(ptr ptr) -@ stub SetupDiInstallDriverFiles +@ stdcall SetupDiInstallDriverFiles(ptr ptr) @ stdcall SetupDiLoadClassIcon(ptr ptr ptr) @ stub SetupDiMoveDuplicateDevice @ stdcall SetupDiOpenClassRegKey(ptr long)
--- dlls/setupapi/tests/devinst.c | 65 +++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+)
diff --git a/dlls/setupapi/tests/devinst.c b/dlls/setupapi/tests/devinst.c index 8155e464e5..280fd064f7 100644 --- a/dlls/setupapi/tests/devinst.c +++ b/dlls/setupapi/tests/devinst.c @@ -2780,6 +2780,70 @@ static void test_call_class_installer(void) ok(ret, "Failed to delete file, error %u.\n", GetLastError()); }
+static void test_install_driver_files(void) +{ + static const char hardware_id[] = "bogus_hardware_id\0"; + SP_DEVINSTALL_PARAMS_A params = {sizeof(params)}; + char dir[MAX_PATH], path[MAX_PATH]; + SP_DEVINFO_DATA device = {sizeof(device)}; + HDEVINFO set; + BOOL ret; + + 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]\n" + "CopyFiles=dev1_copy_one\n" + "[dev1_copy_one]\n" + "setupapi_test_one.txt\n"; + + 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 = SetupDiGetDeviceInstallParamsA(set, &device, ¶ms); + ok(ret, "Failed to get device install params, error %#x.\n", GetLastError()); + strcpy(params.DriverPath, path); + params.Flags = DI_ENUMSINGLEINF; + 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()); + + ret = SetupDiInstallDriverFiles(set, &device); + ok(ret, "Failed to install driver files, error %#x.\n", GetLastError()); + + ret = DeleteFileA("C:/windows/system32/setupapi_test_one.txt"); + ok(ret, "Failed to delete file, error %u.\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()); +} + START_TEST(devinst) { static BOOL (WINAPI *pIsWow64Process)(HANDLE, BOOL *); @@ -2817,4 +2881,5 @@ START_TEST(devinst) test_device_install_params(); test_driver_list(); test_call_class_installer(); + test_install_driver_files(); }
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=52718
Your paranoid android.
=== w2003std (32 bit report) ===
setupapi: devinst: Timeout
=== w1064v1809 (32 bit report) ===
setupapi: devinst: Timeout
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/setupapi/devinst.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index 41573908ac..3232f04072 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -101,6 +101,8 @@ static const WCHAR Phantom[] = {'P','h','a','n','t','o','m',0}; static const WCHAR SymbolicLink[] = {'S','y','m','b','o','l','i','c','L','i','n','k',0}; static const WCHAR Control[] = {'C','o','n','t','r','o','l',0}; static const WCHAR Linked[] = {'L','i','n','k','e','d',0}; +static const WCHAR dotInterfaces[] = {'.','I','n','t','e','r','f','a','c','e','s',0}; +static const WCHAR AddInterface[] = {'A','d','d','I','n','t','e','r','f','a','c','e',0}; static const WCHAR backslashW[] = {'\',0}; static const WCHAR emptyW[] = {0};
@@ -4600,7 +4602,7 @@ BOOL WINAPI SetupDiSelectBestCompatDrv(HDEVINFO devinfo, SP_DEVINFO_DATA *device */ BOOL WINAPI SetupDiInstallDriverFiles(HDEVINFO devinfo, SP_DEVINFO_DATA *device_data) { - WCHAR section[LINE_LEN], section_ext[LINE_LEN]; + WCHAR section[LINE_LEN], section_ext[LINE_LEN], iface_section[LINE_LEN]; struct device *device; struct driver *driver; void *callback_ctx; @@ -4627,8 +4629,20 @@ BOOL WINAPI SetupDiInstallDriverFiles(HDEVINFO devinfo, SP_DEVINFO_DATA *device_ SetupDiGetActualSectionToInstallW(hinf, section, section_ext, ARRAY_SIZE(section_ext), NULL, NULL);
callback_ctx = SetupInitDefaultQueueCallback(NULL); + SetupInstallFromInfSectionW(NULL, hinf, section_ext, SPINST_FILES, NULL, NULL, SP_COPY_NEWER_ONLY, SetupDefaultQueueCallbackW, callback_ctx, NULL, NULL); + + lstrcatW(section_ext, dotInterfaces); + if (SetupFindFirstLineW(hinf, section_ext, AddInterface, &ctx)) + { + do { + SetupGetStringFieldW(&ctx, 3, iface_section, ARRAY_SIZE(iface_section), NULL); + SetupInstallFromInfSectionW(NULL, hinf, iface_section, SPINST_FILES, NULL, NULL, + SP_COPY_NEWER_ONLY, SetupDefaultQueueCallbackW, callback_ctx, NULL, NULL); + } while (SetupFindNextMatchLineW(&ctx, AddInterface, &ctx)); + } + SetupTermDefaultQueueCallback(callback_ctx);
SetupCloseInfFile(hinf);
--- dlls/setupapi/tests/devinst.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/dlls/setupapi/tests/devinst.c b/dlls/setupapi/tests/devinst.c index 280fd064f7..4e3ec7894a 100644 --- a/dlls/setupapi/tests/devinst.c +++ b/dlls/setupapi/tests/devinst.c @@ -2800,12 +2800,20 @@ static void test_install_driver_files(void) "desc1=dev1,bogus_hardware_id\n" "[dev1]\n" "CopyFiles=dev1_copy_one\n" + "[dev1.Interfaces]\n" + "AddInterface={deadbeef-3f65-11db-b704-0011955c2bdb},,dev1_iface\n" + "[dev1_iface]\n" + "CopyFiles=dev1_copy_two\n" "[dev1_copy_one]\n" - "setupapi_test_one.txt\n"; + "setupapi_test_one.txt\n" + "[dev1_copy_two]\n" + "setupapi_test_two.txt\n";
GetTempPathA(sizeof(dir), dir); sprintf(path, "%s/setupapi_test_one.txt", dir); create_file(path, ""); + sprintf(path, "%s/setupapi_test_two.txt", dir); + create_file(path, ""); sprintf(path, "%s/setupapi_test.inf", dir); create_file(path, inf_data);
@@ -2833,12 +2841,17 @@ static void test_install_driver_files(void)
ret = DeleteFileA("C:/windows/system32/setupapi_test_one.txt"); ok(ret, "Failed to delete file, error %u.\n", GetLastError()); + ret = DeleteFileA("C:/windows/system32/setupapi_test_two.txt"); + ok(ret, "Failed to delete file, error %u.\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_two.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());
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=52720
Your paranoid android.
=== w2003std (32 bit report) ===
setupapi: devinst: Timeout
=== w1064v1809 (32 bit report) ===
setupapi: devinst: Timeout
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/setupapi/devinst.c | 84 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 77 insertions(+), 7 deletions(-)
diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index 3232f04072..23707dc7d8 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -2619,6 +2619,11 @@ HKEY WINAPI SetupDiCreateDeviceInterfaceRegKeyA( return key; }
+static LONG create_iface_key(const struct device_iface *iface, REGSAM access, HKEY *key) +{ + return RegCreateKeyExW(iface->refstr_key, DeviceParameters, 0, NULL, 0, access, NULL, key, NULL); +} + /*********************************************************************** * SetupDiCreateDeviceInterfaceRegKeyW (SETUPAPI.@) */ @@ -2642,8 +2647,7 @@ HKEY WINAPI SetupDiCreateDeviceInterfaceRegKeyW(HDEVINFO devinfo, return INVALID_HANDLE_VALUE; }
- ret = RegCreateKeyExW(iface->refstr_key, DeviceParameters, 0, NULL, 0, access, - NULL, ¶ms_key, NULL); + ret = create_iface_key(iface, access, ¶ms_key); if (ret) { SetLastError(ret); @@ -3719,9 +3723,10 @@ BOOL WINAPI SetupDiCallClassInstaller(DI_FUNCTION function, HDEVINFO devinfo, SP return SetupDiRegisterCoDeviceInstallers(devinfo, device_data); case DIF_INSTALLDEVICEFILES: return SetupDiInstallDriverFiles(devinfo, device_data); + case DIF_INSTALLINTERFACES: + return SetupDiInstallDeviceInterfaces(devinfo, device_data); case DIF_FINISHINSTALL_ACTION: case DIF_INSTALLDEVICE: - case DIF_INSTALLINTERFACES: case DIF_PROPERTYCHANGE: case DIF_SELECTDEVICE: case DIF_UNREMOVE: @@ -4268,12 +4273,77 @@ BOOL WINAPI SetupDiGetDevicePropertyW(HDEVINFO devinfo, PSP_DEVINFO_DATA device_ /*********************************************************************** * SetupDiInstallDeviceInterfaces (SETUPAPI.@) */ -BOOL WINAPI SetupDiInstallDeviceInterfaces(HDEVINFO dev, PSP_DEVINFO_DATA info_data) +BOOL WINAPI SetupDiInstallDeviceInterfaces(HDEVINFO devinfo, SP_DEVINFO_DATA *device_data) { - FIXME("%p, %p stub\n", dev, info_data); + WCHAR section[LINE_LEN], section_ext[LINE_LEN], iface_section[LINE_LEN], refstr[LINE_LEN], guidstr[39]; + UINT install_flags = SPINST_ALL; + struct device_iface *iface; + struct device *device; + struct driver *driver; + void *callback_ctx; + GUID iface_guid; + INFCONTEXT ctx; + HKEY iface_key; + HINF hinf; + LONG l;
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + 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 (device->params.Flags & DI_NOFILECOPY) + install_flags &= ~SPINST_FILES; + + callback_ctx = SetupInitDefaultQueueCallback(NULL); + + lstrcatW(section_ext, dotInterfaces); + if (SetupFindFirstLineW(hinf, section_ext, AddInterface, &ctx)) + { + do { + SetupGetStringFieldW(&ctx, 1, guidstr, ARRAY_SIZE(guidstr), NULL); + SetupGetStringFieldW(&ctx, 2, refstr, ARRAY_SIZE(refstr), NULL); + guidstr[37] = 0; + UuidFromStringW(&guidstr[1], &iface_guid); + + if (!(iface = SETUPDI_CreateDeviceInterface(device, &iface_guid, refstr))) + { + ERR("Failed to create device interface, error %#x.\n", GetLastError()); + continue; + } + + if ((l = create_iface_key(iface, KEY_ALL_ACCESS, &iface_key))) + { + ERR("Failed to create interface key, error %u.\n", l); + continue; + } + + SetupGetStringFieldW(&ctx, 3, iface_section, ARRAY_SIZE(iface_section), NULL); + SetupInstallFromInfSectionW(NULL, hinf, iface_section, install_flags, iface_key, + NULL, SP_COPY_NEWER_ONLY, SetupDefaultQueueCallbackW, callback_ctx, NULL, NULL); + + RegCloseKey(iface_key); + } while (SetupFindNextMatchLineW(&ctx, AddInterface, &ctx)); + } + + SetupTermDefaultQueueCallback(callback_ctx); + + SetupCloseInfFile(hinf); + return TRUE; }
/***********************************************************************
--- dlls/setupapi/tests/devinst.c | 120 ++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+)
diff --git a/dlls/setupapi/tests/devinst.c b/dlls/setupapi/tests/devinst.c index 4e3ec7894a..fc912d8180 100644 --- a/dlls/setupapi/tests/devinst.c +++ b/dlls/setupapi/tests/devinst.c @@ -37,6 +37,7 @@ /* This is a unique guid for testing purposes */ static GUID guid = {0x6a55b5a4, 0x3f65, 0x11db, {0xb7,0x04,0x00,0x11,0x95,0x5c,0x2b,0xdb}}; static GUID guid2 = {0x6a55b5a5, 0x3f65, 0x11db, {0xb7,0x04,0x00,0x11,0x95,0x5c,0x2b,0xdb}}; +static GUID iface_guid = {0xdeadbeef, 0x3f65, 0x11db, {0xb7,0x04,0x00,0x11,0x95,0x5c,0x2b,0xdb}};
BOOL (WINAPI *pSetupDiSetDevicePropertyW)(HDEVINFO, PSP_DEVINFO_DATA, const DEVPROPKEY *, DEVPROPTYPE, const BYTE *, DWORD, DWORD); BOOL (WINAPI *pSetupDiGetDevicePropertyW)(HDEVINFO, PSP_DEVINFO_DATA, const DEVPROPKEY *, DEVPROPTYPE *, BYTE *, DWORD, DWORD *, DWORD); @@ -74,6 +75,16 @@ static void load_resource(const char *name, const char *filename) CloseHandle( file ); }
+static void check_reg_str_(int line, HKEY key, const char *value, const char *expect) +{ + char data[200]; + DWORD size = sizeof(data); + LONG res = RegQueryValueExA(key, value, NULL, NULL, (BYTE *)data, &size); + ok_(__FILE__, line)(!res, "Failed to query value, error %u.\n", res); + ok_(__FILE__, line)(!strcmp(data, expect), "Expected value '%s', got '%s'.\n", expect, data); +} +#define check_reg_str(a,b,c) check_reg_str_(__LINE__,a,b,c) + static void test_create_device_list_ex(void) { static const WCHAR machine[] = { 'd','u','m','m','y',0 }; @@ -2857,6 +2868,114 @@ static void test_install_driver_files(void) ok(ret, "Failed to delete %s, error %u.\n", path, GetLastError()); }
+static void test_install_device_ifaces(void) +{ + 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)}; + char dir[MAX_PATH], path[MAX_PATH]; + HKEY iface_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.Interfaces]\n" + "AddInterface={deadbeef-3f65-11db-b704-0011955c2bdb},qux,dev1_iface\n" + "[dev1_iface]\n" + "CopyFiles=dev1_copy\n" + "AddReg=dev1_addreg\n" + "[dev1_copy]\n" + "setupapi_test_one.txt\n" + "[dev1_addreg]\n" + "HKR,,foo,,bar\n"; + + 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 = 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()); + + ret = SetupDiInstallDeviceInterfaces(set, &device); + ok(ret, "Failed to install driver files, error %#x.\n", GetLastError()); + + check_device_iface(set, &device, &iface_guid, 0, 0, "\\?\ROOT#BOGUS#0000#{DEADBEEF-3F65-11DB-B704-0011955C2BDB}\qux"); + + ret = SetupDiEnumDeviceInterfaces(set, &device, &iface_guid, 0, &iface); + ok(ret, "Failed to enumerate interfaces, error %#x.\n", GetLastError()); + iface_key = SetupDiOpenDeviceInterfaceRegKey(set, &iface, 0, KEY_READ); + ok(iface_key != INVALID_HANDLE_VALUE, "Failed to open interface key, error %#x.\n", GetLastError()); + check_reg_str(iface_key, "foo", "bar"); + RegCloseKey(iface_key); + + RegDeleteValueA(iface_key, "foo"); + + /* 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 = SetupDiInstallDeviceInterfaces(set, &device); + ok(ret, "Failed to install driver files, error %#x.\n", GetLastError()); + + check_device_iface(set, &device, &iface_guid, 0, 0, "\\?\ROOT#BOGUS#0000#{DEADBEEF-3F65-11DB-B704-0011955C2BDB}\qux"); + + ret = SetupDiEnumDeviceInterfaces(set, &device, &iface_guid, 0, &iface); + ok(ret, "Failed to enumerate interfaces, error %#x.\n", GetLastError()); + iface_key = SetupDiOpenDeviceInterfaceRegKey(set, &iface, 0, KEY_READ); + ok(iface_key != INVALID_HANDLE_VALUE, "Failed to open interface key, error %#x.\n", GetLastError()); + check_reg_str(iface_key, "foo", "bar"); + RegCloseKey(iface_key); + + ret = DeleteFileA("C:/windows/system32/setupapi_test_one.txt"); + ok(ret, "Failed to delete file, error %u.\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(HKEY_LOCAL_MACHINE, "System\CurrentControlSet\Control\" + "DeviceClasses\{deadbeef-3f65-11db-b704-0011955c2bdb}"); + ok(!res, "Failed to delete interface class key, error %u.\n", res); +} + START_TEST(devinst) { static BOOL (WINAPI *pIsWow64Process)(HANDLE, BOOL *); @@ -2895,4 +3014,5 @@ START_TEST(devinst) test_driver_list(); test_call_class_installer(); test_install_driver_files(); + test_install_device_ifaces(); }
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=52722
Your paranoid android.
=== build (build log) ===
collect2: error: ld returned 1 exit status Makefile:496: recipe for target 'setupapi_test.exe' failed Makefile:7667: recipe for target 'dlls/setupapi/tests' failed Task: The exe32 Wine crossbuild failed
=== debian9 (build log) ===
collect2: error: ld returned 1 exit status Makefile:502: recipe for target 'setupapi_test-stripped.exe' failed Makefile:8709: recipe for target 'dlls/setupapi/tests' failed Task: The win32 build failed
=== debian9 (build log) ===
collect2: error: ld returned 1 exit status Makefile:494: recipe for target 'setupapi_test.exe' failed collect2: error: ld returned 1 exit status Makefile:501: recipe for target 'setupapi_test-stripped.exe' failed Makefile:8447: recipe for target 'dlls/setupapi/tests' failed Task: The wow64 build failed