Signed-off-by: Alex Henrie alexhenrie24@gmail.com --- dlls/kernel32/cpu.c | 29 +++++++++++++++++++++++++++++ dlls/kernel32/process.c | 10 ---------- dlls/kernel32/tests/version.c | 2 +- 3 files changed, 30 insertions(+), 11 deletions(-)
diff --git a/dlls/kernel32/cpu.c b/dlls/kernel32/cpu.c index ec1fd0f90d..8397fbe729 100644 --- a/dlls/kernel32/cpu.c +++ b/dlls/kernel32/cpu.c @@ -336,3 +336,32 @@ 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; + + 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; +} diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c index ff56e9a692..6adf08d257 100644 --- a/dlls/kernel32/process.c +++ b/dlls/kernel32/process.c @@ -4126,16 +4126,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; diff --git a/dlls/kernel32/tests/version.c b/dlls/kernel32/tests/version.c index 08e8f0fb58..e33ce9cd42 100644 --- a/dlls/kernel32/tests/version.c +++ b/dlls/kernel32/tests/version.c @@ -717,7 +717,7 @@ void test_GetSystemFirmwareTable(void) pNtQuerySystemInformation(SystemFirmwareTableInformation, sfti, 16, &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; }