advapi32: Add a stubbed GetEventLogInformation with input param checking.
This commit is contained in:
parent
400d62167f
commit
7cc43213d7
|
@ -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)
|
||||
|
|
|
@ -189,6 +189,64 @@ ULONG WINAPI EnableTrace( ULONG enable, ULONG flag, ULONG level, LPCGUID guid, T
|
|||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* 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.@]
|
||||
*
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue