advapi32/tests: Add a input parameter check (CloseEventLog).

This commit is contained in:
Paul Vriens 2009-10-27 10:37:07 +01:00 committed by Alexandre Julliard
parent 6bdbf6ee4c
commit 4af8e5f24d
2 changed files with 9 additions and 5 deletions

View File

@ -125,8 +125,15 @@ BOOL WINAPI ClearEventLogW( HANDLE hEventLog, LPCWSTR lpBackupFileName )
*/ */
BOOL WINAPI CloseEventLog( HANDLE hEventLog ) BOOL WINAPI CloseEventLog( HANDLE hEventLog )
{ {
FIXME("(%p) stub\n", hEventLog); FIXME("(%p) stub\n", hEventLog);
return TRUE;
if (!hEventLog)
{
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
return TRUE;
} }
/****************************************************************************** /******************************************************************************

View File

@ -34,13 +34,10 @@ static void test_open_close(void)
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = CloseEventLog(NULL); ret = CloseEventLog(NULL);
todo_wine
{
ok(!ret, "Expected failure\n"); ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_INVALID_HANDLE || ok(GetLastError() == ERROR_INVALID_HANDLE ||
GetLastError() == ERROR_NOACCESS, /* W2K */ GetLastError() == ERROR_NOACCESS, /* W2K */
"Expected ERROR_INVALID_HANDLE, got %d\n", GetLastError()); "Expected ERROR_INVALID_HANDLE, got %d\n", GetLastError());
}
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
handle = OpenEventLogA(NULL, NULL); handle = OpenEventLogA(NULL, NULL);