>From 5d6be2ecdbe78f1abd37af875281f82d0ce1881f Mon Sep 17 00:00:00 2001 From: Paul Vriens Date: Tue, 27 Oct 2009 10:27:28 +0100 Subject: [PATCH 4/5] Cope with empty servername --- dlls/advapi32/eventlog.c | 2 +- dlls/advapi32/tests/eventlog.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletions(-) diff --git a/dlls/advapi32/eventlog.c b/dlls/advapi32/eventlog.c index 82bff01..495623c 100644 --- a/dlls/advapi32/eventlog.c +++ b/dlls/advapi32/eventlog.c @@ -324,7 +324,7 @@ HANDLE WINAPI OpenEventLogW( LPCWSTR uncname, LPCWSTR source ) return NULL; } - if (uncname) + if (uncname && uncname[0]) { FIXME("Remote server not supported\n"); SetLastError(RPC_S_SERVER_UNAVAILABLE); diff --git a/dlls/advapi32/tests/eventlog.c b/dlls/advapi32/tests/eventlog.c index 3567a8c..9fdf745 100644 --- a/dlls/advapi32/tests/eventlog.c +++ b/dlls/advapi32/tests/eventlog.c @@ -73,6 +73,11 @@ static void test_open_close(void) ok(GetLastError() == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %d\n", GetLastError()); } + /* Empty servername should be read as local server */ + handle = OpenEventLogA("", "Application"); + ok(handle != NULL, "Expected a handle\n"); + CloseEventLog(handle); + handle = OpenEventLogA(NULL, "Application"); ok(handle != NULL, "Expected a handle\n"); CloseEventLog(handle); -- 1.6.2.5