From nobody Fri May 3 13:59:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+42421+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+42421+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1560500316; cv=none; d=zoho.com; s=zohoarc; b=cZAJgQF2YwCUwtNH0e2gjjSlfo2EiTCmW0MgipDWczdiyJX0DU6JTiX2UMws4L1TZNweMMnDTzGtNlW2Spyk9+vNXrAsl589sbsfLyJjPjFsUn/dBGa7pLOZx1x+TpdD/Ulx0q8hi2+tArgx3HeTK+SCnYVV+I00WHgDdPjrzlU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560500316; h=Content-Transfer-Encoding:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To:ARC-Authentication-Results; bh=0AeoWCKW6xrf2ivMtVAe0EJSdOYGmObQ6C8HNMj0PZA=; b=gFrmg4v5XoL0UNsLDlKhZMDX9I4CcqFg6SkIC579yfm9FwgC5ucsun0GoURldgbd5rAbZhriQ+R32Q2dicX7Awht+5EDPmNRSIu1PwwZYr9PSjpD3gQ0b1+A7qOIuQjoVqRcePTuYCgyqt6VbYNqZIdtMd8IpBv9vKYajyJgP0I= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+42421+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 156050031616685.6400178851303; Fri, 14 Jun 2019 01:18:36 -0700 (PDT) Return-Path: X-Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by groups.io with SMTP; Fri, 14 Jun 2019 01:18:34 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Jun 2019 01:18:34 -0700 X-ExtLoop1: 1 X-Received: from ray-dev.ccr.corp.intel.com ([10.239.9.16]) by fmsmga006.fm.intel.com with ESMTP; 14 Jun 2019 01:18:33 -0700 From: "Ni, Ray" To: devel@edk2.groups.io Cc: Jordan Justen , Andrew Fish , Zhiguang Liu , Hao A Wu Subject: [edk2-devel] [PATCH] EmulatorPkg/Win: Change SecPrint to use PrintLib Date: Fri, 14 Jun 2019 16:18:13 +0800 Message-Id: <20190614081813.80176-1-ray.ni@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ray.ni@intel.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1560500315; bh=IjczbdmhAXlfWj6HW3ooWw/+QLXWLW4fdoH/bkSW5N4=; h=Cc:Date:From:Reply-To:Subject:To; b=xAEoar7IX4Pk9swxGbAS2dgvY0bBnl04BtjnSzGYdigDPhGVPMMBlDLhtw8RttJw/hx TWd2DSIqKw912yA7MFwpBd1wKIiYQAhU4EhbPl06KuGlGz19MzKUdT4N0iyGHw6CPnTlK VcHZtB1yhflJ3X+yKK+gvu+/WITlQQCs5mk= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" The change is to enhance SecPrint to support printing EFI_STATUS. Signed-off-by: Ray Ni Cc: Jordan Justen Cc: Andrew Fish Cc: Zhiguang Liu Cc: Hao A Wu --- EmulatorPkg/Win/Host/WinHost.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/EmulatorPkg/Win/Host/WinHost.c b/EmulatorPkg/Win/Host/WinHost.c index dd52075f98..bd7662683a 100644 --- a/EmulatorPkg/Win/Host/WinHost.c +++ b/EmulatorPkg/Win/Host/WinHost.c @@ -8,7 +8,7 @@ This code produces 128 K of temporary memory for the SEC stack by direct= ly allocate memory space with ReadWrite and Execute attribute. =20 -Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
(C) Copyright 2016 Hewlett Packard Enterprise Development LP
SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -167,15 +167,13 @@ SecPrint ( ... ) { - va_list Marker; + VA_LIST Marker; UINTN CharCount; CHAR8 Buffer[0x1000]; =20 - va_start (Marker, Format); - - _vsnprintf (Buffer, sizeof (Buffer), Format, Marker); - - va_end (Marker); + VA_START (Marker, Format); + AsciiVSPrint (Buffer, sizeof Buffer, Format, Marker); + VA_END (Marker); =20 CharCount =3D strlen (Buffer); WriteFile ( @@ -431,7 +429,7 @@ Returns: gSystemMemoryCount =3D CountSeparatorsInString (MemorySizeStr, '!') + 1; gSystemMemory =3D calloc (gSystemMemoryCount, sizeof (NT_SYSTEM_ME= MORY)); if (gSystemMemory =3D=3D NULL) { - SecPrint ("ERROR : Can not allocate memory for %S. Exiting.\n", Memor= ySizeStr); + SecPrint ("ERROR : Can not allocate memory for %s. Exiting.\n", Memor= ySizeStr); exit (1); } =20 @@ -441,7 +439,7 @@ Returns: gFdInfoCount =3D CountSeparatorsInString (FirmwareVolumesStr, '!') + 1; gFdInfo =3D calloc (gFdInfoCount, sizeof (NT_FD_INFO)); if (gFdInfo =3D=3D NULL) { - SecPrint ("ERROR : Can not allocate memory for %S. Exiting.\n", Firmw= areVolumesStr); + SecPrint ("ERROR : Can not allocate memory for %s. Exiting.\n", Firmw= areVolumesStr); exit (1); } // @@ -521,11 +519,11 @@ Returns: &gFdInfo[Index].Size ); if (EFI_ERROR (Status)) { - SecPrint ("ERROR : Can not open Firmware Device File %S (0x%X). Exi= ting.\n", FileName, Status); + SecPrint ("ERROR : Can not open Firmware Device File %s (%r). Exiti= ng.\n", FileName, Status); exit (1); } =20 - SecPrint (" FD loaded from %S\n", FileName); + SecPrint (" FD loaded from %s\n", FileName); =20 if (SecFile =3D=3D NULL) { // @@ -914,9 +912,9 @@ PeCoffLoaderRelocateImageExtraAction ( =20 if ((Library !=3D NULL) && (DllEntryPoint !=3D NULL)) { ImageContext->EntryPoint =3D (EFI_PHYSICAL_ADDRESS) (UINTN) DllEntr= yPoint; - SecPrint ("LoadLibraryEx (%S,\n NULL, DONT_RESOLVE_DLL= _REFERENCES)\n", DllFileName); + SecPrint ("LoadLibraryEx (%s,\n NULL, DONT_RESOLVE_DLL= _REFERENCES)\n", DllFileName); } else { - SecPrint ("WARNING: No source level debug %S. \n", DllFileName); + SecPrint ("WARNING: No source level debug %s. \n", DllFileName); } =20 free (DllFileName); --=20 2.21.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#42421): https://edk2.groups.io/g/devel/message/42421 Mute This Topic: https://groups.io/mt/32061754/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-