Signed-off-by: Alex Henrie alexhenrie24@gmail.com --- dlls/ntdll/nt.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+)
diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c index 40e36c0ffd..401e3b473d 100644 --- a/dlls/ntdll/nt.c +++ b/dlls/ntdll/nt.c @@ -88,6 +88,16 @@ struct smbios_bios { UINT64 characteristics; };
+struct smbios_system { + BYTE type; + BYTE length; + WORD handle; + BYTE vendor; + BYTE product; + BYTE version; + BYTE serial; +}; + #include "poppack.h"
/* Firmware table providers */ @@ -1922,20 +1932,31 @@ static inline NTSTATUS get_firmware_info(SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti { char bios_vendor[FWSS], bios_version[FWSS], bios_date[FWSS]; size_t bios_vendor_len, bios_version_len, bios_date_len; + char system_vendor[FWSS], system_product[FWSS], system_version[FWSS], system_serial[FWSS]; + size_t system_vendor_len, system_product_len, system_version_len, system_serial_len; char *buffer = (char*)sfti->TableBuffer; BYTE string_count; struct smbios_prologue *prologue; struct smbios_bios *bios; + struct smbios_system *system;
get_smbios_string("/sys/class/dmi/id/bios_vendor", bios_vendor, &bios_vendor_len); get_smbios_string("/sys/class/dmi/id/bios_version", bios_version, &bios_version_len); get_smbios_string("/sys/class/dmi/id/bios_date", bios_date, &bios_date_len); + get_smbios_string("/sys/class/dmi/id/sys_vendor", system_vendor, &system_vendor_len); + get_smbios_string("/sys/class/dmi/id/product", system_product, &system_product_len); + get_smbios_string("/sys/class/dmi/id/product_version", system_version, &system_version_len); + get_smbios_string("/sys/class/dmi/id/product_serial", system_serial, &system_serial_len);
*required_len = sizeof(struct smbios_prologue);
*required_len += sizeof(struct smbios_bios); *required_len += max(bios_vendor_len + bios_version_len + bios_date_len + 4, 2);
+ *required_len += sizeof(struct smbios_system); + *required_len += max(system_vendor_len + system_product_len + system_version_len + + system_serial_len + 5, 2); + sfti->TableBufferLength = *required_len;
*required_len += FIELD_OFFSET(SYSTEM_FIRMWARE_TABLE_INFORMATION, TableBuffer); @@ -1972,6 +1993,32 @@ static inline NTSTATUS get_firmware_info(SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti copy_smbios_string(&buffer, bios_version, bios_version_len); copy_smbios_string(&buffer, bios_date, bios_date_len); memset(buffer, 0, 1); + buffer++; + } + else + { + memset(buffer, 0, 2); + buffer += 2; + } + + string_count = 0; + system = (struct smbios_system*)buffer; + system->type = 1; + system->length = sizeof(struct smbios_system); + system->handle = 0; + system->vendor = system_vendor_len ? ++string_count : 0; + system->product = system_product_len ? ++string_count : 0; + system->version = system_version_len ? ++string_count : 0; + system->serial = system_serial_len ? ++string_count : 0; + buffer += sizeof(struct smbios_system); + + if (string_count) + { + copy_smbios_string(&buffer, system_vendor, system_vendor_len); + copy_smbios_string(&buffer, system_product, system_product_len); + copy_smbios_string(&buffer, system_version, system_version_len); + copy_smbios_string(&buffer, system_serial, system_serial_len); + memset(buffer, 0, 1); } else {