Alexandre Julliard : advapi32/tests: Skip some tests if QueryServiceStatusEx is missing.

Alexandre Julliard julliard at winehq.org
Wed Aug 24 14:05:25 CDT 2011


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Aug 24 15:25:16 2011 +0200

advapi32/tests: Skip some tests if QueryServiceStatusEx is missing.

---

 dlls/advapi32/tests/service.c |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/dlls/advapi32/tests/service.c b/dlls/advapi32/tests/service.c
index ee39109..ddfae4d 100644
--- a/dlls/advapi32/tests/service.c
+++ b/dlls/advapi32/tests/service.c
@@ -949,6 +949,12 @@ static void test_query_svc(void)
     CloseServiceHandle(svc_handle);
 
     /* More or less the same tests for QueryServiceStatusEx */
+    if (!pQueryServiceStatusEx)
+    {
+        win_skip( "QueryServiceStatusEx not available\n" );
+        CloseServiceHandle(scm_handle);
+        return;
+    }
 
     /* Open service with not enough rights to query the status */
     svc_handle = OpenServiceA(scm_handle, spooler, STANDARD_RIGHTS_READ);
@@ -2065,10 +2071,13 @@ static DWORD try_start_stop(SC_HANDLE svc_handle, const char* name, int todo)
     le1 = GetLastError();
     ok(!ret, "%s: StartServiceA() should have failed\n", name);
 
-    ret = pQueryServiceStatusEx(svc_handle, SC_STATUS_PROCESS_INFO, (BYTE*)&statusproc, sizeof(statusproc), &needed);
-    ok(ret, "%s: QueryServiceStatusEx() failed le=%u\n", name, GetLastError());
-    todo_wine ok(statusproc.dwCurrentState == SERVICE_STOPPED, "%s: should be stopped state=%x\n", name, statusproc.dwCurrentState);
-    todo_wine ok(statusproc.dwProcessId == 0, "%s: ProcessId should be 0 instead of %x\n", name, statusproc.dwProcessId);
+    if (pQueryServiceStatusEx)
+    {
+        ret = pQueryServiceStatusEx(svc_handle, SC_STATUS_PROCESS_INFO, (BYTE*)&statusproc, sizeof(statusproc), &needed);
+        ok(ret, "%s: QueryServiceStatusEx() failed le=%u\n", name, GetLastError());
+        todo_wine ok(statusproc.dwCurrentState == SERVICE_STOPPED, "%s: should be stopped state=%x\n", name, statusproc.dwCurrentState);
+        todo_wine ok(statusproc.dwProcessId == 0, "%s: ProcessId should be 0 instead of %x\n", name, statusproc.dwProcessId);
+    }
 
     ret = StartServiceA(svc_handle, 0, NULL);
     le2 = GetLastError();




More information about the wine-cvs mailing list