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; LONG retl;
HKEY hkey; HKEY hkey;
SC_HANDLE schnd; SC_HANDLE schnd;
DWORD GLE;
SetLastError(0xdeadbeef);
ret = GetComputerNameA(compName, &len); ret = GetComputerNameA(compName, &len);
ok( ret, "GetComputerName failed err = %d\n", GetLastError()); ok( ret, "GetComputerName failed err = %d\n", GetLastError());
if( !ret) return; 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); ok( !retl || retl == ERROR_DLL_INIT_FAILED, "RegConnectRegistryA failed err = %d\n", retl);
if( !retl) RegCloseKey( hkey); if( !retl) RegCloseKey( hkey);
SetLastError(0xdeadbeef);
schnd = OpenSCManagerA( compName, NULL, GENERIC_READ); schnd = OpenSCManagerA( compName, NULL, GENERIC_READ);
GLE = GetLastError(); if (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
ok( schnd != NULL || GLE==ERROR_CALL_NOT_IMPLEMENTED, {
"OpenSCManagerA failed err = %d\n", GLE); skip("OpenSCManagerA is not implemented\n");
return;
}
ok( schnd != NULL, "OpenSCManagerA failed err = %d\n", GetLastError());
CloseServiceHandle( schnd); CloseServiceHandle( schnd);
SetLastError(0xdeadbeef);
schnd = OpenSCManagerA( netwName, NULL, GENERIC_READ); schnd = OpenSCManagerA( netwName, NULL, GENERIC_READ);
GLE = GetLastError(); ok( schnd != NULL, "OpenSCManagerA failed err = %d\n", GetLastError());
ok( schnd != NULL || GLE==ERROR_CALL_NOT_IMPLEMENTED,
"OpenSCManagerA failed err = %d\n", GLE);
CloseServiceHandle( schnd); CloseServiceHandle( schnd);
} }