From da92afa3e1c93d99c69e71fbe8d9209f2a5a41d0 Mon Sep 17 00:00:00 2001 From: Paul Vriens Date: Tue, 24 Nov 2009 09:36:57 +0100 Subject: [PATCH] advapi32/tests: Fix a test failure on W2K3 without a service pack. --- dlls/advapi32/tests/eventlog.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/dlls/advapi32/tests/eventlog.c b/dlls/advapi32/tests/eventlog.c index c6272ff2adc..207fec5836d 100644 --- a/dlls/advapi32/tests/eventlog.c +++ b/dlls/advapi32/tests/eventlog.c @@ -741,6 +741,27 @@ static void test_readwrite(void) return; } + count = 0xdeadbeef; + GetNumberOfEventLogRecords(handle, &count); + if (count != 0) + { + /* Needed for W2K3 without a service pack */ + win_skip("We most likely opened the Application eventlog\n"); + CloseEventLog(handle); + Sleep(2000); + + handle = OpenEventLogA(NULL, eventlogname); + count = 0xdeadbeef; + GetNumberOfEventLogRecords(handle, &count); + if (count != 0) + { + win_skip("We didn't open our new eventlog\n"); + HeapFree(GetProcessHeap(), 0, user); + CloseEventLog(handle); + return; + } + } + SetLastError(0xdeadbeef); ret = ReportEvent(handle, 0x20, 0, 0, NULL, 0, 0, NULL, NULL); if (!ret && GetLastError() == ERROR_CRC)