Zebediah Figura : setupapi: Always fill output parameters in SetupCopyOEMInfA().

Alexandre Julliard julliard at winehq.org
Fri May 24 15:46:36 CDT 2019


Module: wine
Branch: master
Commit: 56aab6aaf83098115014512e0a6a5ab7e78bbef3
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=56aab6aaf83098115014512e0a6a5ab7e78bbef3

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Thu May 23 18:00:47 2019 -0500

setupapi: Always fill output parameters in SetupCopyOEMInfA().

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/setupapi/misc.c       | 12 +++---------
 dlls/setupapi/tests/misc.c |  1 -
 2 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/dlls/setupapi/misc.c b/dlls/setupapi/misc.c
index 7298ac6..67e2eaf 100644
--- a/dlls/setupapi/misc.c
+++ b/dlls/setupapi/misc.c
@@ -851,12 +851,9 @@ BOOL WINAPI SetupCopyOEMInfA( PCSTR source, PCSTR location,
     if (source && !(sourceW = strdupAtoW( source ))) goto done;
     if (location && !(locationW = strdupAtoW( location ))) goto done;
 
-    if (!(ret = SetupCopyOEMInfW( sourceW, locationW, media_type, style, destW,
-                                  buffer_size, &size, NULL )))
-    {
-        if (required_size) *required_size = size;
-        goto done;
-    }
+    ret = SetupCopyOEMInfW( sourceW, locationW, media_type, style, destW, buffer_size, &size, NULL );
+
+    if (required_size) *required_size = size;
 
     if (dest)
     {
@@ -866,10 +863,7 @@ BOOL WINAPI SetupCopyOEMInfA( PCSTR source, PCSTR location,
             if (component) *component = strrchr( dest, '\\' ) + 1;
         }
         else
-        {
             SetLastError( ERROR_INSUFFICIENT_BUFFER );
-            goto done;
-        }
     }
 
 done:
diff --git a/dlls/setupapi/tests/misc.c b/dlls/setupapi/tests/misc.c
index e2dd12f..7e59770 100644
--- a/dlls/setupapi/tests/misc.c
+++ b/dlls/setupapi/tests/misc.c
@@ -246,7 +246,6 @@ static void test_SetupCopyOEMInf(void)
     ok(res == FALSE, "Expected FALSE, got %d\n", res);
     ok(GetLastError() == ERROR_FILE_EXISTS,
        "Expected ERROR_FILE_EXISTS, got %d\n", GetLastError());
-todo_wine
     ok(!strcmp(orig_dest, dest), "Expected '%s', got '%s'.\n", orig_dest, dest);
 
     SetLastError(0xdeadbeef);




More information about the wine-cvs mailing list