Make shell not ASSERT on older versions of EFI. On a Mac if you soft load Hii, DevicePathToText, and ComponentName drivers from edk2, then with this patch the new Shell will run.

Reviewed by: jcarsey



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11719 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
andrewfish 2011-06-01 02:27:02 +00:00
parent d59326d3a8
commit a7a394a483
2 changed files with 17 additions and 12 deletions

View File

@ -148,10 +148,14 @@ GetEnvironmentVariableList(
return (EFI_INVALID_PARAMETER); return (EFI_INVALID_PARAMETER);
} }
if (gRT->Hdr.Revision >= EFI_2_00_SYSTEM_TABLE_REVISION) {
Status = gRT->QueryVariableInfo(EFI_VARIABLE_NON_VOLATILE|EFI_VARIABLE_BOOTSERVICE_ACCESS, &MaxStorSize, &RemStorSize, &MaxVarSize); Status = gRT->QueryVariableInfo(EFI_VARIABLE_NON_VOLATILE|EFI_VARIABLE_BOOTSERVICE_ACCESS, &MaxStorSize, &RemStorSize, &MaxVarSize);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
return (Status); return (Status);
} }
} else {
MaxVarSize = 16384;
}
NameSize = (UINTN)MaxVarSize; NameSize = (UINTN)MaxVarSize;
VariableName = AllocateZeroPool(NameSize); VariableName = AllocateZeroPool(NameSize);

View File

@ -3301,6 +3301,7 @@ CleanUpShellProtocol (
NULL, NULL,
EFI_OPEN_PROTOCOL_GET_PROTOCOL); EFI_OPEN_PROTOCOL_GET_PROTOCOL);
if (!EFI_ERROR (Status)) {
Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlCNotifyHandle1); Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlCNotifyHandle1);
Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlCNotifyHandle2); Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlCNotifyHandle2);
Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlCNotifyHandle3); Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlCNotifyHandle3);
@ -3309,7 +3310,7 @@ CleanUpShellProtocol (
Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlSNotifyHandle2); Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlSNotifyHandle2);
Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlSNotifyHandle3); Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlSNotifyHandle3);
Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlSNotifyHandle4); Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlSNotifyHandle4);
}
return (Status); return (Status);
} }