Signed-off-by: Alex Henrie alexhenrie24@gmail.com --- dlls/kernel32/process.c | 54 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+)
diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c index 1a4a2c3243..b9942b9ec9 100644 --- a/dlls/kernel32/process.c +++ b/dlls/kernel32/process.c @@ -113,6 +113,16 @@ struct smbios_system { BYTE serial; };
+struct smbios_board { + BYTE type; + BYTE length; + WORD handle; + BYTE manufacturer; + BYTE product; + BYTE version; + BYTE serial; +}; + #include "poppack.h"
static DWORD shutdown_flags = 0; @@ -4213,11 +4223,14 @@ UINT WINAPI GetSystemFirmwareTable(DWORD provider, DWORD id, PVOID buffer, DWORD size_t bios_manufacturer_size, bios_version_size, bios_date_size; char *system_manufacturer, *system_product, *system_version, *system_serial; size_t system_manufacturer_size, system_product_size, system_version_size, system_serial_size; + char *board_manufacturer, *board_product, *board_version, *board_serial; + size_t board_manufacturer_size, board_product_size, board_version_size, board_serial_size; size_t required_size = sizeof(struct smbios_prologue); BYTE string_count; struct smbios_prologue *prologue; struct smbios_bios *bios; struct smbios_system *system; + struct smbios_board *board;
bios_manufacturer = get_smbios_string("/sys/class/dmi/id/bios_vendor", &bios_manufacturer_size); bios_version = get_smbios_string("/sys/class/dmi/id/bios_version", &bios_version_size); @@ -4226,6 +4239,10 @@ UINT WINAPI GetSystemFirmwareTable(DWORD provider, DWORD id, PVOID buffer, DWORD system_product = get_smbios_string("/sys/class/dmi/id/product", &system_product_size); system_version = get_smbios_string("/sys/class/dmi/id/product_version", &system_version_size); system_serial = get_smbios_string("/sys/class/dmi/id/product_serial", &system_serial_size); + board_manufacturer = get_smbios_string("/sys/class/dmi/id/board_vendor", &board_manufacturer_size); + board_product = get_smbios_string("/sys/class/dmi/id/board_name", &board_product_size); + board_version = get_smbios_string("/sys/class/dmi/id/board_version", &board_version_size); + board_serial = get_smbios_string("/sys/class/dmi/id/board_serial", &board_serial_size);
required_size += sizeof(struct smbios_bios); if (bios_manufacturer_size || bios_version_size || bios_date_size) @@ -4240,6 +4257,13 @@ UINT WINAPI GetSystemFirmwareTable(DWORD provider, DWORD id, PVOID buffer, DWORD else required_size += 2;
+ required_size += sizeof(struct smbios_board); + if (board_manufacturer_size || board_product_size || board_version_size || board_serial_size) + required_size += board_manufacturer_size + board_product_size + board_version_size + + board_serial_size + 1; + else + required_size += 2; + if (required_size > size) return required_size;
@@ -4296,6 +4320,32 @@ UINT WINAPI GetSystemFirmwareTable(DWORD provider, DWORD id, PVOID buffer, DWORD copy_smbios_string(&buffer, system_version, system_version_size); copy_smbios_string(&buffer, system_serial, system_serial_size); memset(buffer, 0, 1); + buffer = (char*)buffer + 1; + } + else + { + memset(buffer, 0, 2); + buffer = (char*)buffer + 2; + } + + string_count = 0; + board = (struct smbios_board*)buffer; + board->type = 2; + board->length = sizeof(struct smbios_board); + board->handle = 0; + board->manufacturer = board_manufacturer ? ++string_count : 0; + board->product = board_product ? ++string_count : 0; + board->version = board_version ? ++string_count : 0; + board->serial = board_serial ? ++string_count : 0; + buffer = (char*)buffer + sizeof(struct smbios_board); + + if (string_count) + { + copy_smbios_string(&buffer, board_manufacturer, board_manufacturer_size); + copy_smbios_string(&buffer, board_product, board_product_size); + copy_smbios_string(&buffer, board_version, board_version_size); + copy_smbios_string(&buffer, board_serial, board_serial_size); + memset(buffer, 0, 1); } else { @@ -4309,6 +4359,10 @@ UINT WINAPI GetSystemFirmwareTable(DWORD provider, DWORD id, PVOID buffer, DWORD free(system_product); free(system_version); free(system_serial); + free(board_manufacturer); + free(board_product); + free(board_version); + free(board_serial);
return required_size; #endif