Commit 7cc43213 authored by Paul Vriens's avatar Paul Vriens Committed by Alexandre Julliard

advapi32: Add a stubbed GetEventLogInformation with input param checking.

parent 400d6216
......@@ -236,7 +236,7 @@
@ stdcall GetCurrentHwProfileW(ptr)
@ stdcall GetEffectiveRightsFromAclA(ptr ptr ptr)
@ stdcall GetEffectiveRightsFromAclW(ptr ptr ptr)
# @ stub GetEventLogInformation
@ stdcall GetEventLogInformation(long long ptr long ptr)
@ stdcall GetExplicitEntriesFromAclA(ptr ptr ptr)
@ stdcall GetExplicitEntriesFromAclW(ptr ptr ptr)
@ stdcall GetFileSecurityA(str long ptr long ptr)
......
......@@ -190,6 +190,64 @@ ULONG WINAPI EnableTrace( ULONG enable, ULONG flag, ULONG level, LPCGUID guid, T
}
/******************************************************************************
* GetEventLogInformation [ADVAPI32.@]
*
* Retrieve some information about an event log.
*
* PARAMS
* hEventLog [I] Handle to an open event log.
* dwInfoLevel [I] Level of information (only EVENTLOG_FULL_INFO)
* lpBuffer [I/O] The buffer for the returned information
* cbBufSize [I] The size of the buffer
* pcbBytesNeeded [O] The needed bytes to hold the information
*
* RETURNS
* Success: TRUE. lpBuffer will hold the information and pcbBytesNeeded shows
* the needed buffer size.
* Failure: FALSE.
*/
BOOL WINAPI GetEventLogInformation( HANDLE hEventLog, DWORD dwInfoLevel, LPVOID lpBuffer, DWORD cbBufSize, LPDWORD pcbBytesNeeded)
{
EVENTLOG_FULL_INFORMATION *efi;
FIXME("(%p, %d, %p, %d, %p) stub\n", hEventLog, dwInfoLevel, lpBuffer, cbBufSize, pcbBytesNeeded);
if (dwInfoLevel != EVENTLOG_FULL_INFO)
{
SetLastError(ERROR_INVALID_LEVEL);
return FALSE;
}
if (!hEventLog)
{
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
if (!lpBuffer || !pcbBytesNeeded)
{
/* FIXME: This will be handled properly when eventlog is moved
* to a higher level
*/
SetLastError(RPC_X_NULL_REF_POINTER);
return FALSE;
}
*pcbBytesNeeded = sizeof(EVENTLOG_FULL_INFORMATION);
if (cbBufSize < sizeof(EVENTLOG_FULL_INFORMATION))
{
SetLastError(ERROR_INSUFFICIENT_BUFFER);
return FALSE;
}
/* Pretend the log is not full */
efi = (EVENTLOG_FULL_INFORMATION *)lpBuffer;
efi->dwFull = 0;
return TRUE;
}
/******************************************************************************
* GetNumberOfEventLogRecords [ADVAPI32.@]
*
* Retrieves the number of records in an event log.
......
......@@ -99,7 +99,7 @@ static void test_info(void)
if (!pGetEventLogInformation)
{
/* NT4 */
skip("GetEventLogInformation is not available\n");
win_skip("GetEventLogInformation is not available\n");
return;
}
SetLastError(0xdeadbeef);
......
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