diff options
author | Cinnamon Shia <cinnamon.shia@hpe.com> | 2016-10-03 09:37:17 -0700 |
---|---|---|
committer | Jaben Carsey <jaben.carsey@intel.com> | 2016-10-03 14:36:18 -0700 |
commit | 8550b5f0810f306850f9a07ee551099155d89ae0 (patch) | |
tree | 2f31491675ae10f770e785e42deb1a91c6f9c995 /ShellPkg | |
parent | ed72804638c9b240477c5235d72c3823483813b2 (diff) | |
download | edk2-8550b5f0810f306850f9a07ee551099155d89ae0.tar.gz edk2-8550b5f0810f306850f9a07ee551099155d89ae0.tar.bz2 edk2-8550b5f0810f306850f9a07ee551099155d89ae0.zip |
ShellPkg/Shell: Update CRC32 in the EFI System Table header
Update CRC32 in the EFI System Table header after shell changes the
value of gST->ConsoleOutHandle and gST->ConOut
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Cinnamon Shia <cinnamon.shia@hpe.com>
Reviewed-By: Tapan Shah <tapandshah@hpe.com>
Reviewed-By: Jaben Carsey <Jaben.carsey@intel.com>
Diffstat (limited to 'ShellPkg')
-rw-r--r-- | ShellPkg/Application/Shell/ConsoleLogger.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/ShellPkg/Application/Shell/ConsoleLogger.c b/ShellPkg/Application/Shell/ConsoleLogger.c index 9b64303cf0..563e5e6be7 100644 --- a/ShellPkg/Application/Shell/ConsoleLogger.c +++ b/ShellPkg/Application/Shell/ConsoleLogger.c @@ -3,6 +3,7 @@ (C) Copyright 2013 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>
+ (C) Copyright 2016 Hewlett-Packard Development Company, L.P.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -91,6 +92,15 @@ ConsoleLoggerInstall( gST->ConsoleOutHandle = gImageHandle;
gST->ConOut = &(*ConsoleInfo)->OurConOut;
+ //
+ // Update the CRC32 in the EFI System Table header
+ //
+ gST->Hdr.CRC32 = 0;
+ gBS->CalculateCrc32 (
+ (UINT8 *)&gST->Hdr,
+ gST->Hdr.HeaderSize,
+ &gST->Hdr.CRC32
+ );
return (Status);
}
@@ -126,6 +136,16 @@ ConsoleLoggerUninstall( gST->ConsoleOutHandle = ConsoleInfo->OldConHandle;
gST->ConOut = ConsoleInfo->OldConOut;
+ //
+ // Update the CRC32 in the EFI System Table header
+ //
+ gST->Hdr.CRC32 = 0;
+ gBS->CalculateCrc32 (
+ (UINT8 *)&gST->Hdr,
+ gST->Hdr.HeaderSize,
+ &gST->Hdr.CRC32
+ );
+
return (gBS->UninstallProtocolInterface(gImageHandle, &gEfiSimpleTextOutProtocolGuid, (VOID*)&ConsoleInfo->OurConOut));
}
|