MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / ParseSMBIOSSettings

Function ParseSMBIOSSettings

rEFIt_UEFI/Platform/Settings.cpp:3830–4285  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3828}
3829
3830VOID
3831ParseSMBIOSSettings(
3832 const TagDict* DictPointer
3833 )
3834{
3835 const TagStruct* Prop;
3836 const TagStruct* Prop1;
3837 BOOLEAN Default = FALSE;
3838
3839
3840 Prop = DictPointer->propertyForKey("ProductName");
3841 if (Prop != NULL) {
3842 if ( !Prop->isString() ) {
3843 MsgLog("ATTENTION : property not string in ProductName\n");
3844 }else{
3845 MACHINE_TYPES Model;
3846 gSettings.ProductName = Prop->getString()->stringValue();
3847 // let's fill all other fields based on this ProductName
3848 // to serve as default
3849 Model = GetModelFromString(gSettings.ProductName);
3850 if (Model != MaxMachineType) {
3851 SetDMISettingsForModel (Model, FALSE);
3852 Default = TRUE;
3853 } else {
3854 //if new model then fill at least as iMac13,2, except custom ProductName
3855 // something else?
3856 SetDMISettingsForModel (iMac132, FALSE);
3857 }
3858 }
3859 }
3860 DBG("Using ProductName from config: %s\n", gSettings.ProductName.c_str());
3861
3862 Prop = DictPointer->propertyForKey("SmbiosVersion");
3863 gSettings.SmbiosVersion = (UINT16)GetPropertyAsInteger(Prop, 0x204);
3864
3865 // Check for BiosVersion and BiosReleaseDate by Sherlocks
3866 Prop = DictPointer->propertyForKey("BiosVersion");
3867 if (Prop != NULL) {
3868 if ( !Prop->isString() ) {
3869 DBG("BiosVersion: not set, Using BiosVersion from clover\n");
3870 }else{
3871 const CHAR8* i = gSettings.RomVersion.c_str();
3872 const CHAR8* j = Prop->getString()->stringValue().c_str();
3873
3874 i += AsciiStrLen(i);
3875 while (*i != '.') {
3876 i--;
3877 }
3878
3879 j += AsciiStrLen(j);
3880 while (*j != '.') {
3881 j--;
3882 }
3883
3884 if (((i[1] > '0') && (j[1] == '0')) || ((i[1] >= j[1]) && (i[2] > j[2]))) {
3885 DBG("Using latest BiosVersion from clover\n");
3886 } else if ((i[1] == j[1]) && (i[2] == j[2])) {
3887 if (((i[3] > '0') && (j[3] == '0')) || ((i[3] >= j[3]) && (i[4] > j[4]))) {

Callers 2

RefitMainFunction · 0.85
GetUserSettingsFunction · 0.85

Calls 15

GetModelFromStringFunction · 0.85
SetDMISettingsForModelFunction · 0.85
GetPropertyAsIntegerFunction · 0.85
AsciiStrLenFunction · 0.85
AsciiStrVersionToUint64Function · 0.85
IsValidGuidAsciiStringFunction · 0.85
StrToGuidLEFunction · 0.85
IsPropertyNotNullAndTrueFunction · 0.85
propertyForKeyMethod · 0.80
S8PrintfMethod · 0.80
trimMethod · 0.80

Tested by

no test coverage detected