Detlef Riekenberg : setupapi/tests: Avoid a crash on Win9x.

Alexandre Julliard julliard at winehq.org
Fri Jul 11 08:44:30 CDT 2008


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

Author: Detlef Riekenberg <wine.dev at web.de>
Date:   Thu Jul 10 23:24:02 2008 +0200

setupapi/tests: Avoid a crash on Win9x.

---

 dlls/setupapi/tests/query.c |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/dlls/setupapi/tests/query.c b/dlls/setupapi/tests/query.c
index 5283bf0..1546ff9 100644
--- a/dlls/setupapi/tests/query.c
+++ b/dlls/setupapi/tests/query.c
@@ -158,13 +158,18 @@ static void test_SetupGetInfInformation(void)
     ok(size == 0xdeadbeef, "Expected size to remain unchanged\n");
 
     /* try an invalid inf filename */
-    size = 0xdeadbeef;
-    SetLastError(0xbeefcafe);
-    ret = SetupGetInfInformationA(NULL, INFINFO_INF_NAME_IS_ABSOLUTE, NULL, 0, &size);
-    ok(ret == FALSE, "Expected SetupGetInfInformation to fail\n");
-    ok(GetLastError() == ERROR_INVALID_PARAMETER,
-       "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
-    ok(size == 0xdeadbeef, "Expected size to remain unchanged\n");
+    /* do not use NULL as absolute inf filename on win9x (crash) */
+    if ((GetLastError() != ERROR_BAD_PATHNAME) &&   /* win95 */
+        (GetLastError() != ERROR_FILE_NOT_FOUND))  /* win98 */
+    {
+        size = 0xdeadbeef;
+        SetLastError(0xbeefcafe);
+        ret = SetupGetInfInformationA(NULL, INFINFO_INF_NAME_IS_ABSOLUTE, NULL, 0, &size);
+        ok(ret == FALSE, "Expected SetupGetInfInformation to fail\n");
+        ok(GetLastError() == ERROR_INVALID_PARAMETER,
+           "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
+        ok(size == 0xdeadbeef, "Expected size to remain unchanged\n");
+    }
 
     create_inf_file(inf_filename);
 




More information about the wine-cvs mailing list