From nobody Wed Dec 25 01:13:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1511762139160399.00403129093036; Sun, 26 Nov 2017 21:55:39 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 5C02B21B00DC4; Sun, 26 Nov 2017 21:51:15 -0800 (PST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 B655621A1099D for ; Sun, 26 Nov 2017 21:51:13 -0800 (PST) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Nov 2017 21:55:35 -0800 Received: from ray-dev.ccr.corp.intel.com ([10.239.9.15]) by orsmga005.jf.intel.com with ESMTP; 26 Nov 2017 21:55:34 -0800 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.31; helo=mga06.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,463,1505804400"; d="scan'208";a="178109684" From: Ruiyu Ni To: edk2-devel@lists.01.org Date: Mon, 27 Nov 2017 13:55:30 +0800 Message-Id: <20171127055532.320556-2-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.15.0.gvfs.1.preview.4 In-Reply-To: <20171127055532.320556-1-ruiyu.ni@intel.com> References: <20171127055532.320556-1-ruiyu.ni@intel.com> Subject: [edk2] [PATCH v2 1/3] ShellPkg/ShellLib: Constructor doesn't depend on ShellParameters X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jaben Carsey , Michael D Kinney MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" When ShellLib is linked to a driver producing DynamicCommand protocol, ShellParameters protocol is set by DynamicCommand.Handler(). The driver image handle doesn't have ShellParameters protocol installed. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni Cc: Jaben Carsey Cc: Michael D Kinney --- ShellPkg/Library/UefiShellLib/UefiShellLib.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c b/ShellPkg/Librar= y/UefiShellLib/UefiShellLib.c index 677791c67f..00f58ca0c1 100644 --- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c +++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c @@ -215,7 +215,7 @@ ShellLibConstructorWorker ( gEfiShellParametersProtocol =3D NULL; } =20 - if (gEfiShellParametersProtocol =3D=3D NULL || gEfiShellProtocol =3D=3D = NULL) { + if (gEfiShellProtocol =3D=3D NULL) { // // Moved to seperate function due to complexity // @@ -238,10 +238,14 @@ ShellLibConstructorWorker ( } =20 // - // only success getting 2 of either the old or new, but no 1/2 and 1/2 + // Getting either EDK Shell's ShellEnvironment2 and ShellInterface proto= col + // or UEFI Shell's Shell protocol. + // When ShellLib is linked to a driver producing DynamicCommand protocol, + // ShellParameters protocol is set by DynamicCommand.Handler(). // - if ((mEfiShellEnvironment2 !=3D NULL && mEfiShellInterface !=3D= NULL) || - (gEfiShellProtocol !=3D NULL && gEfiShellParametersProtocol !=3D= NULL) ) { + if ((mEfiShellEnvironment2 !=3D NULL && mEfiShellInterface !=3D NULL) || + (gEfiShellProtocol !=3D NULL) + ) { if (gEfiShellProtocol !=3D NULL) { FileFunctionMap.GetFileInfo =3D gEfiShellProtocol->GetFileInfo; FileFunctionMap.SetFileInfo =3D gEfiShellProtocol->SetFileInfo; --=20 2.15.0.gvfs.1.preview.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel