From 022c6505d05636739250ee3de259b0a2eaac29d8 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Wed, 16 Nov 2011 20:53:18 +0000 Subject: [PATCH] [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 svn path=/trunk/; revision=54400 --- rostests/winetests/advapi32/service.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/rostests/winetests/advapi32/service.c b/rostests/winetests/advapi32/service.c index 6804020e8e9..aa2c6a1a066 100644 --- a/rostests/winetests/advapi32/service.c +++ b/rostests/winetests/advapi32/service.c @@ -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 @@ static void test_open_svc(void) /* 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 @@ static void test_get_displayname(void) 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 @@ static void test_query_svc(void) 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 @@ START_TEST(service) 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)