# HG changeset patch # User moel.mich # Date 1265894537 0 # Node ID 654696eeebe8b0c2ab2c59f3d2044bccf91a76a9 # Parent 0e09d845eb00d276eef3c3643ada9b2b06430903 A small bug fix for application crashes during the mainboard detection (System.Management.ManagementException: Not supported). diff -r 0e09d845eb00 -r 654696eeebe8 Hardware/SMBIOS/SMBIOSGroup.cs --- a/Hardware/SMBIOS/SMBIOSGroup.cs Tue Feb 09 19:42:33 2010 +0000 +++ b/Hardware/SMBIOS/SMBIOSGroup.cs Thu Feb 11 13:22:17 2010 +0000 @@ -56,34 +56,34 @@ return; List structureList = new List(); - + try { ManagementObjectCollection collection = new ManagementObjectSearcher( "root\\WMI", "SELECT SMBiosData FROM MSSMBios_RawSMBiosTables").Get(); - + byte[] raw = null; foreach (ManagementObject mo in collection) { raw = (byte[])mo["SMBiosData"]; break; - } - + } + if (raw != null && raw.Length > 0) { int offset = 0; byte type = raw[offset]; while (offset < raw.Length && type != 127) { - + type = raw[offset]; offset++; int length = raw[offset]; offset++; - ushort handle = (ushort)((raw[offset] << 8) | raw[offset + 1]); + ushort handle = (ushort)((raw[offset] << 8) | raw[offset + 1]); offset += 2; - + byte[] data = new byte[length]; Array.Copy(raw, offset - 4, data, 0, length); offset += length - 4; - + List stringsList = new List(); if (raw[offset] == 0) offset++; - while (raw[offset] != 0) { + while (raw[offset] != 0) { StringBuilder sb = new StringBuilder(); while (raw[offset] != 0) { sb.Append((char)raw[offset]); offset++; @@ -105,7 +105,7 @@ } } } - } catch (NotImplementedException) { } + } catch (NotImplementedException) { } catch (ManagementException) { } table = structureList.ToArray(); } diff -r 0e09d845eb00 -r 654696eeebe8 Properties/AssemblyInfo.cs --- a/Properties/AssemblyInfo.cs Tue Feb 09 19:42:33 2010 +0000 +++ b/Properties/AssemblyInfo.cs Thu Feb 11 13:22:17 2010 +0000 @@ -69,5 +69,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.1.17.0")] -[assembly: AssemblyFileVersion("0.1.17.0")] +[assembly: AssemblyVersion("0.1.17.1")] +[assembly: AssemblyFileVersion("0.1.17.1")]