Commit 9021cca6 authored by John Chadwick's avatar John Chadwick Committed by Alexandre Julliard

kernelbase: Fix GetSystemFirmwareTable regression.

Regression caused by 71aba33f. Signed-off-by: 's avatarJohn Chadwick <john@jchw.io> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 2acbe4f0
......@@ -738,7 +738,6 @@ static void test_GetSystemFirmwareTable(void)
expected_len -= min_sfti_len;
len = pGetSystemFirmwareTable(RSMB, 0, NULL, 0);
todo_wine
ok(len == expected_len, "Expected length %u, got %u\n", expected_len, len);
smbios_table = HeapAlloc(GetProcessHeap(), 0, expected_len);
......
......@@ -1161,13 +1161,10 @@ UINT WINAPI GetSystemFirmwareTable( DWORD provider, DWORD id, void *buffer, DWOR
info->Action = SystemFirmwareTable_Get;
info->TableID = id;
if (set_ntstatus( NtQuerySystemInformation( SystemFirmwareTableInformation,
info, buffer_size, &buffer_size )))
{
buffer_size -= offsetof( SYSTEM_FIRMWARE_TABLE_INFORMATION, TableBuffer );
if (buffer_size <= size) memcpy( buffer, info->TableBuffer, buffer_size );
}
else buffer_size = 0;
set_ntstatus( NtQuerySystemInformation( SystemFirmwareTableInformation,
info, buffer_size, &buffer_size ));
buffer_size -= offsetof( SYSTEM_FIRMWARE_TABLE_INFORMATION, TableBuffer );
if (buffer_size <= size) memcpy( buffer, info->TableBuffer, buffer_size );
HeapFree( GetProcessHeap(), 0, info );
return buffer_size;
......
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