From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from g2t2352.austin.hpe.com (g2t2352.austin.hpe.com [15.233.44.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 3A9E11A1E83 for ; Mon, 3 Oct 2016 09:37:29 -0700 (PDT) Received: from SHIAC15.asiapacific.hpqcorp.net (unknown [16.169.129.227]) by g2t2352.austin.hpe.com (Postfix) with ESMTP id 9E21F54; Mon, 3 Oct 2016 16:37:26 +0000 (UTC) From: Cinnamon Shia To: edk2-devel@lists.01.org Cc: jaben.carsey@intel.com, ruiyu.ni@intel.com, Cinnamon Shia Date: Tue, 4 Oct 2016 00:37:17 +0800 Message-Id: <20161003163717.12348-1-cinnamon.shia@hpe.com> X-Mailer: git-send-email 2.10.0.windows.1 Subject: [PATCH v2] ShellPkg/Shell: Update CRC32 in the EFI System Table header X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Oct 2016 16:37:29 -0000 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 --- ShellPkg/Application/Shell/ConsoleLogger.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/ShellPkg/Application/Shell/ConsoleLogger.c b/ShellPkg/Application/Shell/ConsoleLogger.c index 9b64303..563e5e6 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.
Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
+ (C) Copyright 2016 Hewlett-Packard Development Company, L.P.
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)); } -- 2.10.0.windows.1