From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 F2B6021A6F105 for ; Thu, 20 Apr 2017 01:14:18 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Apr 2017 01:14:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,224,1488873600"; d="scan'208";a="1158641659" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga002.fm.intel.com with ESMTP; 20 Apr 2017 01:14:18 -0700 Received: from fmsmsx154.amr.corp.intel.com (10.18.116.70) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 20 Apr 2017 01:14:18 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX154.amr.corp.intel.com (10.18.116.70) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 20 Apr 2017 01:14:18 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.246]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.117]) with mapi id 14.03.0319.002; Thu, 20 Apr 2017 16:14:16 +0800 From: "Dong, Eric" To: "Wu, Jiaxin" , "edk2-devel@lists.01.org" CC: "Ye, Ting" , "Fu, Siyuan" Thread-Topic: [Patch] MdeModulePkg/DeviceManagerUiLib: Fix the network device MAC display issue Thread-Index: AQHSt1G/5r04WHSwIES0tZyJc1a7x6HN7R1g Date: Thu, 20 Apr 2017 08:14:15 +0000 Message-ID: References: <1492416466-22044-1-git-send-email-jiaxin.wu@intel.com> In-Reply-To: <1492416466-22044-1-git-send-email-jiaxin.wu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [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: , X-List-Received-Date: Thu, 20 Apr 2017 08:14:19 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Jiaxin, Thanks to help to fix this issue.=20 We'd better define new STR_FORM_NETWORK_DEVICE_TITLE_HEAD for L" Network De= vice " instead of hard code in the code. Thanks, Eric -----Original Message----- From: Wu, Jiaxin=20 Sent: Monday, April 17, 2017 4:08 PM To: edk2-devel@lists.01.org Cc: Dong, Eric; Ye, Ting; Fu, Siyuan; Wu, Jiaxin Subject: [Patch] MdeModulePkg/DeviceManagerUiLib: Fix the network device MA= C display issue Network device tile (STR_FORM_NETWORK_DEVICE_TITLE) is dynamic adjusted acc= ording the different MAC value. So, the string value shouldn't be treated a= s a constant string (Network Device). Otherwise, the display will be incorr= ect. Reproduce: Device Manager->Network Device List, select to enter MAC, then t= o press ESC back to previous page, then re-enter, found each enter/ESC oper= ation, 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",=20 + mSelectedMacAddrString); HiiSetString (HiiHandle, STRING_TOKEN (STR_FORM_NETWORK_DEVICE_TITLE),= NewStringTitle, NULL); =20 - FreePool (String); FreePool (NewStringTitle); } =20 // // Allocate space for creation of UpdateData Buffer -- 1.9.5.msysgit.1