Commit 9373f330 authored by Daniel Lehman's avatar Daniel Lehman Committed by Alexandre Julliard

advapi32/tests: Skip ReadEventLog on failure to open System log.

parent 51e4ec30
...@@ -1327,11 +1327,13 @@ static void test_eventlog_start(void) ...@@ -1327,11 +1327,13 @@ static void test_eventlog_start(void)
char *sourcenameA, *computernameA, *localcomputerA; char *sourcenameA, *computernameA, *localcomputerA;
/* ReadEventLogW */ /* ReadEventLogW */
size = MAX_COMPUTERNAME_LENGTH + 1;
localcomputer = malloc(size * sizeof(WCHAR));
GetComputerNameW(localcomputer, &size);
handle = OpenEventLogW(0, L"System"); handle = OpenEventLogW(0, L"System");
if (!handle && (GetLastError() == ERROR_ACCESS_DENIED || GetLastError() == RPC_S_SERVER_UNAVAILABLE))
{
win_skip( "Can't open event log\n" );
return;
}
ok(handle != NULL, "OpenEventLogW(System) failed : %ld\n", GetLastError());
handle2 = OpenEventLogW(0, L"System"); handle2 = OpenEventLogW(0, L"System");
todo_wine ok(handle != handle2, "Expected different handle\n"); todo_wine ok(handle != handle2, "Expected different handle\n");
CloseEventLog(handle2); CloseEventLog(handle2);
...@@ -1340,6 +1342,10 @@ static void test_eventlog_start(void) ...@@ -1340,6 +1342,10 @@ static void test_eventlog_start(void)
ok(!!handle2, "Expected valid handle\n"); ok(!!handle2, "Expected valid handle\n");
CloseEventLog(handle2); CloseEventLog(handle2);
size = MAX_COMPUTERNAME_LENGTH + 1;
localcomputer = malloc(size * sizeof(WCHAR));
GetComputerNameW(localcomputer, &size);
ret = TRUE; ret = TRUE;
found = FALSE; found = FALSE;
while (!found && ret) while (!found && ret)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment