Signed-off-by: Alex Henrie alexhenrie24@gmail.com --- dlls/ntdll/nt.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+)
diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c index 5137b8e5dc..e622912d8a 100644 --- a/dlls/ntdll/nt.c +++ b/dlls/ntdll/nt.c @@ -98,6 +98,16 @@ struct smbios_system { BYTE serial; };
+struct smbios_board { + BYTE type; + BYTE length; + WORD handle; + BYTE vendor; + BYTE product; + BYTE version; + BYTE serial; +}; + #include "poppack.h"
/* Firmware table providers */ @@ -1933,11 +1943,14 @@ static inline NTSTATUS get_firmware_info(SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti size_t bios_vendor_len, bios_version_len, bios_date_len; char system_vendor[128], system_product[128], system_version[128], system_serial[128]; size_t system_vendor_len, system_product_len, system_version_len, system_serial_len; + char board_vendor[128], board_product[128], board_version[128], board_serial[128]; + size_t board_vendor_len, board_product_len, board_version_len, board_serial_len; char *buffer = (char*)sfti->TableBuffer; BYTE string_count; struct smbios_prologue *prologue; struct smbios_bios *bios; struct smbios_system *system; + struct smbios_board *board;
#define S(s) s, sizeof(s) bios_vendor_len = get_smbios_string("/sys/class/dmi/id/bios_vendor", S(bios_vendor)); @@ -1947,6 +1960,10 @@ static inline NTSTATUS get_firmware_info(SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti system_product_len = get_smbios_string("/sys/class/dmi/id/product", S(system_product)); system_version_len = get_smbios_string("/sys/class/dmi/id/product_version", S(system_version)); system_serial_len = get_smbios_string("/sys/class/dmi/id/product_serial", S(system_serial)); + board_vendor_len = get_smbios_string("/sys/class/dmi/id/board_vendor", S(board_vendor)); + board_product_len = get_smbios_string("/sys/class/dmi/id/board_name", S(board_product)); + board_version_len = get_smbios_string("/sys/class/dmi/id/board_version", S(board_version)); + board_serial_len = get_smbios_string("/sys/class/dmi/id/board_serial", S(board_serial)); #undef S
*required_len = sizeof(struct smbios_prologue); @@ -1958,6 +1975,9 @@ static inline NTSTATUS get_firmware_info(SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti *required_len += max(system_vendor_len + system_product_len + system_version_len + system_serial_len + 5, 2);
+ *required_len += sizeof(struct smbios_board); + *required_len += max(board_vendor_len + board_product_len + board_version_len + board_serial_len + 5, 2); + sfti->TableBufferLength = *required_len;
*required_len += FIELD_OFFSET(SYSTEM_FIRMWARE_TABLE_INFORMATION, TableBuffer); @@ -2018,6 +2038,32 @@ static inline NTSTATUS get_firmware_info(SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti copy_smbios_string(&buffer, system_version, system_version_len); copy_smbios_string(&buffer, system_serial, system_serial_len); memset(buffer, 0, 1); + buffer++; + } + else + { + memset(buffer, 0, 2); + buffer += 2; + } + + string_count = 0; + board = (struct smbios_board*)buffer; + board->type = 2; + board->length = sizeof(struct smbios_board); + board->handle = 0; + board->vendor = board_vendor_len ? ++string_count : 0; + board->product = board_product_len ? ++string_count : 0; + board->version = board_version_len ? ++string_count : 0; + board->serial = board_serial_len ? ++string_count : 0; + buffer += sizeof(struct smbios_board); + + if (string_count) + { + copy_smbios_string(&buffer, board_vendor, board_vendor_len); + copy_smbios_string(&buffer, board_product, board_product_len); + copy_smbios_string(&buffer, board_version, board_version_len); + copy_smbios_string(&buffer, board_serial, board_serial_len); + memset(buffer, 0, 1); } else {