From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0712.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe49::712]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id CA0D01A1E83 for ; Mon, 3 Oct 2016 09:39:09 -0700 (PDT) Received: from CS1PR84MB0229.NAMPRD84.PROD.OUTLOOK.COM (10.162.190.151) by CS1PR84MB0117.NAMPRD84.PROD.OUTLOOK.COM (10.162.189.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.649.16; Mon, 3 Oct 2016 16:39:07 +0000 Received: from CS1PR84MB0229.NAMPRD84.PROD.OUTLOOK.COM ([10.162.190.151]) by CS1PR84MB0229.NAMPRD84.PROD.OUTLOOK.COM ([10.162.190.151]) with mapi id 15.01.0649.021; Mon, 3 Oct 2016 16:39:07 +0000 From: "Shah, Tapan" To: "Shia, Cinnamon" , "edk2-devel@lists.01.org" CC: "jaben.carsey@intel.com" , "ruiyu.ni@intel.com" Thread-Topic: [edk2] [PATCH v2] ShellPkg/Shell: Update CRC32 in the EFI System Table header Thread-Index: AQHSHZSAIHJa5luqt0qKArf0/SRzVqCW7gaQ Date: Mon, 3 Oct 2016 16:39:07 +0000 Message-ID: References: <20161003163717.12348-1-cinnamon.shia@hpe.com> In-Reply-To: <20161003163717.12348-1-cinnamon.shia@hpe.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=tapandshah@hpe.com; x-originating-ip: [15.203.227.10] x-ms-office365-filtering-correlation-id: f3d04612-2159-460e-2efd-08d3ebabcbb9 x-microsoft-exchange-diagnostics: 1; CS1PR84MB0117; 7:zy1DqBzpURmzuOq42RFcmmb1Y6hBVisMprQen/kRS8z/cJjNt0K6EKPhZG/Gn+NcoSh+khiL9p/HHcVrDyZ/6b4+gj7K+aqbMrFv7yyNtJ264y9GqQe1NQwkjTyl2QaSWz/7S7LrFOrdbu0zKXnwHKUdGgzzRr3TovW7cpQOfXzZnt4pkiLnI//BFeGwNecqe4iH0akJcClgeobs2BSH9UT7fqCR0GOR6GMomKPPOPpUW6s4j4M5IWKGNcm0NcAZq62EBXykYKb6di2VooxqwEdyAmJcCPrX+2MjsdUARzxbgpb7596lcNZN6idswROXbJyPDdGJIdUIOTu8b7/N0Q== x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CS1PR84MB0117; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(227479698468861)(162533806227266)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026); SRVR:CS1PR84MB0117; BCL:0; PCL:0; RULEID:; SRVR:CS1PR84MB0117; x-forefront-prvs: 008421A8FF x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(7916002)(189002)(377454003)(199003)(13464003)(92566002)(97736004)(87936001)(189998001)(106116001)(5660300001)(81156014)(50986999)(8676002)(3660700001)(122556002)(5001770100001)(54356999)(7696004)(76176999)(81166006)(15650500001)(105586002)(99286002)(2501003)(106356001)(68736007)(3280700002)(4326007)(9686002)(19580405001)(10400500002)(2900100001)(19580395003)(8936002)(66066001)(74316002)(2950100002)(305945005)(6116002)(101416001)(33656002)(86362001)(7736002)(2906002)(77096005)(7846002)(5002640100001)(15975445007)(11100500001)(3846002)(586003)(102836003); DIR:OUT; SFP:1102; SCL:1; SRVR:CS1PR84MB0117; H:CS1PR84MB0229.NAMPRD84.PROD.OUTLOOK.COM; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: hpe.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: hpe.com X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Oct 2016 16:39:07.8257 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-Transport-CrossTenantHeadersStamped: CS1PR84MB0117 Subject: Re: [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:39:10 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-By: Tapan Shah -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Shia= , Cinnamon Sent: Monday, October 03, 2016 11:37 AM To: edk2-devel@lists.01.org Cc: jaben.carsey@intel.com; ruiyu.ni@intel.com Subject: [edk2] [PATCH v2] ShellPkg/Shell: Update CRC32 in the EFI System T= able header Update CRC32 in the EFI System Table header after shell changes the value o= f 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/Applicat= ion/Shell/ConsoleLogger.c index 9b64303..563e5e6 100644 --- a/ShellPkg/Application/Shell/ConsoleLogger.c +++ b/ShellPkg/Application/Shell/ConsoleLogger.c @@ -3,6 +3,7 @@ =20 (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 BS= D License which accompanies this distribution. The full text of the license may b= e found at @@ -91,6 +92,15 @@ ConsoleLoggerInstall( gST->ConsoleOutHandle =3D gImageHandle; gST->ConOut =3D &(*ConsoleInfo)->OurConOut; =20 + // + // Update the CRC32 in the EFI System Table header // + gST->Hdr.CRC32 =3D 0; + gBS->CalculateCrc32 ( + (UINT8 *)&gST->Hdr, + gST->Hdr.HeaderSize, + &gST->Hdr.CRC32 + ); return (Status); } =20 @@ -126,6 +136,16 @@ ConsoleLoggerUninstall( gST->ConsoleOutHandle =3D ConsoleInfo->OldConHandle; gST->ConOut =3D ConsoleInfo->OldConOut; =20 + // + // Update the CRC32 in the EFI System Table header // + gST->Hdr.CRC32 =3D 0; + gBS->CalculateCrc32 ( + (UINT8 *)&gST->Hdr, + gST->Hdr.HeaderSize, + &gST->Hdr.CRC32 + ); + return (gBS->UninstallProtocolInterface(gImageHandle, &gEfiSimpleTextOut= ProtocolGuid, (VOID*)&ConsoleInfo->OurConOut)); } =20 -- 2.10.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel