[PATCH v2 4/4] setupapi: Return the section name in SetupDiGetActualSectionToInstall() even if it doesn't exist.

Zebediah Figura z.figura12 at gmail.com
Fri May 17 00:21:10 CDT 2019


Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/setupapi/devinst.c       | 12 +-----------
 dlls/setupapi/tests/devinst.c |  4 ----
 2 files changed, 1 insertion(+), 15 deletions(-)

diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c
index 12e92e1ef8..78f6559152 100644
--- a/dlls/setupapi/devinst.c
+++ b/dlls/setupapi/devinst.c
@@ -1879,17 +1879,7 @@ BOOL WINAPI SetupDiGetActualSectionToInstallW(
     }
 
     if (lLineCount == -1)
-    {
-	/* Test section name without extension */
-	szBuffer[dwLength] = 0;
-	lLineCount = SetupGetLineCountW(InfHandle, szBuffer);
-    }
-
-    if (lLineCount == -1)
-    {
-	SetLastError(ERROR_INVALID_PARAMETER);
-	return FALSE;
-    }
+        szBuffer[dwLength] = 0;
 
     dwFullLength = lstrlenW(szBuffer);
 
diff --git a/dlls/setupapi/tests/devinst.c b/dlls/setupapi/tests/devinst.c
index 88d4748aaf..d2a32fc623 100644
--- a/dlls/setupapi/tests/devinst.c
+++ b/dlls/setupapi/tests/devinst.c
@@ -2082,7 +2082,6 @@ static void test_get_actual_section(void)
     ok(!strcasecmp(section, "section7"), "Got unexpected section %s.\n", section);
     ok(!extptr || !*extptr /* Windows 10 1809 */, "Got extension %s.\n", extptr);
 
-todo_wine {
     extptr = section;
     ret = SetupDiGetActualSectionToInstallA(hinf, "section8", section, ARRAY_SIZE(section), NULL, &extptr);
     ok(ret, "Failed to get section, error %#x.\n", GetLastError());
@@ -2094,7 +2093,6 @@ todo_wine {
     ok(ret, "Failed to get section, error %#x.\n", GetLastError());
     ok(!strcasecmp(section, "nonexistent"), "Got unexpected section %s.\n", section);
     ok(!extptr || !*extptr /* Windows 10 1809 */, "Got extension %s.\n", extptr);
-}
 
     extptr = section;
     ret = SetupDiGetActualSectionToInstallA(hinf, "section9", section, ARRAY_SIZE(section), NULL, &extptr);
@@ -2102,7 +2100,6 @@ todo_wine {
     ok(!strcasecmp(section, "section9.NT" MYEXT), "Got unexpected section %s.\n", section);
     ok(extptr == section + 8, "Got extension %s.\n", extptr);
 
-todo_wine {
     if (0)
     {
         /* For some reason, this call hangs on Windows 10 1809. */
@@ -2112,7 +2109,6 @@ todo_wine {
         ok(!strcasecmp(section, "section10"), "Got unexpected section %s.\n", section);
         ok(!extptr, "Got extension %s.\n", extptr);
     }
-}
 
     SetupCloseInfFile(hinf);
     ret = DeleteFileA(inf_path);
-- 
2.21.0




More information about the wine-devel mailing list