From nobody Mon Feb 9 18:44:13 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+63719+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+63719+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1596607713; cv=none; d=zohomail.com; s=zohoarc; b=WbO1u1XaFwxEi/PBIuRw1LSCG7jo9BSHNjNfaP1ZczcmeCG/R9sAWM5+sZv+KIAjwWadbiJSiVvZ/70zkVggE3Ym8ht8/4qwFpq2Sq9lGxGZ3HdXmGychOI7RCVph5LB/xUnwFNcpkK9k/PDa9XGannIxSH15GeMkR703iiYLwI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596607713; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=TekmY+MrjipMTvPAn6ZBjx47/2hDqK5D41eAFcADPi4=; b=DoO77Bo2RiG+LM3mCFH+VXFUxWFPJNTHvtD8h74mynHi14X6HwaUK/L+EvRfa8KPFp/oqGLg0jIsYR/mF1yEc7mMmB+FFY0x0gRGPJn9A7Kz8Ls2wlqRKbz9eMQ1QBWNh0hJ4pzhRfdPJlwsYdmpOweGjsWhiFvW8cCz4qy0PKY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+63719+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 1596607713941687.800181430428; Tue, 4 Aug 2020 23:08:33 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 3CZrYY1788612xqGjtjGL0MJ; Tue, 04 Aug 2020 23:08:33 -0700 X-Received: from mga12.intel.com (mga12.intel.com []) by mx.groups.io with SMTP id smtpd.web11.1530.1596607712798867572 for ; Tue, 04 Aug 2020 23:08:33 -0700 IronPort-SDR: 2GegfC7acH0bAvA8rEu6zeWbwdn4fHyq9GN7k9v/Qs6RH7REvosScNPl3Zr/A0Q4gUruT0bkp6 XmauOD94Szvw== X-IronPort-AV: E=McAfee;i="6000,8403,9703"; a="132031300" X-IronPort-AV: E=Sophos;i="5.75,436,1589266800"; d="scan'208";a="132031300" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Aug 2020 23:08:25 -0700 IronPort-SDR: MIYf7Gtxm2npTZbK3dVduv/3ge87KtsG1j3caaD/JwAaVetskz3NsKMbkSScniQK2JYcADCm8l /YcmIJly7xJA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,436,1589266800"; d="scan'208";a="276013740" X-Received: from shenglei-dev.ccr.corp.intel.com ([10.239.154.36]) by fmsmga008.fm.intel.com with ESMTP; 04 Aug 2020 23:08:23 -0700 From: "Zhang, Shenglei" To: devel@edk2.groups.io Cc: Jian J Wang , Hao A Wu Subject: [edk2-devel] [PATCH 2/2] MdeModulePkg: Remove code wrapped by DISABLE_NEW_DEPRECATED_INTERFACES Date: Wed, 5 Aug 2020 14:08:04 +0800 Message-Id: <20200805060804.30476-3-shenglei.zhang@intel.com> In-Reply-To: <20200805060804.30476-1-shenglei.zhang@intel.com> References: <20200805060804.30476-1-shenglei.zhang@intel.com> 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,shenglei.zhang@intel.com X-Gm-Message-State: 8bAOyHrXo8yfv61mPzBD0jpVx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1596607713; bh=UZUb6vhky7MS+ucZgFsbEAYYf1Pbth0Xat/W9tc9whY=; h=Cc:Date:From:Reply-To:Subject:To; b=jC1NLQh07kJeg+x+15kuBlHPybu96LYD3zy2M7kx6Osw+QVlTsGhtCqOytze+dIcVRQ 1F1prb1muX5SHVNkTyfDfd2YPinpN54kKpc034yz3j3ex2cze9aMYiiugBTcRtlzdwBjE ZswZxr5wuj21hNf50T82vcDcgg4zZMJNC1g= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2777 Code wrapped by DISABLE_NEW_DEPRECATED_INTERFACES is deprecated. So remove it. Cc: Jian J Wang Cc: Hao A Wu Signed-off-by: Shenglei Zhang --- .../DxePrintLibPrint2Protocol/PrintLib.c | 145 ------------------ MdeModulePkg/Universal/PrintDxe/Print.c | 37 +---- MdeModulePkg/MdeModulePkg.dsc | 1 - 3 files changed, 6 insertions(+), 177 deletions(-) diff --git a/MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c b/Md= eModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c index 3a051fd58003..edd6572578dd 100644 --- a/MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c +++ b/MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c @@ -592,79 +592,6 @@ UnicodeSPrintAsciiFormat ( return NumberOfPrinted; } =20 -#ifndef DISABLE_NEW_DEPRECATED_INTERFACES - -/** - [ATTENTION] This function is deprecated for security reason. - - Converts a decimal value to a Null-terminated Unicode string. - - Converts the decimal number specified by Value to a Null-terminated Unic= ode - string specified by Buffer containing at most Width characters. No paddi= ng of spaces - is ever performed. If Width is 0 then a width of MAXIMUM_VALUE_CHARACTER= S is assumed. - The number of Unicode characters in Buffer is returned not including the= Null-terminator. - If the conversion contains more than Width characters, then only the fir= st - Width characters are returned, and the total number of characters - required to perform the conversion is returned. - Additional conversion parameters are specified in Flags. - - The Flags bit LEFT_JUSTIFY is always ignored. - All conversions are left justified in Buffer. - If Width is 0, PREFIX_ZERO is ignored in Flags. - If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and= commas - are inserted every 3rd digit starting from the right. - If RADIX_HEX is set in Flags, then the output buffer will be - formatted in hexadecimal format. - If Value is < 0 and RADIX_HEX is not set in Flags, then the fist charact= er in Buffer is a '-'. - If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored, - then Buffer is padded with '0' characters so the combination of the opti= onal '-' - sign character, '0' characters, digit characters for Value, and the Null= -terminator - add up to Width characters. - If both COMMA_TYPE and RADIX_HEX are set in Flags, then ASSERT(). - If Buffer is NULL, then ASSERT(). - If Buffer is not aligned on a 16-bit boundary, then ASSERT(). - If unsupported bits are set in Flags, then ASSERT(). - If both COMMA_TYPE and RADIX_HEX are set in Flags, then ASSERT(). - If Width >=3D MAXIMUM_VALUE_CHARACTERS, then ASSERT() - - @param Buffer Pointer to the output buffer for the produced Null-termi= nated - Unicode string. - @param Flags The bitmask of flags that specify left justification, ze= ro pad, and commas. - @param Value The 64-bit signed value to convert to a string. - @param Width The maximum number of Unicode characters to place in Buf= fer, not including - the Null-terminator. - - @return The number of Unicode characters in Buffer not including the Nul= l-terminator. - -**/ -UINTN -EFIAPI -UnicodeValueToString ( - IN OUT CHAR16 *Buffer, - IN UINTN Flags, - IN INT64 Value, - IN UINTN Width - ) -{ - RETURN_STATUS Status; - UINTN BufferSize; - - if (Width =3D=3D 0) { - BufferSize =3D (MAXIMUM_VALUE_CHARACTERS + 1) * sizeof (CHAR16); - } else { - BufferSize =3D (Width + 1) * sizeof (CHAR16); - } - - Status =3D mPrint2SProtocol->UnicodeValueToStringS (Buffer, BufferSize, = Flags, Value, Width); - if (RETURN_ERROR (Status)) { - return 0; - } - - return StrnLenS (Buffer, BufferSize / sizeof (CHAR16)); -} - -#endif - /** Converts a decimal value to a Null-terminated Unicode string. =20 @@ -1071,78 +998,6 @@ AsciiSPrintUnicodeFormat ( } =20 =20 -#ifndef DISABLE_NEW_DEPRECATED_INTERFACES - -/** - [ATTENTION] This function is deprecated for security reason. - - Converts a decimal value to a Null-terminated ASCII string. - - Converts the decimal number specified by Value to a Null-terminated ASCI= I string - specified by Buffer containing at most Width characters. No padding of s= paces - is ever performed. - If Width is 0 then a width of MAXIMUM_VALUE_CHARACTERS is assumed. - The number of ASCII characters in Buffer is returned not including the N= ull-terminator. - If the conversion contains more than Width characters, then only the fir= st Width - characters are returned, and the total number of characters required to = perform - the conversion is returned. - Additional conversion parameters are specified in Flags. - The Flags bit LEFT_JUSTIFY is always ignored. - All conversions are left justified in Buffer. - If Width is 0, PREFIX_ZERO is ignored in Flags. - If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and= commas - are inserted every 3rd digit starting from the right. - If RADIX_HEX is set in Flags, then the output buffer will be - formatted in hexadecimal format. - If Value is < 0 and RADIX_HEX is not set in Flags, then the fist charact= er in Buffer is a '-'. - If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored, - then Buffer is padded with '0' characters so the combination of the opti= onal '-' - sign character, '0' characters, digit characters for Value, and the Null= -terminator - add up to Width characters. - - If Buffer is NULL, then ASSERT(). - If unsupported bits are set in Flags, then ASSERT(). - If both COMMA_TYPE and RADIX_HEX are set in Flags, then ASSERT(). - If Width >=3D MAXIMUM_VALUE_CHARACTERS, then ASSERT() - - @param Buffer Pointer to the output buffer for the produced Null-termi= nated - ASCII string. - @param Flags The bitmask of flags that specify left justification, ze= ro pad, and commas. - @param Value The 64-bit signed value to convert to a string. - @param Width The maximum number of ASCII characters to place in Buffe= r, not including - the Null-terminator. - - @return The number of ASCII characters in Buffer not including the Null-= terminator. - -**/ -UINTN -EFIAPI -AsciiValueToString ( - OUT CHAR8 *Buffer, - IN UINTN Flags, - IN INT64 Value, - IN UINTN Width - ) -{ - RETURN_STATUS Status; - UINTN BufferSize; - - if (Width =3D=3D 0) { - BufferSize =3D (MAXIMUM_VALUE_CHARACTERS + 1) * sizeof (CHAR8); - } else { - BufferSize =3D (Width + 1) * sizeof (CHAR8); - } - - Status =3D mPrint2SProtocol->AsciiValueToStringS (Buffer, BufferSize, Fl= ags, Value, Width); - if (RETURN_ERROR (Status)) { - return 0; - } - - return AsciiStrnLenS (Buffer, BufferSize / sizeof (CHAR8)); -} - -#endif - /** Converts a decimal value to a Null-terminated Ascii string. =20 diff --git a/MdeModulePkg/Universal/PrintDxe/Print.c b/MdeModulePkg/Univers= al/PrintDxe/Print.c index c417a2c811de..636aa5716228 100644 --- a/MdeModulePkg/Universal/PrintDxe/Print.c +++ b/MdeModulePkg/Universal/PrintDxe/Print.c @@ -17,7 +17,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent /** Implementaion of the UnicodeValueToString service in EFI_PRINT2_PROTOCOL. =20 - If the macro DISABLE_NEW_DEPRECATED_INTERFACES is defined, then ASSERT(). =20 @param Buffer The pointer to the output buffer for the produced Null-terminated Unicode string. @@ -27,9 +26,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent @param Width The maximum number of Unicode characters to place in Buf= fer, not including the Null-terminator. =20 - @return If the macro DISABLE_NEW_DEPRECATED_INTERFACES is defined, retur= n 0. - Otherwise, return the number of Unicode characters in Buffer not - including the Null-terminator. + @return 0. + =20 =20 **/ UINTN @@ -41,28 +39,16 @@ PrintDxeUnicodeValueToString ( IN UINTN Width ) { -#ifdef DISABLE_NEW_DEPRECATED_INTERFACES - // - // If the macro DISABLE_NEW_DEPRECATED_INTERFACES is defined, then the - // PrintLib API UnicodeValueToString is already deprecated. - // In this case, ASSERT will be triggered and zero will be returned for = the - // implementation of the UnicodeValueToString service in EFI_PRINT2_PROT= OCOL - // to indicate that the service is no longer supported. - // DEBUG ((DEBUG_ERROR, "PrintDxe: The UnicodeValueToString service in EFI_= PRINT2_PROTOCOL is no longer supported for security reason.\n")); DEBUG ((DEBUG_ERROR, "PrintDxe: Please consider using the UnicodeValueTo= StringS service in EFI_PRINT2S_PROTOCOL.\n")); ASSERT (FALSE); return 0; -#else - return UnicodeValueToString (Buffer, Flags, Value, Width); -#endif + } =20 /** Implementaion of the AsciiValueToString service in EFI_PRINT2_PROTOCOL. =20 - If the macro DISABLE_NEW_DEPRECATED_INTERFACES is defined, then ASSERT(). - @param Buffer A pointer to the output buffer for the produced Null-terminated ASCII string. @param Flags The bitmask of flags that specify left justification, ze= ro @@ -71,9 +57,7 @@ PrintDxeUnicodeValueToString ( @param Width The maximum number of ASCII characters to place in Buffe= r, not including the Null-terminator. =20 - @return If the macro DISABLE_NEW_DEPRECATED_INTERFACES is defined, retur= n 0. - Otherwise, return the number of ASCII characters in Buffer not - including the Null-terminator. + @return 0. =20 **/ UINTN @@ -85,21 +69,12 @@ PrintDxeAsciiValueToString ( IN UINTN Width ) { -#ifdef DISABLE_NEW_DEPRECATED_INTERFACES - // - // If the macro DISABLE_NEW_DEPRECATED_INTERFACES is defined, then the - // PrintLib API AsciiValueToString is already deprecated. - // In this case, ASSERT will be triggered and zero will be returned for = the - // implementation of the AsciiValueToString service in EFI_PRINT2_PROTOC= OL - // to indicate that the service is no longer supported. - // + DEBUG ((DEBUG_ERROR, "PrintDxe: The AsciiValueToString service in EFI_PR= INT2_PROTOCOL is no longer supported for security reason.\n")); DEBUG ((DEBUG_ERROR, "PrintDxe: Please consider using the AsciiValueToSt= ringS service in EFI_PRINT2S_PROTOCOL.\n")); ASSERT (FALSE); return 0; -#else - return AsciiValueToString (Buffer, Flags, Value, Width); -#endif + } =20 EFI_HANDLE mPrintThunkHandle =3D NULL; diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc index 25aea3e2a481..fbbc9933f5e8 100644 --- a/MdeModulePkg/MdeModulePkg.dsc +++ b/MdeModulePkg/MdeModulePkg.dsc @@ -491,5 +491,4 @@ [Components.X64] MdeModulePkg/Universal/CapsulePei/CapsuleX64.inf =20 [BuildOptions] - *_*_*_CC_FLAGS =3D -D DISABLE_NEW_DEPRECATED_INTERFACES =20 --=20 2.18.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 (#63719): https://edk2.groups.io/g/devel/message/63719 Mute This Topic: https://groups.io/mt/76002483/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-