EFI_HOB_GUID_TYPE *GuidHob;\r
BOOLEAN MemoryTypeInformationModified;\r
BOOLEAN MemoryTypeInformationVariableExists;\r
+ EFI_BOOT_MODE BootMode;\r
\r
MemoryTypeInformationModified = FALSE;\r
MemoryTypeInformationVariableExists = FALSE;\r
\r
+\r
+ BootMode = GetBootModeHob ();\r
+ //\r
+ // In BOOT_IN_RECOVERY_MODE, Variable region is not reliable.\r
+ //\r
+ if (BootMode == BOOT_IN_RECOVERY_MODE) {\r
+ return;\r
+ }\r
+\r
//\r
// Only get the the Memory Type Information variable in the boot mode \r
// other than BOOT_WITH_DEFAULT_SETTINGS because the Memory Type\r
// Information is not valid in this boot mode.\r
//\r
- if (GetBootModeHob () != BOOT_WITH_DEFAULT_SETTINGS) {\r
+ if (BootMode != BOOT_WITH_DEFAULT_SETTINGS) {\r
VariableSize = 0;\r
Status = gRT->GetVariable (\r
EFI_MEMORY_TYPE_INFORMATION_VARIABLE_NAME,\r