@@ -826,9 +826,10 @@ PatchMemoryDevice (
826826 OUT SMBIOS_HANDLE * Handle
827827 )
828828{
829- UINT8 MinLength ;
830- UINT8 StringIndex ;
831- UINT8 FormFactor ;
829+ UINT8 MinLength ;
830+ UINT8 StringIndex ;
831+ UINT8 FormFactor ;
832+ CONST CHAR8 * DummyString ;
832833
833834 * Handle = OcSmbiosInvalidHandle ;
834835 MinLength = sizeof (* Original .Standard .Type17 );
@@ -863,11 +864,21 @@ PatchMemoryDevice (
863864 //
864865 // Some machines may have NULL values for these fields, which will cause SPMemoryReporter
865866 // crashes or ??? to be displayed in About This Mac. Fallback to "Unknown" for such fields.
866- //
867- SMBIOS_OVERRIDE_S (Table , Standard .Type17 -> Manufacturer , Original , NULL , & StringIndex , "Unknown" );
868- SMBIOS_OVERRIDE_S (Table , Standard .Type17 -> SerialNumber , Original , NULL , & StringIndex , "Unknown" );
869- SMBIOS_OVERRIDE_S (Table , Standard .Type17 -> AssetTag , Original , NULL , & StringIndex , "Unknown" );
870- SMBIOS_OVERRIDE_S (Table , Standard .Type17 -> PartNumber , Original , NULL , & StringIndex , "Unknown" );
867+ // If there is no stick in the slot, the Manufacturer value must be "NO DIMM", this
868+ // is checked in System Profiler, at least by iMacPro1,1 (see ExpansionSlotSupport.framework).
869+ //
870+ if (Table -> CurrentPtr .Standard .Type17 -> Size > 0 ) {
871+ SMBIOS_OVERRIDE_S (Table , Standard .Type17 -> Manufacturer , Original , NULL , & StringIndex , "Unknown" );
872+ SMBIOS_OVERRIDE_S (Table , Standard .Type17 -> SerialNumber , Original , NULL , & StringIndex , "Unknown" );
873+ SMBIOS_OVERRIDE_S (Table , Standard .Type17 -> AssetTag , Original , NULL , & StringIndex , "Unknown" );
874+ SMBIOS_OVERRIDE_S (Table , Standard .Type17 -> PartNumber , Original , NULL , & StringIndex , "Unknown" );
875+ } else {
876+ SmbiosOverrideString (Table , "NO DIMM" , & StringIndex );
877+ Table -> CurrentPtr .Standard .Type17 -> Manufacturer = StringIndex ;
878+ Table -> CurrentPtr .Standard .Type17 -> SerialNumber = StringIndex ;
879+ Table -> CurrentPtr .Standard .Type17 -> AssetTag = StringIndex ;
880+ Table -> CurrentPtr .Standard .Type17 -> PartNumber = StringIndex ;
881+ }
871882
872883 SMBIOS_OVERRIDE_V (Table , Standard .Type17 -> Attributes , Original , NULL , NULL );
873884 SMBIOS_OVERRIDE_V (Table , Standard .Type17 -> ExtendedSize , Original , NULL , NULL );
0 commit comments