kernel32: Connect GetSystemFirmwareTable to NtQuerySystemInformation.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alex Henrie 2018-07-12 00:57:52 +02:00 committed by Alexandre Julliard
parent 28e8e9a164
commit 93711aee1f
3 changed files with 32 additions and 11 deletions

View File

@ -336,3 +336,34 @@ DWORD64 WINAPI GetEnabledXStateFeatures(void)
FIXME("\n");
return 0;
}
/***********************************************************************
* GetSystemFirmwareTable (KERNEL32.@)
*/
UINT WINAPI GetSystemFirmwareTable(DWORD provider, DWORD id, void *buffer, DWORD size)
{
ULONG buffer_size = FIELD_OFFSET(SYSTEM_FIRMWARE_TABLE_INFORMATION, TableBuffer) + size;
SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti = HeapAlloc(GetProcessHeap(), 0, buffer_size);
NTSTATUS status;
TRACE("(0x%08x, 0x%08x, %p, %d)\n", provider, id, buffer, size);
if (!sfti)
{
SetLastError(ERROR_OUTOFMEMORY);
return 0;
}
sfti->ProviderSignature = provider;
sfti->Action = SystemFirmwareTable_Get;
sfti->TableID = id;
status = NtQuerySystemInformation(SystemFirmwareTableInformation, sfti, buffer_size, &buffer_size);
buffer_size -= FIELD_OFFSET(SYSTEM_FIRMWARE_TABLE_INFORMATION, TableBuffer);
if (buffer_size <= size)
memcpy(buffer, sfti->TableBuffer, buffer_size);
if (status) SetLastError(RtlNtStatusToDosError(status));
HeapFree(GetProcessHeap(), 0, sfti);
return buffer_size;
}

View File

@ -4128,16 +4128,6 @@ HRESULT WINAPI UnregisterApplicationRestart(void)
return S_OK;
}
/***********************************************************************
* GetSystemFirmwareTable (KERNEL32.@)
*/
UINT WINAPI GetSystemFirmwareTable(DWORD provider, DWORD id, PVOID buffer, DWORD size)
{
FIXME("(%d %d %p %d):stub\n", provider, id, buffer, size);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
struct proc_thread_attr
{
DWORD_PTR attr;

View File

@ -719,7 +719,7 @@ static void test_GetSystemFirmwareTable(void)
pNtQuerySystemInformation(SystemFirmwareTableInformation, sfti, min_sfti_len, &expected_len);
if (expected_len == 0) /* xp, 2003 */
{
skip("SystemFirmwareTableInformation is not available\n");
win_skip("SystemFirmwareTableInformation is not available\n");
HeapFree(GetProcessHeap(), 0, sfti);
return;
}