James Hawkins : setupapi: Fix a few test failures in win2k3.

Alexandre Julliard julliard at winehq.org
Wed May 21 05:22:44 CDT 2008


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

Author: James Hawkins <jhawkins at codeweavers.com>
Date:   Tue May 20 20:32:40 2008 -0500

setupapi: Fix a few test failures in win2k3.

---

 dlls/setupapi/tests/devinst.c |   25 +++++++++++--------------
 1 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/dlls/setupapi/tests/devinst.c b/dlls/setupapi/tests/devinst.c
index 727e454..f64d9b4 100644
--- a/dlls/setupapi/tests/devinst.c
+++ b/dlls/setupapi/tests/devinst.c
@@ -804,8 +804,9 @@ static void testDevRegKey(void)
          DIREG_DRV, 0);
         todo_wine
         ok(key == INVALID_HANDLE_VALUE &&
-         GetLastError() == ERROR_INVALID_DATA,
-         "Expected ERROR_INVALID_DATA, got %08x\n", GetLastError());
+         (GetLastError() == ERROR_INVALID_DATA ||
+         GetLastError() == ERROR_ACCESS_DENIED), /* win2k3 */
+         "Expected ERROR_INVALID_DATA or ERROR_ACCESS_DENIED, got %08x\n", GetLastError());
         key = pSetupDiOpenDevRegKey(set, &devInfo, DICS_FLAG_GLOBAL, 0,
          DIREG_DRV, KEY_READ);
         ok(key != INVALID_HANDLE_VALUE, "SetupDiOpenDevRegKey failed: %08x\n",
@@ -914,12 +915,11 @@ static void testDeviceRegistryPropertyA()
     todo_wine
     ok(!ret && GetLastError() == ERROR_INVALID_REG_PROPERTY,
      "Expected ERROR_INVALID_REG_PROPERTY, got %08x\n", GetLastError());
-    SetLastError(0xdeadbeef);
+    /* GetLastError() returns nonsense in win2k3 */
     ret = pSetupDiSetDeviceRegistryPropertyA(set, &devInfo, SPDRP_FRIENDLYNAME,
      NULL, 0);
     todo_wine
-    ok(!ret && GetLastError() == ERROR_INVALID_DATA,
-     "Expected ERROR_INVALID_DATA, got %08x\n", GetLastError());
+    ok(!ret, "Expected failure, got %d\n", ret);
     SetLastError(0xdeadbeef);
     ret = pSetupDiSetDeviceRegistryPropertyA(set, &devInfo, SPDRP_FRIENDLYNAME,
      (PBYTE)friendlyName, buflen);
@@ -937,11 +937,10 @@ static void testDeviceRegistryPropertyA()
     todo_wine
     ok(!ret && GetLastError() == ERROR_INVALID_REG_PROPERTY,
      "Expected ERROR_INVALID_REG_PROPERTY, got %08x\n", GetLastError());
-    SetLastError(0xdeadbeef);
+    /* GetLastError() returns nonsense in win2k3 */
     ret = pSetupDiGetDeviceRegistryPropertyA(set, &devInfo, SPDRP_FRIENDLYNAME,
      NULL, NULL, buflen, NULL);
-    ok(!ret && GetLastError() == ERROR_INVALID_DATA,
-     "Expected ERROR_INVALID_DATA, got %08x\n", GetLastError());
+    ok(!ret, "Expected failure, got %d\n", ret);
     SetLastError(0xdeadbeef);
     ret = pSetupDiGetDeviceRegistryPropertyA(set, &devInfo, SPDRP_FRIENDLYNAME,
      NULL, NULL, 0, &size);
@@ -1012,12 +1011,11 @@ static void testDeviceRegistryPropertyW()
     todo_wine
     ok(!ret && GetLastError() == ERROR_INVALID_REG_PROPERTY,
      "Expected ERROR_INVALID_REG_PROPERTY, got %08x\n", GetLastError());
-    SetLastError(0xdeadbeef);
+    /* GetLastError() returns nonsense in win2k3 */
     ret = pSetupDiSetDeviceRegistryPropertyW(set, &devInfo, SPDRP_FRIENDLYNAME,
      NULL, 0);
     todo_wine
-    ok(!ret && GetLastError() == ERROR_INVALID_DATA,
-     "Expected ERROR_INVALID_DATA, got %08x\n", GetLastError());
+    ok(!ret, "Expected failure, got %d\n", ret);
     SetLastError(0xdeadbeef);
     ret = pSetupDiSetDeviceRegistryPropertyW(set, &devInfo, SPDRP_FRIENDLYNAME,
      (PBYTE)friendlyName, buflen);
@@ -1035,11 +1033,10 @@ static void testDeviceRegistryPropertyW()
     todo_wine
     ok(!ret && GetLastError() == ERROR_INVALID_REG_PROPERTY,
      "Expected ERROR_INVALID_REG_PROPERTY, got %08x\n", GetLastError());
-    SetLastError(0xdeadbeef);
+    /* GetLastError() returns nonsense in win2k3 */
     ret = pSetupDiGetDeviceRegistryPropertyW(set, &devInfo, SPDRP_FRIENDLYNAME,
      NULL, NULL, buflen, NULL);
-    ok(!ret && GetLastError() == ERROR_INVALID_DATA,
-     "Expected ERROR_INVALID_DATA, got %08x\n", GetLastError());
+    ok(!ret, "Expected failure, got %d\n", ret);
     SetLastError(0xdeadbeef);
     ret = pSetupDiGetDeviceRegistryPropertyW(set, &devInfo, SPDRP_FRIENDLYNAME,
      NULL, NULL, 0, &size);




More information about the wine-cvs mailing list