Signed-off-by: Brendan Shanks bshanks@codeweavers.com --- dlls/ntdll/unix/system.c | 57 +++++++++++++++++++++++++--------------- 1 file changed, 36 insertions(+), 21 deletions(-)
diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c index 4e0841175eb..69532669bef 100644 --- a/dlls/ntdll/unix/system.c +++ b/dlls/ntdll/unix/system.c @@ -123,6 +123,12 @@ struct smbios_board BYTE product; BYTE version; BYTE serial; + BYTE asset_tag; + BYTE feature_flags; + BYTE location; + WORD chassis_handle; + BYTE board_type; + BYTE num_contained_handles; };
struct smbios_chassis @@ -1250,8 +1256,8 @@ static NTSTATUS get_firmware_info( SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti, ULON size_t system_vendor_len, system_product_len, system_version_len, system_serial_len; char system_sku[128], system_family[128]; size_t system_sku_len, system_family_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 board_vendor[128], board_product[128], board_version[128], board_serial[128], board_asset_tag[128]; + size_t board_vendor_len, board_product_len, board_version_len, board_serial_len, board_asset_tag_len; char chassis_vendor[128], chassis_version[128], chassis_serial[128], chassis_asset_tag[128]; char chassis_type[11] = "2"; /* unknown */ size_t chassis_vendor_len, chassis_version_len, chassis_serial_len, chassis_asset_tag_len; @@ -1279,6 +1285,7 @@ static NTSTATUS get_firmware_info( SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti, ULON 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)); + board_asset_tag_len = get_smbios_string("/sys/class/dmi/id/board_asset_tag", S(board_asset_tag)); chassis_vendor_len = get_smbios_string("/sys/class/dmi/id/chassis_vendor", S(chassis_vendor)); chassis_version_len = get_smbios_string("/sys/class/dmi/id/chassis_version", S(chassis_version)); chassis_serial_len = get_smbios_string("/sys/class/dmi/id/chassis_serial", S(chassis_serial)); @@ -1297,7 +1304,8 @@ static NTSTATUS get_firmware_info( SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti, ULON L(system_serial_len) + L(system_sku_len) + L(system_family_len) + 1, 2);
*required_len += sizeof(struct smbios_board); - *required_len += max(L(board_vendor_len) + L(board_product_len) + L(board_version_len) + L(board_serial_len) + 1, 2); + *required_len += max(L(board_vendor_len) + L(board_product_len) + L(board_version_len) + + L(board_serial_len) + L(board_asset_tag_len) + 1, 2);
*required_len += sizeof(struct smbios_chassis); *required_len += max(L(chassis_vendor_len) + L(chassis_version_len) + L(chassis_serial_len) + @@ -1371,24 +1379,6 @@ static NTSTATUS get_firmware_info( SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti, ULON if (!string_count) *buffer++ = 0; *buffer++ = 0;
- string_count = 0; - board = (struct smbios_board*)buffer; - board->hdr.type = 2; - board->hdr.length = sizeof(struct smbios_board); - board->hdr.handle = handle_count++; - 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); - - 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); - if (!string_count) *buffer++ = 0; - *buffer++ = 0; - string_count = 0; chassis = (struct smbios_chassis*)buffer; chassis->hdr.type = 3; @@ -1412,6 +1402,31 @@ static NTSTATUS get_firmware_info( SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti, ULON if (!string_count) *buffer++ = 0; *buffer++ = 0;
+ string_count = 0; + board = (struct smbios_board*)buffer; + board->hdr.type = 2; + board->hdr.length = sizeof(struct smbios_board); + board->hdr.handle = handle_count++; + 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; + board->asset_tag = board_asset_tag_len ? ++string_count : 0; + board->feature_flags = 0x5; /* hosting board, removable */ + board->location = 0; + board->chassis_handle = chassis->hdr.handle; + board->board_type = 0xa; /* motherboard */ + board->num_contained_handles = 0; + buffer += sizeof(struct smbios_board); + + 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); + copy_smbios_string(&buffer, board_asset_tag, board_asset_tag_len); + if (!string_count) *buffer++ = 0; + *buffer++ = 0; + end_of_table = (struct smbios_header*)buffer; end_of_table->type = 127; end_of_table->length = sizeof(struct smbios_header);
Signed-off-by: Brendan Shanks bshanks@codeweavers.com --- dlls/ntdll/unix/system.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c index 69532669bef..56f77a0766b 100644 --- a/dlls/ntdll/unix/system.c +++ b/dlls/ntdll/unix/system.c @@ -143,6 +143,11 @@ struct smbios_chassis BYTE power_supply_state; BYTE thermal_state; BYTE security_status; + DWORD oem_defined; + BYTE height; + BYTE num_power_cords; + BYTE num_contained_elements; + BYTE contained_element_rec_length; };
#include "poppack.h" @@ -1393,6 +1398,11 @@ static NTSTATUS get_firmware_info( SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti, ULON chassis->power_supply_state = 0x02; /* unknown */ chassis->thermal_state = 0x02; /* unknown */ chassis->security_status = 0x02; /* unknown */ + chassis->oem_defined = 0; + chassis->height = 0; /* undefined */ + chassis->num_power_cords = 0; /* unspecified */ + chassis->num_contained_elements = 0; + chassis->contained_element_rec_length = 3; buffer += sizeof(struct smbios_chassis);
copy_smbios_string(&buffer, chassis_vendor, chassis_vendor_len);
Signed-off-by: Brendan Shanks bshanks@codeweavers.com --- dlls/ntdll/unix/system.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c index 56f77a0766b..3148f23df36 100644 --- a/dlls/ntdll/unix/system.c +++ b/dlls/ntdll/unix/system.c @@ -150,6 +150,13 @@ struct smbios_chassis BYTE contained_element_rec_length; };
+struct smbios_boot_info +{ + struct smbios_header hdr; + BYTE reserved[6]; + BYTE boot_status[10]; +}; + #include "poppack.h"
/* Firmware table providers */ @@ -1274,6 +1281,7 @@ static NTSTATUS get_firmware_info( SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti, ULON struct smbios_system *system; struct smbios_board *board; struct smbios_chassis *chassis; + struct smbios_boot_info *boot_info; struct smbios_header *end_of_table;
#define S(s) s, sizeof(s) @@ -1316,6 +1324,9 @@ static NTSTATUS get_firmware_info( SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti, ULON *required_len += max(L(chassis_vendor_len) + L(chassis_version_len) + L(chassis_serial_len) + L(chassis_asset_tag_len) + 1, 2);
+ *required_len += sizeof(struct smbios_boot_info); + *required_len += 2; + *required_len += sizeof(struct smbios_header); *required_len += 2; #undef L @@ -1437,6 +1448,16 @@ static NTSTATUS get_firmware_info( SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti, ULON if (!string_count) *buffer++ = 0; *buffer++ = 0;
+ boot_info = (struct smbios_boot_info*)buffer; + boot_info->hdr.type = 32; + boot_info->hdr.length = sizeof(struct smbios_boot_info); + boot_info->hdr.handle = handle_count++; + memset(boot_info->reserved, 0, sizeof(boot_info->reserved)); + memset(boot_info->boot_status, 0, sizeof(boot_info->boot_status)); /* no errors detected */ + buffer += sizeof(struct smbios_boot_info); + *buffer++ = 0; + *buffer++ = 0; + end_of_table = (struct smbios_header*)buffer; end_of_table->type = 127; end_of_table->length = sizeof(struct smbios_header);