From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/wbemprox/builtin.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index b8f7d0b8dca..3e61dfa6321 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -1378,6 +1378,26 @@ static WCHAR *get_bios_releasedate( const char *buf, UINT len ) return ret; }
+static WCHAR *get_bios_system_serial_string( BYTE id, const char *buf, UINT len ) +{ + const struct smbios_header *hdr; + const struct smbios_system *system; + UINT offset; + + if (!(hdr = find_smbios_entry( SMBIOS_TYPE_SYSTEM, buf, len ))) return NULL; + system = (const struct smbios_system *)hdr; + offset = (const char *)system - buf + system->hdr.length; + + return get_smbios_string( id, buf, offset, len ); +} + +static WCHAR *get_bios_system_serial( const char *buf, UINT len ) +{ + WCHAR *ret = get_bios_system_serial_string( 4, buf, len ); + if (!ret) return wcsdup( L"0" ); + return ret; +} + static WCHAR *get_bios_smbiosbiosversion( const char *buf, UINT len ) { WCHAR *ret = get_bios_string( 2, buf, len ); @@ -1455,7 +1475,7 @@ static enum fill_status fill_bios( struct table *table, const struct expr *cond rec->manufacturer = get_bios_manufacturer( buf, len ); rec->name = L"Default System BIOS"; rec->releasedate = get_bios_releasedate( buf, len ); - rec->serialnumber = L"0"; + rec->serialnumber = get_bios_system_serial( buf, len ); rec->smbiosbiosversion = get_bios_smbiosbiosversion( buf, len ); rec->smbiosmajorversion = get_bios_smbiosmajorversion( buf, len ); rec->smbiosminorversion = get_bios_smbiosminorversion( buf, len );