From nobody Mon Apr 29 13:05:57 2024 Delivered-To: importer@patchew.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; Authentication-Results: mx.zoho.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 1492416477314798.9288823647405; Mon, 17 Apr 2017 01:07:57 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id C732D20D7A3CE; Mon, 17 Apr 2017 01:07:54 -0700 (PDT) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (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 3FEA420D7A3A2 for ; Mon, 17 Apr 2017 01:07:53 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Apr 2017 01:07:52 -0700 Received: from jiaxinwu-mobl2.ccr.corp.intel.com ([10.239.196.63]) by FMSMGA003.fm.intel.com with ESMTP; 17 Apr 2017 01:07:51 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,213,1488873600"; d="scan'208";a="846762159" From: Jiaxin Wu To: edk2-devel@lists.01.org Date: Mon, 17 Apr 2017 16:07:46 +0800 Message-Id: <1492416466-22044-1-git-send-email-jiaxin.wu@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 Subject: [edk2] [Patch] MdeModulePkg/DeviceManagerUiLib: Fix the network device MAC display issue 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: Ye Ting , Fu Siyuan , Wu Jiaxin , Eric Dong 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" Network device tile (STR_FORM_NETWORK_DEVICE_TITLE) is dynamic adjusted according the different MAC value. So, the string value shouldn't be treated as a constant string (Network Device). Otherwise, the display will be incorrect. Reproduce: Device Manager->Network Device List, select to enter MAC, then to press ESC back to previous page, then re-enter, found each enter/ESC operat= ion, the MAC address display +1. Cc: Eric Dong Cc: Ye Ting Cc: Fu Siyuan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin --- MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c b/MdeM= odulePkg/Library/DeviceManagerUiLib/DeviceManager.c index 5098b70..8630ab0 100644 --- a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c +++ b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c @@ -538,17 +538,15 @@ CreateDeviceManagerForm( =20 // // Update the network device form titile. // if (NextShowFormId =3D=3D NETWORK_DEVICE_FORM_ID) { - String =3D HiiGetString (HiiHandle, STRING_TOKEN (STR_FORM_NETWORK_DEV= ICE_TITLE), NULL); NewStringLen =3D StrLen(mSelectedMacAddrString) * 2; - NewStringLen +=3D (StrLen(String) + 2) * 2; + NewStringLen +=3D (StrLen (L"Network Device") + 2) * 2; NewStringTitle =3D AllocatePool (NewStringLen); - UnicodeSPrint (NewStringTitle, NewStringLen, L"%s %s", String, mSelect= edMacAddrString); + UnicodeSPrint (NewStringTitle, NewStringLen, L"Network Device %s", mSe= lectedMacAddrString); HiiSetString (HiiHandle, STRING_TOKEN (STR_FORM_NETWORK_DEVICE_TITLE),= NewStringTitle, NULL); =20 - FreePool (String); FreePool (NewStringTitle); } =20 // // Allocate space for creation of UpdateData Buffer --=20 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel