Paul Vriens : setupapi/tests: Fix a test failure on Vista ( and skip some tests).

Alexandre Julliard julliard at winehq.org
Wed Dec 17 09:39:54 CST 2008


Module: wine
Branch: master
Commit: 6c72061507b39be8c3c535ec09a3a4b5679be500
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=6c72061507b39be8c3c535ec09a3a4b5679be500

Author: Paul Vriens <Paul.Vriens.Wine at gmail.com>
Date:   Wed Dec 17 12:30:30 2008 +0100

setupapi/tests: Fix a test failure on Vista (and skip some tests).

---

 dlls/setupapi/tests/misc.c |   16 ++++++++++++++--
 include/setupapi.h         |    1 +
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/dlls/setupapi/tests/misc.c b/dlls/setupapi/tests/misc.c
index 7d0d2ea..60960b2 100644
--- a/dlls/setupapi/tests/misc.c
+++ b/dlls/setupapi/tests/misc.c
@@ -160,8 +160,9 @@ static void test_SetupCopyOEMInf(void)
     res = pSetupCopyOEMInfA("", NULL, 0, SP_COPY_NOOVERWRITE, NULL, 0, NULL, NULL);
     ok(res == FALSE, "Expected FALSE, got %d\n", res);
     ok(GetLastError() == ERROR_FILE_NOT_FOUND ||
-       GetLastError() == ERROR_BAD_PATHNAME, /* Win98 */
-       "Expected ERROR_FILE_NOT_FOUND or ERROR_BAD_PATHNAME, got %d\n", GetLastError());
+       GetLastError() == ERROR_BAD_PATHNAME || /* Win98 */
+       GetLastError() == ERROR_INVALID_PARAMETER, /* Vista, W2K8 */
+       "Unexpected error : %d\n", GetLastError());
 
     /* try a relative nonexistent SourceInfFileName */
     SetLastError(0xdeadbeef);
@@ -196,6 +197,17 @@ static void test_SetupCopyOEMInf(void)
     SetLastError(0xdeadbeef);
     res = pSetupCopyOEMInfA(tmpfile, NULL, 0, SP_COPY_NOOVERWRITE, NULL, 0, NULL, NULL);
     ok(res == FALSE, "Expected FALSE, got %d\n", res);
+    if (GetLastError() == ERROR_WRONG_INF_TYPE)
+    {
+       /* FIXME:
+        * Vista needs a [Manufacturer] entry in the inf file. Doing this will give some
+        * popups during the installation though as it also needs a catalog file (signed?).
+        */
+       win_skip("Needs a different inf file on Vista/W2K8\n");
+       DeleteFile(tmpfile);
+       return;
+    }
+
     ok(GetLastError() == ERROR_FILE_NOT_FOUND ||
        GetLastError() == ERROR_FILE_EXISTS, /* Win98 */
        "Expected ERROR_FILE_NOT_FOUND or ERROR_FILE_EXISTS, got %d\n", GetLastError());
diff --git a/include/setupapi.h b/include/setupapi.h
index 88c35eb..0e9cbbb 100644
--- a/include/setupapi.h
+++ b/include/setupapi.h
@@ -1214,6 +1214,7 @@ DECL_WINELIB_SETUPAPI_TYPE_AW(PSP_INF_SIGNER_INFO)
 #define ERROR_SET_SYSTEM_RESTORE_POINT    (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x236)
 #define ERROR_INCORRECTLY_COPIED_INF      (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x237)
 #define ERROR_SCE_DISABLED                (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x238)
+#define ERROR_WRONG_INF_TYPE              (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x24A)
 #define ERROR_NO_DEFAULT_INTERFACE_DEVICE ERROR_NO_DEFAULT_DEVICE_INTERFACE
 #define ERROR_INTERFACE_DEVICE_ACTIVE     ERROR_DEVICE_INTERFACE_ACTIVE
 #define ERROR_INTERFACE_DEVICE_REMOVED    ERROR_DEVICE_INTERFACE_REMOVED




More information about the wine-cvs mailing list