advapi32/tests: Use skip when OpenSCManagerA is not implemented.

This commit is contained in:
Paul Vriens 2007-04-11 08:39:34 +02:00 committed by Alexandre Julliard
parent 57d2002351
commit 7dd647b633
1 changed files with 11 additions and 7 deletions

View File

@ -754,8 +754,8 @@ static void test_regconnectregistry( void)
LONG retl;
HKEY hkey;
SC_HANDLE schnd;
DWORD GLE;
SetLastError(0xdeadbeef);
ret = GetComputerNameA(compName, &len);
ok( ret, "GetComputerName failed err = %d\n", GetLastError());
if( !ret) return;
@ -771,16 +771,20 @@ static void test_regconnectregistry( void)
ok( !retl || retl == ERROR_DLL_INIT_FAILED, "RegConnectRegistryA failed err = %d\n", retl);
if( !retl) RegCloseKey( hkey);
SetLastError(0xdeadbeef);
schnd = OpenSCManagerA( compName, NULL, GENERIC_READ);
GLE = GetLastError();
ok( schnd != NULL || GLE==ERROR_CALL_NOT_IMPLEMENTED,
"OpenSCManagerA failed err = %d\n", GLE);
if (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
{
skip("OpenSCManagerA is not implemented\n");
return;
}
ok( schnd != NULL, "OpenSCManagerA failed err = %d\n", GetLastError());
CloseServiceHandle( schnd);
SetLastError(0xdeadbeef);
schnd = OpenSCManagerA( netwName, NULL, GENERIC_READ);
GLE = GetLastError();
ok( schnd != NULL || GLE==ERROR_CALL_NOT_IMPLEMENTED,
"OpenSCManagerA failed err = %d\n", GLE);
ok( schnd != NULL, "OpenSCManagerA failed err = %d\n", GetLastError());
CloseServiceHandle( schnd);
}