Author: tfaber
Date: Wed Nov 16 20:53:18 2011
New Revision: 54400

URL: http://svn.reactos.org/svn/reactos?rev=54400&view=rev
Log:
[ADVAPI32_WINETEST]
- Fix running the test with a relative path. Already Sent Upstream(TM)
- Do the rest of that tiny Winesync, too, while we're at it. Now at 1.3.33
- Remove the spooler hack in the process. We don't actually need it

Modified:
    trunk/rostests/winetests/advapi32/service.c

Modified: trunk/rostests/winetests/advapi32/service.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/advapi32/service.c?rev=54400&r1=54399&r2=54400&view=diff
==============================================================================
--- trunk/rostests/winetests/advapi32/service.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/advapi32/service.c [iso-8859-1] Wed Nov 16 
20:53:18 2011
@@ -32,9 +32,8 @@
 
 #include "wine/test.h"
 
-//static const CHAR spooler[] = "Spooler"; /* Should be available on all 
platforms */
-static const CHAR spooler[] = "Eventlog"; /* All platform except reactos :-/ */
-static const CHAR* selfname;
+static const CHAR spooler[] = "Spooler"; /* Should be available on all 
platforms */
+static CHAR selfname[MAX_PATH];
 
 static BOOL (WINAPI *pChangeServiceConfig2A)(SC_HANDLE,DWORD,LPVOID);
 static BOOL (WINAPI *pEnumServicesStatusExA)(SC_HANDLE, SC_ENUM_TYPE, DWORD,
@@ -145,7 +144,6 @@
     /* Proper SCM handle but different access rights */
     scm_handle = OpenSCManagerA(NULL, NULL, SC_MANAGER_CONNECT);
     SetLastError(0xdeadbeef);
-    /* ReactOS. See top of the file */
     svc_handle = OpenServiceA(scm_handle, spooler, GENERIC_WRITE);
     if (!svc_handle && (GetLastError() == ERROR_ACCESS_DENIED))
         skip("Not enough rights to get a handle to the service\n");
@@ -434,8 +432,7 @@
     WCHAR displaynameW[2048];
     DWORD displaysize, tempsize, tempsizeW;
     static const CHAR deadbeef[] = "Deadbeef";
-    /* ReactOS. See top of the file */
-    static const WCHAR spoolerW[] = {'E','v','e','n','t','l','o','g',0};
+    static const WCHAR spoolerW[] = {'S','p','o','o','l','e','r',0};
     static const WCHAR deadbeefW[] = {'D','e','a','d','b','e','e','f',0};
     static const WCHAR abcW[] = {'A','B','C',0};
     static const CHAR servicename[] = "Winetest";
@@ -1035,6 +1032,14 @@
     else
         ok(statusproc->dwProcessId == 0,
            "Expect no process id for this stopped service\n");
+
+    /* same call with null needed pointer */
+    SetLastError(0xdeadbeef);
+    ret = pQueryServiceStatusEx(svc_handle, SC_STATUS_PROCESS_INFO, 
(BYTE*)statusproc, bufsize, NULL);
+    ok(!ret, "Expected failure\n");
+    ok(broken(GetLastError() == ERROR_INVALID_PARAMETER) /* NT4 */ ||
+       GetLastError() == ERROR_INVALID_ADDRESS, "got %d\n", GetLastError());
+
     HeapFree(GetProcessHeap(), 0, statusproc);
 
     CloseServiceHandle(svc_handle);
@@ -2316,7 +2321,7 @@
     char** myARGV;
 
     myARGC = winetest_get_mainargs(&myARGV);
-    selfname = myARGV[0];
+    GetFullPathNameA(myARGV[0], sizeof(selfname), selfname, NULL);
     if (myARGC >= 3)
     {
         if (strcmp(myARGV[2], "sleep") == 0)


Reply via email to