Commit 93711aee authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

kernel32: Connect GetSystemFirmwareTable to NtQuerySystemInformation.

parent 28e8e9a1
......@@ -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;
}
......@@ -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;
......
......@@ -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;
}
......
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