advapi32/tests: Fix a test on NT4.
authorPaul Vriens <paul.vriens.wine@gmail.com>
Fri, 13 Jun 2008 11:22:54 +0000 (13:22 +0200)
committerAlexandre Julliard <julliard@winehq.org>
Wed, 18 Jun 2008 14:48:24 +0000 (16:48 +0200)
dlls/advapi32/tests/service.c

index 8ffe2e8c2426dd808512b5f9b151d557bfbcc149..cd6d82c26b9793b6dfdef2724b56f77b3c6e4d75 100644 (file)
@@ -145,7 +145,17 @@ static void test_open_svc(void)
     GetServiceDisplayNameA(scm_handle, spooler, NULL, &displaysize);
     /* Get the displayname */
     GetServiceDisplayNameA(scm_handle, spooler, displayname, &displaysize);
-    /* Try to open the service with this displayname */
+    /* Try to open the service with this displayname, unless the displayname equals
+     * the servicename as that would defeat the purpose of this test.
+     */
+    if (!lstrcmpi(spooler, displayname))
+    {
+        skip("displayname equals servicename\n");
+        CloseServiceHandle(scm_handle);
+        return;
+    }
+
+    SetLastError(0xdeadbeef);
     svc_handle = OpenServiceA(scm_handle, displayname, GENERIC_READ);
     ok(!svc_handle, "Expected failure\n");
     ok(GetLastError() == ERROR_SERVICE_DOES_NOT_EXIST, "Expected ERROR_SERVICE_DOES_NOT_EXIST, got %d\n", GetLastError());