From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web09.16677.1658670321361279177 for ; Sun, 24 Jul 2022 06:45:21 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=gCa2WpCS; spf=pass (domain: intel.com, ip: 192.55.52.120, mailfrom: bob.c.feng@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1658670321; x=1690206321; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=rAx/szFOXjlrfg02TvwK1iaN9mHV/8+0U+6X14RpQw0=; b=gCa2WpCSoakXelAeUzD6Fxf9KEJgHuVNB5EQtdn8jukeAdSNygT+PJ+R pOtArPyxb6Qwh3X1Irb5OGVmxeVL6p2zr8LYxnikKC8r+Dq72vorvKD9b QpYoyiI1HqwcqoMF0fHvtTLeVg93XrWlxF/JAuWJAIyahiOCynjxL/tQS mL4Ck+T1e7Fqh2UrFXWVqphp0m/zcH62Boi22Ixl+AdrAuCObotbVf8MJ ebXkHvCJbEze6wqKBws3r1CNChKp/3rnj78VsBO5J5XfOx4PYRLBzcv6P HUi1mo4wHlVkkjjiBpX++wQTRRINr72Y6zN5bYCJ3LlVd5rQZvOtt2hsG w==; X-IronPort-AV: E=McAfee;i="6400,9594,10417"; a="286305739" X-IronPort-AV: E=Sophos;i="5.93,190,1654585200"; d="scan'208";a="286305739" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jul 2022 06:45:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,190,1654585200"; d="scan'208";a="775691775" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga005.jf.intel.com with ESMTP; 24 Jul 2022 06:45:20 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sun, 24 Jul 2022 06:45:20 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sun, 24 Jul 2022 06:45:19 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28 via Frontend Transport; Sun, 24 Jul 2022 06:45:19 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.41) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Sun, 24 Jul 2022 06:45:19 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SrJPxyt0z19R1NmGPSsijmpVOseZtfFn3TnTHM2dJEqYUUZLoo1h/JLmjQJX1pmnqrnU7d0c0mOoCiIcKf4FzfmkN8QGtFK0glY2T2Fqjo2LGCgDBssfenmbF+bSTkKIoD3sShfJg4CZhsG2ohp3hOCSqr7joFr+TlrAwGBeoadKwnV7tsVHPwxQkcPQk94xR8Ybx+Ym9UlS3F+sZi+k1JcYsDJN+yaGvTEtrRvN7yGpRaqH8QBmJvqPtkEBPFK+kvv0HzEyDnztLukcLglWzvMnKO8OaoawldZxcgsXHedh+1JMrYmmrV9dBjmofvoHP7ZpCrWLcB5hgrAkPsXfgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=HEAPT8KsIcpH5bG37GHWlgoqfQ/WGlcEDx6E9fhUqp8=; b=IFADHDntOU7Lyw1xbzJTFftFx8GaE7WkaoYpFNhWgGx4+UvAQw8MX92zLt0rmCRJKRrZIndTjG2qt4XDzxqNBn27Hqitke80CrjMH/GoY6tA8wFfGU8j/d7IqqLKZqtV526xV2+mPNkFBmZIJ4HUjlgwa7QtYy7CcZNzp0QJtkcQ7Tj2YVFzBtU+cpgEt0LtgqUyDyhxk9sYekWAQreLMt54WO3tluqd1RhsL4Er8IVOoCCGA0O7yYS9d7b5a5czy3r5z1oFyu+vYZ7I48Yc2Nqwca0MWYuixg1WwYnojhpM9KtuPR2Z8JYahqFewBnmM3GtpsykCWnpnJHzdHxtsw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from PH7PR11MB5863.namprd11.prod.outlook.com (2603:10b6:510:135::11) by SN6PR11MB3439.namprd11.prod.outlook.com (2603:10b6:805:da::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.21; Sun, 24 Jul 2022 13:45:13 +0000 Received: from PH7PR11MB5863.namprd11.prod.outlook.com ([fe80::943:4b5a:b96b:30f8]) by PH7PR11MB5863.namprd11.prod.outlook.com ([fe80::943:4b5a:b96b:30f8%5]) with mapi id 15.20.5458.023; Sun, 24 Jul 2022 13:45:13 +0000 From: "Bob Feng" To: Konstantin Aladyshev , "devel@edk2.groups.io" CC: "Gao, Liming" , "Chen, Christine" Subject: Re: [PATCH] BaseTools/VolInfo: Correct EFI_SECTION_VERSION display Thread-Topic: [PATCH] BaseTools/VolInfo: Correct EFI_SECTION_VERSION display Thread-Index: AQHYmor01P/OxsP5AESrE0YbKPhDOa2NkgVg Date: Sun, 24 Jul 2022 13:45:13 +0000 Message-ID: References: <20220718094352.9834-1-aladyshev22@gmail.com> In-Reply-To: <20220718094352.9834-1-aladyshev22@gmail.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.6.500.17 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 22a48a75-a079-4661-6d4a-08da6d7abbd7 x-ms-traffictypediagnostic: SN6PR11MB3439:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: BGDEWg18NmhW2cgPSl1IwDOC9tjFLOqBMioKzTEGW0Zdw7eTU+xf1F5mh6xumqAN31W/TOEsPCPaRzKlc6WF271oE+A4s/GaC+k9tMR53tXRrF/HLhAfKvfLJ976lek2U8fatiYQaZxOzt/T8I3yXbf68X8taFmLN43XNO0cF3H521oplbNcyOVWMW6TarCxtFQr0XpZB9L/TOjDSpdk+nLz97ndCcjQfUJGIuVUKf97zPNPHfC6G0bFbZVFd0UyIFd3qcyTt//NMA0oqMgUonDyLPDwU8omymFpd5GKaHuNme09mizCUmFp7EDcbqigadaWw8wQ8YF4kdMSRqiNJ7fi3QR6mM803X66W0zosePVaie9fkO2E46nHa93jmW09Jg3Lfw78BAFZ7noTJb6BUnPdioPC1F2uVN/PmxEHxEV4EHFc0KqXfu5Vp8JpROFp45bpk4RZTye2bw5QNLqADA5X4STbwKBaqdbkeBN33108q0vnhjr/PwbnvUAQauEfE9nV0Bvfj4fQUWPq7ghWdscAl3qywIxD/ekYATYEN7v/iMymzrt5Yyg78yoRomsXXeOpEJlmHWZ7jh2BVXfYsnT8HNCmMFyrLh1bIaXd/ik37a92tP4M24bfRF1ZoTzVZ4AhUsQ6uGIPKlqN3LRwSKasr2KaIyyOrXrn7ihYazq3LlTlcs1jk2L4f7jTWK2LG/89IHV+5F0V6vfpEJ3e/ph4ngNCqalhowXGM4VnL/jrSIFSexzgtQ95LYMjt/An/oldfpEDL13HAaBLZqnhLLLCAgRd2vmLTd00q+ZI0bTiMJx4wDAIOyNiRcpAVsd x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH7PR11MB5863.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(396003)(376002)(366004)(346002)(39860400002)(136003)(4326008)(76116006)(8936002)(66446008)(66946007)(66476007)(66556008)(64756008)(38070700005)(8676002)(19627235002)(54906003)(110136005)(316002)(33656002)(86362001)(122000001)(82960400001)(38100700002)(9686003)(41300700001)(6506007)(7696005)(53546011)(478600001)(71200400001)(83380400001)(107886003)(2906002)(55016003)(26005)(186003)(5660300002)(52536014);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?z6rShTrAHP3VIPNVorGHq0bMFUv8IujPOV2bTdvfsD3aJJ8KJymPD0/gur7D?= =?us-ascii?Q?nv1sqb/PBDlKiozovOjgkt0dt8jxS4SSMsJcF54Gu9QnR4o23C3V0bJYA52s?= =?us-ascii?Q?ixAzdB/h0yoLMJZSg10WA8ZsKFtzuljL3HI43EywZ5f2+TKSKcdyJzmdOiy6?= =?us-ascii?Q?9DjPZ4RgVRyh799DPetrmCRblX9jGHlR3Utr6dnj3dNEjDXS+30lsAm4gZql?= =?us-ascii?Q?p2nTN7gYBBMb8B1JoL/rIelB7tNEnN873jYWBUXkZgOXfRaxNCtCjRw1UglR?= =?us-ascii?Q?MCSPaiUUCs4M61NdQDph8h3WNeT8hWboj73UQil1lJOZ7KcBZx3Y0eopJfXY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wjTUS5FQIOYVFbecsIg0hRUP?= =?us-ascii?Q?32F0fzheHDYaCMyBEVCXyU8R4DoujJMiKSipLERWq/v+cSd6Xpx0MX9fWDjy?= =?us-ascii?Q?a48boRjccWETV2kNFeEPZxBnz94OW+0QzDrVsRL3zN8+eCSFin9zMWvJvqz/?= =?us-ascii?Q?DYPB3kRgjL2VktHT3oP69nAXaiAGV3kHwdDnuav0N589wZCzTEZfJUsIBlr0?= =?us-ascii?Q?ePXzB/s5miIxi7jVO8dc1eTOhDAH+dYgUbBeEJaKlmDcP5gC8k0ZK2OszUce?= =?us-ascii?Q?Qz9/Jevja59akqqCyc1QpNMxXxWlG28RDv78tGaMfEeJ/UwO1ujkY3PXcm4b?= =?us-ascii?Q?VMd7+1ODrNrPPM/xesX77ElPd2wwpJPZCxVJ1nGB?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH7PR11MB5863.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 22a48a75-a079-4661-6d4a-08da6d7abbd7 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jul 2022 13:45:13.0616 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: dpLiBHJlIBKAbjKyh/vPRWKVL7TFo02Sga4yAUzWGhHs12M38Ny0Naa4Tz90QNq7dcjwdwG/BmoKxXonohdm/Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB3439 Return-Path: bob.c.feng@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Bob Feng -----Original Message----- From: Konstantin Aladyshev =20 Sent: Monday, July 18, 2022 5:44 PM To: devel@edk2.groups.io Cc: Feng, Bob C ; Gao, Liming ; Chen, Christine ; Konstantin Aladyshev Subject: [PATCH] BaseTools/VolInfo: Correct EFI_SECTION_VERSION display - Correct typo in print statement, - "BuildNumber" field is UINT16, therefore it needs "0x%04X" format modifie= r, - "VersionString" field is CHAR16, therefore the input data should be proce= ssed to be displayed with "%s" printf modifier. Signed-off-by: Konstantin Aladyshev --- BaseTools/Source/C/VolInfo/VolInfo.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/BaseTools/Source/C/VolInfo/VolInfo.c b/BaseTools/Source/C/VolI= nfo/VolInfo.c index 8b6fcffa48..ed56587058 100644 --- a/BaseTools/Source/C/VolInfo/VolInfo.c +++ b/BaseTools/Source/C/VolInfo/VolInfo.c @@ -1676,6 +1676,7 @@ Returns: CHAR8 *ToolInputFileName; CHAR8 *ToolOutpu= tFileName; CHAR8 *UIFileName;+ CHAR8 *Versio= nString; ParsedLength =3D 0; ToolInputFileName =3D NULL;@@ -1816,8 +18= 17,14 @@ Returns: break; case EFI_SECTION_VERSION:- printf (" Build Number:= 0x%02X\n", *(UINT16 *)(Ptr + SectionHeaderLen));- printf (" Version= Strg: %s\n", (char*) (Ptr + SectionHeaderLen + sizeof (UINT16)));+ p= rintf (" Build Number: 0x%04X\n", *(UINT16 *)(Ptr + SectionHeaderLen));+ = VersionString =3D (CHAR8 *) malloc (UnicodeStrLen (((EFI_VERSION_SECTI= ON *) Ptr)->VersionString) + 1);+ if (VersionString =3D=3D NULL) {+ = Error (NULL, 0, 4001, "Resource", "memory cannot be allocated!");+ = return EFI_OUT_OF_RESOURCES;+ }+ Unicode2AsciiString (((EFI_V= ERSION_SECTION *) Ptr)->VersionString, VersionString);+ printf (" Ver= sion String: %s\n", VersionString); break; case EFI_SECTION_COM= PRESSION:--=20 2.25.1