Commit 4e71e867 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

ntdll: Read the chassis type from sysfs.

parent 0bebbbaa
...@@ -115,7 +115,7 @@ struct smbios_board { ...@@ -115,7 +115,7 @@ struct smbios_board {
struct smbios_chassis { struct smbios_chassis {
struct smbios_header hdr; struct smbios_header hdr;
BYTE vendor; BYTE vendor;
BYTE shape; BYTE type;
BYTE version; BYTE version;
BYTE serial; BYTE serial;
BYTE asset_tag; BYTE asset_tag;
...@@ -2117,6 +2117,7 @@ static NTSTATUS get_firmware_info(SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti, ULONG ...@@ -2117,6 +2117,7 @@ static NTSTATUS get_firmware_info(SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti, ULONG
char board_vendor[128], board_product[128], board_version[128], board_serial[128]; 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; size_t board_vendor_len, board_product_len, board_version_len, board_serial_len;
char chassis_vendor[128], chassis_version[128], chassis_serial[128], chassis_asset_tag[128]; 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; size_t chassis_vendor_len, chassis_version_len, chassis_serial_len, chassis_asset_tag_len;
char *buffer = (char*)sfti->TableBuffer; char *buffer = (char*)sfti->TableBuffer;
BYTE string_count; BYTE string_count;
...@@ -2142,6 +2143,7 @@ static NTSTATUS get_firmware_info(SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti, ULONG ...@@ -2142,6 +2143,7 @@ static NTSTATUS get_firmware_info(SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti, ULONG
chassis_version_len = get_smbios_string("/sys/class/dmi/id/chassis_version", S(chassis_version)); 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)); chassis_serial_len = get_smbios_string("/sys/class/dmi/id/chassis_serial", S(chassis_serial));
chassis_asset_tag_len = get_smbios_string("/sys/class/dmi/id/chassis_tag", S(chassis_asset_tag)); chassis_asset_tag_len = get_smbios_string("/sys/class/dmi/id/chassis_tag", S(chassis_asset_tag));
get_smbios_string("/sys/class/dmi/id/chassis_type", S(chassis_type));
#undef S #undef S
*required_len = sizeof(struct smbios_prologue); *required_len = sizeof(struct smbios_prologue);
...@@ -2237,7 +2239,7 @@ static NTSTATUS get_firmware_info(SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti, ULONG ...@@ -2237,7 +2239,7 @@ static NTSTATUS get_firmware_info(SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti, ULONG
chassis->hdr.length = sizeof(struct smbios_chassis); chassis->hdr.length = sizeof(struct smbios_chassis);
chassis->hdr.handle = 0; chassis->hdr.handle = 0;
chassis->vendor = chassis_vendor_len ? ++string_count : 0; chassis->vendor = chassis_vendor_len ? ++string_count : 0;
chassis->shape = 0x2; /* unknown */ chassis->type = atoi(chassis_type);
chassis->version = chassis_version_len ? ++string_count : 0; chassis->version = chassis_version_len ? ++string_count : 0;
chassis->serial = chassis_serial_len ? ++string_count : 0; chassis->serial = chassis_serial_len ? ++string_count : 0;
chassis->asset_tag = chassis_asset_tag_len ? ++string_count : 0; chassis->asset_tag = chassis_asset_tag_len ? ++string_count : 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment