]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Make shell not ASSERT on older versions of EFI. On a Mac if you soft load Hii, Device...
authorandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 1 Jun 2011 02:27:02 +0000 (02:27 +0000)
committerandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 1 Jun 2011 02:27:02 +0000 (02:27 +0000)
Reviewed by: jcarsey

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11719 6f19259b-4bc3-4df7-8a09-765794883524

ShellPkg/Application/Shell/ShellEnvVar.c
ShellPkg/Application/Shell/ShellProtocol.c

index 174a783830f6ff271e374a21e56aa7364688760a..810f843149733aa799556b036fc932ba5f61cb7b 100644 (file)
@@ -148,9 +148,13 @@ GetEnvironmentVariableList(
     return (EFI_INVALID_PARAMETER);\r
   }\r
 \r
-  Status = gRT->QueryVariableInfo(EFI_VARIABLE_NON_VOLATILE|EFI_VARIABLE_BOOTSERVICE_ACCESS, &MaxStorSize, &RemStorSize, &MaxVarSize);\r
-  if (EFI_ERROR(Status)) {\r
-    return (Status);\r
+  if (gRT->Hdr.Revision >= EFI_2_00_SYSTEM_TABLE_REVISION) {\r
+    Status = gRT->QueryVariableInfo(EFI_VARIABLE_NON_VOLATILE|EFI_VARIABLE_BOOTSERVICE_ACCESS, &MaxStorSize, &RemStorSize, &MaxVarSize);\r
+    if (EFI_ERROR(Status)) {\r
+      return (Status);\r
+    }\r
+  } else {\r
+    MaxVarSize = 16384;\r
   }\r
 \r
   NameSize = (UINTN)MaxVarSize;\r
index 8b2e89041b8c62d59529392b70bc9d8bf0901580..f0416ca93705c38f8b12baa4743048f1c1c33055 100644 (file)
@@ -3301,15 +3301,16 @@ CleanUpShellProtocol (
     NULL,\r
     EFI_OPEN_PROTOCOL_GET_PROTOCOL);\r
 \r
-  Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlCNotifyHandle1);\r
-  Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlCNotifyHandle2);\r
-  Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlCNotifyHandle3);\r
-  Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlCNotifyHandle4);\r
-  Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlSNotifyHandle1);\r
-  Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlSNotifyHandle2);\r
-  Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlSNotifyHandle3);\r
-  Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlSNotifyHandle4);\r
-\r
+  if (!EFI_ERROR (Status)) {\r
+    Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlCNotifyHandle1);\r
+    Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlCNotifyHandle2);\r
+    Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlCNotifyHandle3);\r
+    Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlCNotifyHandle4);\r
+    Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlSNotifyHandle1);\r
+    Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlSNotifyHandle2);\r
+    Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlSNotifyHandle3);\r
+    Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlSNotifyHandle4);\r
+  }\r
   return (Status);\r
 }\r
 \r