From nobody Thu May 2 01:38:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+68446+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+68446+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1607409801; cv=none; d=zohomail.com; s=zohoarc; b=F67QW+nuyhoEVxipzwpqTH9ocJ2qVQrfqQdKFcZeHhIbZD6RMK45LQguy0UDHG002Bd1nV5dMADY7QGQQ0gZWpoH3g4qNJHaEcHWpbS3cC2+RGGM9Gfve4R0RgF7D0XG/wf/CVcE5j82uFNTSD8lVbVWgwpuluBVy5dptyQIOOM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607409801; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=uQoxsaE2qs+IymUJJnILM7JTf71o6Ti66OkEj0/XIE0=; b=RK/52Azjo2ZKVD6vsoMej4ZOmjGhc/X+rXMZgNJQvR3hbTD5YdkqjAq0l41TjBO6x7N6EOjA/glLdfQROH7tZYW0p9xx9s75WzlnVuAdHq4Iave7mmmqpB4dEpuAcwcDttBh0IbmraZpSCWrWpOJkeY3Kx6xU7AiMTHsPf+Qc/M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+68446+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1607409801579943.052117881338; Mon, 7 Dec 2020 22:43:21 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id mQvuYY1788612x1HYLi9gWSK; Mon, 07 Dec 2020 22:43:21 -0800 X-Received: from mga01.intel.com (mga01.intel.com []) by mx.groups.io with SMTP id smtpd.web10.4945.1607409790110226728 for ; Mon, 07 Dec 2020 22:43:10 -0800 IronPort-SDR: rxXbRt0/T4O08JKuOIkgz76QLCuiSl7T4r2vP8GgVx2pCiefqjdg8jl39PQCM8RA1PpvHY9KTo eD+qGQPhr1iw== X-IronPort-AV: E=McAfee;i="6000,8403,9828"; a="192123191" X-IronPort-AV: E=Sophos;i="5.78,401,1599548400"; d="scan'208";a="192123191" X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2020 22:43:09 -0800 IronPort-SDR: 1Q8HwD9+z9Tbjoc5SvOxbzbZNarX9htZGadPwYFXIegniSjqW/9IRkXEahRP1wIfpQm2rLv508 XM/aUbwmu5Zw== X-IronPort-AV: E=Sophos;i="5.78,401,1599548400"; d="scan'208";a="363514572" X-Received: from mdkinney-mobl2.amr.corp.intel.com ([10.252.133.198]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2020 22:43:09 -0800 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Kelly Steele Subject: [edk2-devel] [Patch 1/2] QuarkPlatformPkg: Use safe string functions Date: Mon, 7 Dec 2020 22:42:47 -0800 Message-Id: <20201208064248.1167-2-michael.d.kinney@intel.com> In-Reply-To: <20201208064248.1167-1-michael.d.kinney@intel.com> References: <20201208064248.1167-1-michael.d.kinney@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,michael.d.kinney@intel.com X-Gm-Message-State: N5uZfmhwghkUOgGSKh4GJulAx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1607409801; bh=OFRPiAZw9LW1AnWqJCwP9WecZOJ60tC86iTATH64ja0=; h=Cc:Date:From:Reply-To:Subject:To; b=uG/gY51VXY6RwFBfoVEI4mN714uEMixqgEluCX/ZB8ByvBRFkzwktxkfL426iZpz+om zTp6w4zaW5MVqr3ukcQyi32uOexVs/nJ3CFx14q9uR3oKV8wyjAk7ExcaVe//Mv2qPzqw 8AQftEua0JaCvnHJYPCdSDEQ3aylzghGN6A= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Update QuarkPlatformPkg modules to use safe string functions from BaseLib. Cc: Kelly Steele Signed-off-by: Michael D Kinney Reviewed-by: Kelly Steele --- .../Acpi/Dxe/AcpiPlatform/AcpiPciUpdate.c | 4 +- .../Dxe/MemorySubClass/MemorySubClass.c | 16 ++--- .../MiscBaseBoardManufacturerFunction.c | 16 ++--- .../SmbiosMiscDxe/MiscBiosVendorFunction.c | 10 ++-- .../MiscChassisManufacturerFunction.c | 16 ++--- ...MiscNumberOfInstallableLanguagesFunction.c | 22 ++++--- .../Dxe/SmbiosMiscDxe/MiscOemStringFunction.c | 2 +- .../SmbiosMiscDxe/MiscOnboardDeviceFunction.c | 2 +- ...cPortInternalConnectorDesignatorFunction.c | 60 +++++++++---------- .../MiscSystemManufacturerFunction.c | 24 ++++---- .../MiscSystemOptionStringFunction.c | 2 +- .../MiscSystemSlotDesignationFunction.c | 30 +++++----- 12 files changed, 104 insertions(+), 100 deletions(-) diff --git a/Platform/Intel/QuarkPlatformPkg/Acpi/Dxe/AcpiPlatform/AcpiPciU= pdate.c b/Platform/Intel/QuarkPlatformPkg/Acpi/Dxe/AcpiPlatform/AcpiPciUpda= te.c index 02738621e5..2bf68b6f93 100644 --- a/Platform/Intel/QuarkPlatformPkg/Acpi/Dxe/AcpiPlatform/AcpiPciUpdate.c +++ b/Platform/Intel/QuarkPlatformPkg/Acpi/Dxe/AcpiPlatform/AcpiPciUpdate.c @@ -903,9 +903,9 @@ SdtCheckReturnPackage ( =20 if (DataType =3D=3D EFI_ACPI_DATA_TYPE_NAME_STRING) { ZeroMem (NameStr, 128); - AsciiStrCpy (NameStr, "\\_SB."); + AsciiStrCpyS (NameStr, 128, "\\_SB."); DataSize =3D SdtGetNameStringSize (Data); - AsciiStrnCat (NameStr, (CHAR8 *)Data, DataSize); + AsciiStrnCatS (NameStr, 128, (CHAR8 *)Data, DataSize); =20 NamePkgHandle =3D NULL; Status =3D AcpiSdt->FindPath (mDsdtHandle, NameStr, &NamePkgHandle= ); diff --git a/Platform/Intel/QuarkPlatformPkg/Platform/Dxe/MemorySubClass/Me= morySubClass.c b/Platform/Intel/QuarkPlatformPkg/Platform/Dxe/MemorySubClas= s/MemorySubClass.c index fb11f5f8c4..094d5212c0 100644 --- a/Platform/Intel/QuarkPlatformPkg/Platform/Dxe/MemorySubClass/MemorySub= Class.c +++ b/Platform/Intel/QuarkPlatformPkg/Platform/Dxe/MemorySubClass/MemorySub= Class.c @@ -205,7 +205,7 @@ MemorySubClassEntryPoint ( ArrayLink.MemoryType =3D EfiMemoryTypeDdr2; =20 =20 - StrCpy (StringBuffer, L"NO DIMM,MEMROY DOWN"); + StrCpyS (StringBuffer, StringBufferSize / sizeof (CHAR16), L"NO DIMM,MEM= ROY DOWN"); ArrayLink.MemoryManufacturer =3D HiiSetString ( HiiHandle, 0, @@ -317,7 +317,7 @@ MemorySubClassEntryPoint ( *(UINT16*)&Type6Record->CurrentMemoryType |=3D 1<<3; } OptionalStrStart =3D (CHAR8 *)(Type6Record + 1); - UnicodeStrToAsciiStr(DevLocStr, OptionalStrStart); + UnicodeStrToAsciiStrS (DevLocStr, OptionalStrStart, DevLocStrLen + 1); MemModuleInfoSmbiosHandle =3D SMBIOS_HANDLE_PI_RESERVED; Status =3D Smbios->Add (Smbios, NULL, &MemModuleInfoSmbiosHandle, (EFI_S= MBIOS_TABLE_HEADER*) Type6Record); FreePool(Type6Record); @@ -379,12 +379,12 @@ MemorySubClassEntryPoint ( Type17Record->Attributes =3D (UINT8)(Dimm + 1); =20 OptionalStrStart =3D (CHAR8 *)(Type17Record + 1); - UnicodeStrToAsciiStr(DevLocStr, OptionalStrStart); - UnicodeStrToAsciiStr(BankLocStr, OptionalStrStart + DevLocStrLen + 1); - UnicodeStrToAsciiStr(ManuStr, OptionalStrStart + DevLocStrLen + 1 + Bank= LocStrLen + 1); - UnicodeStrToAsciiStr(SerialNumStr, OptionalStrStart + DevLocStrLen + 1 += BankLocStrLen + 1 + ManuStrLen + 1); - UnicodeStrToAsciiStr(AssertTagStr, OptionalStrStart + DevLocStrLen + 1 += BankLocStrLen + 1 + ManuStrLen + 1 + SerialNumStrLen + 1); - UnicodeStrToAsciiStr(PartNumStr, OptionalStrStart + DevLocStrLen + 1 + B= ankLocStrLen + 1 + ManuStrLen + 1 + SerialNumStrLen + 1 + AssertTagStrLen += 1); + UnicodeStrToAsciiStrS (DevLocStr, OptionalStrStart, DevLocStrLen + 1); + UnicodeStrToAsciiStrS (BankLocStr, OptionalStrStart + DevLocStrLen + 1, = BankLocStrLen + 1); + UnicodeStrToAsciiStrS (ManuStr, OptionalStrStart + DevLocStrLen + 1 + Ba= nkLocStrLen + 1, ManuStrLen + 1); + UnicodeStrToAsciiStrS (SerialNumStr, OptionalStrStart + DevLocStrLen + 1= + BankLocStrLen + 1 + ManuStrLen + 1, SerialNumStrLen + 1); + UnicodeStrToAsciiStrS (AssertTagStr, OptionalStrStart + DevLocStrLen + 1= + BankLocStrLen + 1 + ManuStrLen + 1 + SerialNumStrLen + 1, AssertTagStrLe= n + 1); + UnicodeStrToAsciiStrS (PartNumStr, OptionalStrStart + DevLocStrLen + 1 += BankLocStrLen + 1 + ManuStrLen + 1 + SerialNumStrLen + 1 + AssertTagStrLen= + 1, PartNumStrLen + 1); MemDevSmbiosHandle =3D SMBIOS_HANDLE_PI_RESERVED; Status =3D Smbios->Add (Smbios, NULL, &MemDevSmbiosHandle, (EFI_SMBIOS_T= ABLE_HEADER*) Type17Record); FreePool(Type17Record); diff --git a/Platform/Intel/QuarkPlatformPkg/Platform/Dxe/SmbiosMiscDxe/Mis= cBaseBoardManufacturerFunction.c b/Platform/Intel/QuarkPlatformPkg/Platform= /Dxe/SmbiosMiscDxe/MiscBaseBoardManufacturerFunction.c index a9597ebcc2..966252507b 100644 --- a/Platform/Intel/QuarkPlatformPkg/Platform/Dxe/SmbiosMiscDxe/MiscBaseBo= ardManufacturerFunction.c +++ b/Platform/Intel/QuarkPlatformPkg/Platform/Dxe/SmbiosMiscDxe/MiscBaseBo= ardManufacturerFunction.c @@ -64,13 +64,13 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscBaseBoardManufacturer) return EFI_UNSUPPORTED; } =20 - StrCpy (TypeString, L""); + StrCpyS (TypeString, ARRAY_SIZE (TypeString), L""); TypeStringSize =3D PcdGetSize (PcdPlatformTypeName); if (TypeStringSize > 0 && TypeStringSize <=3D sizeof (TypeString)) { CopyMem (TypeString, PcdGetPtr (PcdPlatformTypeName), TypeStringSize); } if (StrLen (TypeString) =3D=3D 0) { - StrCpy (TypeString, L"Unknown"); + StrCpyS (TypeString, ARRAY_SIZE (TypeString), L"Unknown"); } TokenToUpdate =3D STRING_TOKEN (STR_MISC_BASE_BOARD_PRODUCT_NAME); HiiSetString (mHiiHandle, TokenToUpdate, TypeString, NULL); @@ -158,12 +158,12 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscBaseBoardManufacturer) // Since we fill NumberOfContainedObjectHandles =3D 0 for simple, just a= fter this filed to fill string // //OptionalStrStart -=3D 2; - UnicodeStrToAsciiStr(Manufacturer, OptionalStrStart); - UnicodeStrToAsciiStr(Product, OptionalStrStart + ManuStrLen + 1); - UnicodeStrToAsciiStr(Version, OptionalStrStart + ManuStrLen + 1 + Produc= tStrLen + 1); - UnicodeStrToAsciiStr(SerialNumber, OptionalStrStart + ManuStrLen + 1 + P= roductStrLen + 1 + VerStrLen + 1); - UnicodeStrToAsciiStr(AssertTag, OptionalStrStart + ManuStrLen + 1 + Prod= uctStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1); - UnicodeStrToAsciiStr(Chassis, OptionalStrStart + ManuStrLen + 1 + Produc= tStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + AssertTagStrLen + 1); + UnicodeStrToAsciiStrS (Manufacturer, OptionalStrStart, ManuStrLen + 1); + UnicodeStrToAsciiStrS (Product, OptionalStrStart + ManuStrLen + 1, Produ= ctStrLen + 1); + UnicodeStrToAsciiStrS (Version, OptionalStrStart + ManuStrLen + 1 + Prod= uctStrLen + 1, VerStrLen + 1); + UnicodeStrToAsciiStrS (SerialNumber, OptionalStrStart + ManuStrLen + 1 += ProductStrLen + 1 + VerStrLen + 1, SerialNumStrLen + 1); + UnicodeStrToAsciiStrS (AssertTag, OptionalStrStart + ManuStrLen + 1 + Pr= oductStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1, AssertTagStrLen + 1); + UnicodeStrToAsciiStrS (Chassis, OptionalStrStart + ManuStrLen + 1 + Prod= uctStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + AssertTagStrLen + 1, = ChassisStrLen + 1); =20 // // Now we have got the full smbios record, call smbios protocol to add t= his record. diff --git a/Platform/Intel/QuarkPlatformPkg/Platform/Dxe/SmbiosMiscDxe/Mis= cBiosVendorFunction.c b/Platform/Intel/QuarkPlatformPkg/Platform/Dxe/Smbios= MiscDxe/MiscBiosVendorFunction.c index a27e704302..d49742aeff 100644 --- a/Platform/Intel/QuarkPlatformPkg/Platform/Dxe/SmbiosMiscDxe/MiscBiosVe= ndorFunction.c +++ b/Platform/Intel/QuarkPlatformPkg/Platform/Dxe/SmbiosMiscDxe/MiscBiosVe= ndorFunction.c @@ -128,7 +128,7 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscBiosVendor) // // Update strings from PCD // - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr (PcdSMBIOSBiosVendor), Vendor); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr (PcdSMBIOSBiosVendor), Vendor= , ARRAY_SIZE (Vendor)); if (StrLen (Vendor) > 0) { TokenToUpdate =3D STRING_TOKEN (STR_MISC_BIOS_VENDOR); HiiSetString (mHiiHandle, TokenToUpdate, Vendor, NULL); @@ -152,7 +152,7 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscBiosVendor) return EFI_UNSUPPORTED; } =20 - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr (PcdSMBIOSBiosReleaseDate), Re= leaseDate); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr (PcdSMBIOSBiosReleaseDate), R= eleaseDate, ARRAY_SIZE (ReleaseDate)); if (StrLen (ReleaseDate) > 0) { TokenToUpdate =3D STRING_TOKEN (STR_MISC_BIOS_RELEASE_DATE); HiiSetString (mHiiHandle, TokenToUpdate, ReleaseDate, NULL); @@ -203,9 +203,9 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscBiosVendor) SmbiosRecord->EmbeddedControllerFirmwareMinorRelease =3D ForType0InputDa= ta->BiosEmbeddedFirmwareMinorRelease; =20 OptionalStrStart =3D (CHAR8 *)(SmbiosRecord + 1); - UnicodeStrToAsciiStr(VendorPtr, OptionalStrStart); - UnicodeStrToAsciiStr(VersionPtr, OptionalStrStart + VendorStrLen + 1); - UnicodeStrToAsciiStr(ReleaseDatePtr, OptionalStrStart + VendorStrLen + 1= + VerStrLen + 1); + UnicodeStrToAsciiStrS (VendorPtr, OptionalStrStart, VendorStrLen + 1); + UnicodeStrToAsciiStrS (VersionPtr, OptionalStrStart + VendorStrLen + 1, = VendorStrLen + 1); + UnicodeStrToAsciiStrS (ReleaseDatePtr, OptionalStrStart + VendorStrLen += 1 + VerStrLen + 1, DateStrLen + 1); // // Now we have got the full smbios record, call smbios protocol to add t= his record. // diff --git a/Platform/Intel/QuarkPlatformPkg/Platform/Dxe/SmbiosMiscDxe/Mis= cChassisManufacturerFunction.c b/Platform/Intel/QuarkPlatformPkg/Platform/D= xe/SmbiosMiscDxe/MiscChassisManufacturerFunction.c index 5d6c32ef32..5405621c88 100644 --- a/Platform/Intel/QuarkPlatformPkg/Platform/Dxe/SmbiosMiscDxe/MiscChassi= sManufacturerFunction.c +++ b/Platform/Intel/QuarkPlatformPkg/Platform/Dxe/SmbiosMiscDxe/MiscChassi= sManufacturerFunction.c @@ -59,7 +59,7 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscChassisManufacturer) // // Update strings from PCD // - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSChassisManufacturer),= Manufacturer); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSChassisManufacturer)= , Manufacturer, ARRAY_SIZE (Manufacturer)); if (StrLen (Manufacturer) > 0) { TokenToUpdate =3D STRING_TOKEN (STR_MISC_CHASSIS_MANUFACTURER); HiiSetString (mHiiHandle, TokenToUpdate, Manufacturer, NULL); @@ -71,7 +71,7 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscChassisManufacturer) return EFI_UNSUPPORTED; } =20 - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSChassisVersion), Vers= ion); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSChassisVersion), Ver= sion, ARRAY_SIZE (Version)); if (StrLen (Version) > 0) { TokenToUpdate =3D STRING_TOKEN (STR_MISC_CHASSIS_VERSION); HiiSetString (mHiiHandle, TokenToUpdate, Version, NULL); @@ -83,7 +83,7 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscChassisManufacturer) return EFI_UNSUPPORTED; } =20 - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSChassisSerialNumber),= SerialNumber); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSChassisSerialNumber)= , SerialNumber, ARRAY_SIZE (SerialNumber)); if (StrLen (SerialNumber) > 0) { TokenToUpdate =3D STRING_TOKEN (STR_MISC_CHASSIS_SERIAL_NUMBER); HiiSetString (mHiiHandle, TokenToUpdate, SerialNumber, NULL); @@ -95,7 +95,7 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscChassisManufacturer) return EFI_UNSUPPORTED; } =20 - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSChassisAssetTag), Ass= ertTag); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSChassisAssetTag), As= sertTag, ARRAY_SIZE (AssertTag)); if (StrLen (AssertTag) > 0) { TokenToUpdate =3D STRING_TOKEN (STR_MISC_CHASSIS_ASSET_TAG); HiiSetString (mHiiHandle, TokenToUpdate, AssertTag, NULL); @@ -147,10 +147,10 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscChassisManufacturer) SmbiosRecord->ContainedElementRecordLength =3D PcdGet8 (PcdSMBIOSChassis= ElementRecordLength); =20 OptionalStrStart =3D (CHAR8 *)(SmbiosRecord + 1); - UnicodeStrToAsciiStr(ManufacturerPtr, OptionalStrStart); - UnicodeStrToAsciiStr(VersionPtr, OptionalStrStart + ManuStrLen + 1); - UnicodeStrToAsciiStr(SerialNumberPtr, OptionalStrStart + ManuStrLen + 1 = + VerStrLen + 1); - UnicodeStrToAsciiStr(AssertTagPtr, OptionalStrStart + ManuStrLen + 1 + V= erStrLen + 1 + SerialNumStrLen + 1); + UnicodeStrToAsciiStrS (ManufacturerPtr, OptionalStrStart, ManuStrLen + 1= ); + UnicodeStrToAsciiStrS (VersionPtr, OptionalStrStart + ManuStrLen + 1, Ve= rStrLen + 1); + UnicodeStrToAsciiStrS (SerialNumberPtr, OptionalStrStart + ManuStrLen + = 1 + VerStrLen + 1, SerialNumStrLen + 1); + UnicodeStrToAsciiStrS (AssertTagPtr, OptionalStrStart + ManuStrLen + 1 += VerStrLen + 1 + SerialNumStrLen + 1, AssertTagStrLen + 1); =20 // // Now we have got the full smbios record, call smbios protocol to add t= his record. diff --git a/Platform/Intel/QuarkPlatformPkg/Platform/Dxe/SmbiosMiscDxe/Mis= cNumberOfInstallableLanguagesFunction.c b/Platform/Intel/QuarkPlatformPkg/P= latform/Dxe/SmbiosMiscDxe/MiscNumberOfInstallableLanguagesFunction.c index 977ee57b24..af422e720d 100644 --- a/Platform/Intel/QuarkPlatformPkg/Platform/Dxe/SmbiosMiscDxe/MiscNumber= OfInstallableLanguagesFunction.c +++ b/Platform/Intel/QuarkPlatformPkg/Platform/Dxe/SmbiosMiscDxe/MiscNumber= OfInstallableLanguagesFunction.c @@ -32,13 +32,14 @@ CurrentLanguageMatch ( OUT CHAR8 *CurrentLang ) { - CHAR8 *DefaultLang; - CHAR8 *BestLanguage; - CHAR8 *Languages; - CHAR8 *MatchLang; - CHAR8 *EndMatchLang; - UINTN CompareLength; - BOOLEAN LangMatch; + EFI_STATUS Status; + CHAR8 *DefaultLang; + CHAR8 *BestLanguage; + CHAR8 *Languages; + CHAR8 *MatchLang; + CHAR8 *EndMatchLang; + UINTN CompareLength; + BOOLEAN LangMatch; =20 Languages =3D HiiGetSupportedLanguages (HiiHandle); if (Languages =3D=3D NULL) { @@ -46,7 +47,10 @@ CurrentLanguageMatch ( } =20 LangMatch =3D FALSE; - CurrentLang =3D GetEfiGlobalVariable (L"PlatformLang"); + Status =3D GetEfiGlobalVariable2 (L"PlatformLang", &CurrentLang, NULL); + if (EFI_ERROR (Status)) { + return FALSE; + } DefaultLang =3D (CHAR8 *) PcdGetPtr (PcdUefiVariableDefaultPlatformLang= ); BestLanguage =3D GetBestLanguage ( Languages, @@ -224,7 +228,7 @@ MISC_SMBIOS_TABLE_FUNCTION(NumberOfInstallableLanguages) SmbiosRecord->Flags =3D (UINT8)ForType13InputData->LanguageFlags.Abbrevi= atedLanguageFormat; SmbiosRecord->CurrentLanguages =3D 1; OptionalStrStart =3D (CHAR8 *)(SmbiosRecord + 1); - AsciiStrCpy(OptionalStrStart, CurrentLang); + AsciiStrCpyS (OptionalStrStart, LangStrLen + 1, CurrentLang); // // Now we have got the full smbios record, call smbios protocol to add t= his record. // diff --git a/Platform/Intel/QuarkPlatformPkg/Platform/Dxe/SmbiosMiscDxe/Mis= cOemStringFunction.c b/Platform/Intel/QuarkPlatformPkg/Platform/Dxe/SmbiosM= iscDxe/MiscOemStringFunction.c index f3f61366fc..439fb3219e 100644 --- a/Platform/Intel/QuarkPlatformPkg/Platform/Dxe/SmbiosMiscDxe/MiscOemStr= ingFunction.c +++ b/Platform/Intel/QuarkPlatformPkg/Platform/Dxe/SmbiosMiscDxe/MiscOemStr= ingFunction.c @@ -61,7 +61,7 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscOemString) SmbiosRecord->Hdr.Handle =3D 0; SmbiosRecord->StringCount =3D 1; OptionalStrStart =3D (CHAR8 *)(SmbiosRecord + 1); - UnicodeStrToAsciiStr(OemStr, OptionalStrStart); + UnicodeStrToAsciiStrS (OemStr, OptionalStrStart, OemStrLen + 1); =20 // // Now we have got the full smbios record, call smbios protocol to add t= his record. diff --git a/Platform/Intel/QuarkPlatformPkg/Platform/Dxe/SmbiosMiscDxe/Mis= cOnboardDeviceFunction.c b/Platform/Intel/QuarkPlatformPkg/Platform/Dxe/Smb= iosMiscDxe/MiscOnboardDeviceFunction.c index f570184a56..440f33f481 100644 --- a/Platform/Intel/QuarkPlatformPkg/Platform/Dxe/SmbiosMiscDxe/MiscOnboar= dDeviceFunction.c +++ b/Platform/Intel/QuarkPlatformPkg/Platform/Dxe/SmbiosMiscDxe/MiscOnboar= dDeviceFunction.c @@ -88,7 +88,7 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscOnboardDevice) SmbiosRecord->Device[0].DeviceType =3D StatusAndType; SmbiosRecord->Device[0].DescriptionString =3D 1; OptionalStrStart =3D (CHAR8 *)(SmbiosRecord + 1); - UnicodeStrToAsciiStr(DeviceDescription, OptionalStrStart); + UnicodeStrToAsciiStrS (DeviceDescription, OptionalStrStart, DescriptionS= trLen + 1); =20 // // Now we have got the full smbios record, call smbios protocol to add t= his record. diff --git a/Platform/Intel/QuarkPlatformPkg/Platform/Dxe/SmbiosMiscDxe/Mis= cPortInternalConnectorDesignatorFunction.c b/Platform/Intel/QuarkPlatformPk= g/Platform/Dxe/SmbiosMiscDxe/MiscPortInternalConnectorDesignatorFunction.c index 28c05efb21..0a6fdfdbbd 100644 --- a/Platform/Intel/QuarkPlatformPkg/Platform/Dxe/SmbiosMiscDxe/MiscPortIn= ternalConnectorDesignatorFunction.c +++ b/Platform/Intel/QuarkPlatformPkg/Platform/Dxe/SmbiosMiscDxe/MiscPortIn= ternalConnectorDesignatorFunction.c @@ -81,86 +81,86 @@ GetMiscPortConfigFromPcd () // Type 8 // SMBIOSPortConnector.SMBIOSConnectorNumber =3D PcdGet8 (PcdSMBIOSConnecto= rNumber); - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort1InternalConnecto= rDesignator), SMBIOSPortConnector.SMBIOSPortConnector[0].PortInternalConnec= torDesignator); - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort1ExternalConnecto= rDesignator), SMBIOSPortConnector.SMBIOSPortConnector[0].PortExternalConnec= torDesignator); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort1InternalConnect= orDesignator), SMBIOSPortConnector.SMBIOSPortConnector[0].PortInternalConne= ctorDesignator, ARRAY_SIZE (SMBIOSPortConnector.SMBIOSPortConnector[0].Port= InternalConnectorDesignator)); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort1ExternalConnect= orDesignator), SMBIOSPortConnector.SMBIOSPortConnector[0].PortExternalConne= ctorDesignator, ARRAY_SIZE (SMBIOSPortConnector.SMBIOSPortConnector[0].Port= ExternalConnectorDesignator)); SMBIOSPortConnector.SMBIOSPortConnector[0].PortInternalConnectorType =3D= PcdGet8 (PcdSMBIOSPort1InternalConnectorType); SMBIOSPortConnector.SMBIOSPortConnector[0].PortExternalConnectorType =3D= PcdGet8 (PcdSMBIOSPort1ExternalConnectorType); SMBIOSPortConnector.SMBIOSPortConnector[0].PortType =3D PcdGet8 (PcdSMBI= OSPort1Type); =20 - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort2InternalConnecto= rDesignator), SMBIOSPortConnector.SMBIOSPortConnector[1].PortInternalConnec= torDesignator); - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort2ExternalConnecto= rDesignator), SMBIOSPortConnector.SMBIOSPortConnector[1].PortExternalConnec= torDesignator); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort2InternalConnect= orDesignator), SMBIOSPortConnector.SMBIOSPortConnector[1].PortInternalConne= ctorDesignator, ARRAY_SIZE (SMBIOSPortConnector.SMBIOSPortConnector[1].Port= InternalConnectorDesignator)); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort2ExternalConnect= orDesignator), SMBIOSPortConnector.SMBIOSPortConnector[1].PortExternalConne= ctorDesignator, ARRAY_SIZE (SMBIOSPortConnector.SMBIOSPortConnector[1].Port= ExternalConnectorDesignator)); SMBIOSPortConnector.SMBIOSPortConnector[1].PortInternalConnectorType =3D= PcdGet8 (PcdSMBIOSPort2InternalConnectorType); SMBIOSPortConnector.SMBIOSPortConnector[1].PortExternalConnectorType =3D= PcdGet8 (PcdSMBIOSPort2ExternalConnectorType); SMBIOSPortConnector.SMBIOSPortConnector[1].PortType =3D PcdGet8 (PcdSMBI= OSPort2Type); =20 - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort3InternalConnecto= rDesignator), SMBIOSPortConnector.SMBIOSPortConnector[2].PortInternalConnec= torDesignator); - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort3ExternalConnecto= rDesignator), SMBIOSPortConnector.SMBIOSPortConnector[2].PortExternalConnec= torDesignator); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort3InternalConnect= orDesignator), SMBIOSPortConnector.SMBIOSPortConnector[2].PortInternalConne= ctorDesignator, ARRAY_SIZE (SMBIOSPortConnector.SMBIOSPortConnector[2].Port= InternalConnectorDesignator)); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort3ExternalConnect= orDesignator), SMBIOSPortConnector.SMBIOSPortConnector[2].PortExternalConne= ctorDesignator, ARRAY_SIZE (SMBIOSPortConnector.SMBIOSPortConnector[2].Port= ExternalConnectorDesignator)); SMBIOSPortConnector.SMBIOSPortConnector[2].PortInternalConnectorType =3D= PcdGet8 (PcdSMBIOSPort3InternalConnectorType); SMBIOSPortConnector.SMBIOSPortConnector[2].PortExternalConnectorType =3D= PcdGet8 (PcdSMBIOSPort3ExternalConnectorType); SMBIOSPortConnector.SMBIOSPortConnector[2].PortType =3D PcdGet8 (PcdSMBI= OSPort3Type); =20 - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort4InternalConnecto= rDesignator), SMBIOSPortConnector.SMBIOSPortConnector[3].PortInternalConnec= torDesignator); - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort4ExternalConnecto= rDesignator), SMBIOSPortConnector.SMBIOSPortConnector[3].PortExternalConnec= torDesignator); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort4InternalConnect= orDesignator), SMBIOSPortConnector.SMBIOSPortConnector[3].PortInternalConne= ctorDesignator, ARRAY_SIZE (SMBIOSPortConnector.SMBIOSPortConnector[3].Port= InternalConnectorDesignator)); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort4ExternalConnect= orDesignator), SMBIOSPortConnector.SMBIOSPortConnector[3].PortExternalConne= ctorDesignator, ARRAY_SIZE (SMBIOSPortConnector.SMBIOSPortConnector[3].Port= ExternalConnectorDesignator)); SMBIOSPortConnector.SMBIOSPortConnector[3].PortInternalConnectorType =3D= PcdGet8 (PcdSMBIOSPort4InternalConnectorType); SMBIOSPortConnector.SMBIOSPortConnector[3].PortExternalConnectorType =3D= PcdGet8 (PcdSMBIOSPort4ExternalConnectorType); SMBIOSPortConnector.SMBIOSPortConnector[3].PortType =3D PcdGet8 (PcdSMBI= OSPort4Type); =20 - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort5InternalConnecto= rDesignator), SMBIOSPortConnector.SMBIOSPortConnector[4].PortInternalConnec= torDesignator); - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort5ExternalConnecto= rDesignator), SMBIOSPortConnector.SMBIOSPortConnector[4].PortExternalConnec= torDesignator); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort5InternalConnect= orDesignator), SMBIOSPortConnector.SMBIOSPortConnector[4].PortInternalConne= ctorDesignator, ARRAY_SIZE (SMBIOSPortConnector.SMBIOSPortConnector[4].Port= InternalConnectorDesignator)); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort5ExternalConnect= orDesignator), SMBIOSPortConnector.SMBIOSPortConnector[4].PortExternalConne= ctorDesignator, ARRAY_SIZE (SMBIOSPortConnector.SMBIOSPortConnector[4].Port= ExternalConnectorDesignator)); SMBIOSPortConnector.SMBIOSPortConnector[4].PortInternalConnectorType =3D= PcdGet8 (PcdSMBIOSPort5InternalConnectorType); SMBIOSPortConnector.SMBIOSPortConnector[4].PortExternalConnectorType =3D= PcdGet8 (PcdSMBIOSPort5ExternalConnectorType); SMBIOSPortConnector.SMBIOSPortConnector[4].PortType =3D PcdGet8 (PcdSMBI= OSPort5Type); =20 - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort6InternalConnecto= rDesignator), SMBIOSPortConnector.SMBIOSPortConnector[5].PortInternalConnec= torDesignator); - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort6ExternalConnecto= rDesignator), SMBIOSPortConnector.SMBIOSPortConnector[5].PortExternalConnec= torDesignator); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort6InternalConnect= orDesignator), SMBIOSPortConnector.SMBIOSPortConnector[5].PortInternalConne= ctorDesignator, ARRAY_SIZE (SMBIOSPortConnector.SMBIOSPortConnector[5].Port= InternalConnectorDesignator)); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort6ExternalConnect= orDesignator), SMBIOSPortConnector.SMBIOSPortConnector[5].PortExternalConne= ctorDesignator, ARRAY_SIZE (SMBIOSPortConnector.SMBIOSPortConnector[5].Port= ExternalConnectorDesignator)); SMBIOSPortConnector.SMBIOSPortConnector[5].PortInternalConnectorType =3D= PcdGet8 (PcdSMBIOSPort6InternalConnectorType); SMBIOSPortConnector.SMBIOSPortConnector[5].PortExternalConnectorType =3D= PcdGet8 (PcdSMBIOSPort6ExternalConnectorType); SMBIOSPortConnector.SMBIOSPortConnector[5].PortType =3D PcdGet8 (PcdSMBI= OSPort6Type); =20 - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort7InternalConnecto= rDesignator), SMBIOSPortConnector.SMBIOSPortConnector[6].PortInternalConnec= torDesignator); - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort7ExternalConnecto= rDesignator), SMBIOSPortConnector.SMBIOSPortConnector[6].PortExternalConnec= torDesignator); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort7InternalConnect= orDesignator), SMBIOSPortConnector.SMBIOSPortConnector[6].PortInternalConne= ctorDesignator, ARRAY_SIZE (SMBIOSPortConnector.SMBIOSPortConnector[6].Port= InternalConnectorDesignator)); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort7ExternalConnect= orDesignator), SMBIOSPortConnector.SMBIOSPortConnector[6].PortExternalConne= ctorDesignator, ARRAY_SIZE (SMBIOSPortConnector.SMBIOSPortConnector[6].Port= ExternalConnectorDesignator)); SMBIOSPortConnector.SMBIOSPortConnector[6].PortInternalConnectorType =3D= PcdGet8 (PcdSMBIOSPort7InternalConnectorType); SMBIOSPortConnector.SMBIOSPortConnector[6].PortExternalConnectorType =3D= PcdGet8 (PcdSMBIOSPort7ExternalConnectorType); SMBIOSPortConnector.SMBIOSPortConnector[6].PortType =3D PcdGet8 (PcdSMBI= OSPort7Type); =20 - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort8InternalConnecto= rDesignator), SMBIOSPortConnector.SMBIOSPortConnector[7].PortInternalConnec= torDesignator); - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort8ExternalConnecto= rDesignator), SMBIOSPortConnector.SMBIOSPortConnector[7].PortExternalConnec= torDesignator); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort8InternalConnect= orDesignator), SMBIOSPortConnector.SMBIOSPortConnector[7].PortInternalConne= ctorDesignator, ARRAY_SIZE (SMBIOSPortConnector.SMBIOSPortConnector[7].Port= InternalConnectorDesignator)); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort8ExternalConnect= orDesignator), SMBIOSPortConnector.SMBIOSPortConnector[7].PortExternalConne= ctorDesignator, ARRAY_SIZE (SMBIOSPortConnector.SMBIOSPortConnector[7].Port= ExternalConnectorDesignator)); SMBIOSPortConnector.SMBIOSPortConnector[7].PortInternalConnectorType =3D= PcdGet8 (PcdSMBIOSPort8InternalConnectorType); SMBIOSPortConnector.SMBIOSPortConnector[7].PortExternalConnectorType =3D= PcdGet8 (PcdSMBIOSPort8ExternalConnectorType); SMBIOSPortConnector.SMBIOSPortConnector[7].PortType =3D PcdGet8 (PcdSMBI= OSPort8Type); =20 - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort9InternalConnecto= rDesignator), SMBIOSPortConnector.SMBIOSPortConnector[8].PortInternalConnec= torDesignator); - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort9ExternalConnecto= rDesignator), SMBIOSPortConnector.SMBIOSPortConnector[8].PortExternalConnec= torDesignator); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort9InternalConnect= orDesignator), SMBIOSPortConnector.SMBIOSPortConnector[8].PortInternalConne= ctorDesignator, ARRAY_SIZE (SMBIOSPortConnector.SMBIOSPortConnector[8].Port= InternalConnectorDesignator)); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort9ExternalConnect= orDesignator), SMBIOSPortConnector.SMBIOSPortConnector[8].PortExternalConne= ctorDesignator, ARRAY_SIZE (SMBIOSPortConnector.SMBIOSPortConnector[8].Port= ExternalConnectorDesignator)); SMBIOSPortConnector.SMBIOSPortConnector[8].PortInternalConnectorType =3D= PcdGet8 (PcdSMBIOSPort9InternalConnectorType); SMBIOSPortConnector.SMBIOSPortConnector[8].PortExternalConnectorType =3D= PcdGet8 (PcdSMBIOSPort9ExternalConnectorType); SMBIOSPortConnector.SMBIOSPortConnector[8].PortType =3D PcdGet8 (PcdSMBI= OSPort9Type); =20 - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort10InternalConnect= orDesignator), SMBIOSPortConnector.SMBIOSPortConnector[9].PortInternalConne= ctorDesignator); - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort10ExternalConnect= orDesignator), SMBIOSPortConnector.SMBIOSPortConnector[9].PortExternalConne= ctorDesignator); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort10InternalConnec= torDesignator), SMBIOSPortConnector.SMBIOSPortConnector[9].PortInternalConn= ectorDesignator, ARRAY_SIZE (SMBIOSPortConnector.SMBIOSPortConnector[9].Por= tInternalConnectorDesignator)); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort10ExternalConnec= torDesignator), SMBIOSPortConnector.SMBIOSPortConnector[9].PortExternalConn= ectorDesignator, ARRAY_SIZE (SMBIOSPortConnector.SMBIOSPortConnector[9].Por= tExternalConnectorDesignator)); SMBIOSPortConnector.SMBIOSPortConnector[9].PortInternalConnectorType =3D= PcdGet8 (PcdSMBIOSPort10InternalConnectorType); SMBIOSPortConnector.SMBIOSPortConnector[9].PortExternalConnectorType =3D= PcdGet8 (PcdSMBIOSPort10ExternalConnectorType); SMBIOSPortConnector.SMBIOSPortConnector[9].PortType =3D PcdGet8 (PcdSMBI= OSPort10Type); =20 - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort11InternalConnect= orDesignator), SMBIOSPortConnector.SMBIOSPortConnector[10].PortInternalConn= ectorDesignator); - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort11ExternalConnect= orDesignator), SMBIOSPortConnector.SMBIOSPortConnector[10].PortExternalConn= ectorDesignator); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort11InternalConnec= torDesignator), SMBIOSPortConnector.SMBIOSPortConnector[10].PortInternalCon= nectorDesignator, ARRAY_SIZE (SMBIOSPortConnector.SMBIOSPortConnector[10].P= ortInternalConnectorDesignator)); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort11ExternalConnec= torDesignator), SMBIOSPortConnector.SMBIOSPortConnector[10].PortExternalCon= nectorDesignator, ARRAY_SIZE (SMBIOSPortConnector.SMBIOSPortConnector[10].P= ortExternalConnectorDesignator)); SMBIOSPortConnector.SMBIOSPortConnector[10].PortInternalConnectorType = =3D PcdGet8 (PcdSMBIOSPort11InternalConnectorType); SMBIOSPortConnector.SMBIOSPortConnector[10].PortExternalConnectorType = =3D PcdGet8 (PcdSMBIOSPort11ExternalConnectorType); SMBIOSPortConnector.SMBIOSPortConnector[10].PortType =3D PcdGet8 (PcdSMB= IOSPort11Type); =20 - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort12InternalConnect= orDesignator), SMBIOSPortConnector.SMBIOSPortConnector[11].PortInternalConn= ectorDesignator); - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort12ExternalConnect= orDesignator), SMBIOSPortConnector.SMBIOSPortConnector[11].PortExternalConn= ectorDesignator); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort12InternalConnec= torDesignator), SMBIOSPortConnector.SMBIOSPortConnector[11].PortInternalCon= nectorDesignator, ARRAY_SIZE (SMBIOSPortConnector.SMBIOSPortConnector[11].P= ortInternalConnectorDesignator)); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort12ExternalConnec= torDesignator), SMBIOSPortConnector.SMBIOSPortConnector[11].PortExternalCon= nectorDesignator, ARRAY_SIZE (SMBIOSPortConnector.SMBIOSPortConnector[11].P= ortExternalConnectorDesignator)); SMBIOSPortConnector.SMBIOSPortConnector[11].PortInternalConnectorType = =3D PcdGet8 (PcdSMBIOSPort12InternalConnectorType); SMBIOSPortConnector.SMBIOSPortConnector[11].PortExternalConnectorType = =3D PcdGet8 (PcdSMBIOSPort12ExternalConnectorType); SMBIOSPortConnector.SMBIOSPortConnector[11].PortType =3D PcdGet8 (PcdSMB= IOSPort12Type); =20 - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort13InternalConnect= orDesignator), SMBIOSPortConnector.SMBIOSPortConnector[12].PortInternalConn= ectorDesignator); - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort13ExternalConnect= orDesignator), SMBIOSPortConnector.SMBIOSPortConnector[12].PortExternalConn= ectorDesignator); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort13InternalConnec= torDesignator), SMBIOSPortConnector.SMBIOSPortConnector[12].PortInternalCon= nectorDesignator, ARRAY_SIZE (SMBIOSPortConnector.SMBIOSPortConnector[12].P= ortInternalConnectorDesignator)); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort13ExternalConnec= torDesignator), SMBIOSPortConnector.SMBIOSPortConnector[12].PortExternalCon= nectorDesignator, ARRAY_SIZE (SMBIOSPortConnector.SMBIOSPortConnector[12].P= ortExternalConnectorDesignator)); SMBIOSPortConnector.SMBIOSPortConnector[12].PortInternalConnectorType = =3D PcdGet8 (PcdSMBIOSPort13InternalConnectorType); SMBIOSPortConnector.SMBIOSPortConnector[12].PortExternalConnectorType = =3D PcdGet8 (PcdSMBIOSPort13ExternalConnectorType); SMBIOSPortConnector.SMBIOSPortConnector[12].PortType =3D PcdGet8 (PcdSMB= IOSPort13Type); =20 - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort14InternalConnect= orDesignator), SMBIOSPortConnector.SMBIOSPortConnector[13].PortInternalConn= ectorDesignator); - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort14ExternalConnect= orDesignator), SMBIOSPortConnector.SMBIOSPortConnector[13].PortExternalConn= ectorDesignator); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort14InternalConnec= torDesignator), SMBIOSPortConnector.SMBIOSPortConnector[13].PortInternalCon= nectorDesignator, ARRAY_SIZE (SMBIOSPortConnector.SMBIOSPortConnector[13].P= ortInternalConnectorDesignator)); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort14ExternalConnec= torDesignator), SMBIOSPortConnector.SMBIOSPortConnector[13].PortExternalCon= nectorDesignator, ARRAY_SIZE (SMBIOSPortConnector.SMBIOSPortConnector[13].P= ortExternalConnectorDesignator)); SMBIOSPortConnector.SMBIOSPortConnector[13].PortInternalConnectorType = =3D PcdGet8 (PcdSMBIOSPort14InternalConnectorType); SMBIOSPortConnector.SMBIOSPortConnector[13].PortExternalConnectorType = =3D PcdGet8 (PcdSMBIOSPort14ExternalConnectorType); SMBIOSPortConnector.SMBIOSPortConnector[13].PortType =3D PcdGet8 (PcdSMB= IOSPort14Type); @@ -274,8 +274,8 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscPortInternalConnectorDes= ignator) SmbiosRecord->PortType =3D PortType; =20 OptionalStrStart =3D (CHAR8 *)(SmbiosRecord + 1); - UnicodeStrToAsciiStr(InternalRef, OptionalStrStart); - UnicodeStrToAsciiStr(ExternalRef, OptionalStrStart + InternalRefStrLen += 1); + UnicodeStrToAsciiStrS (InternalRef, OptionalStrStart, InternalRefStrLen = + 1); + UnicodeStrToAsciiStrS (ExternalRef, OptionalStrStart + InternalRefStrLen= + 1, ExternalRefStrLen + 1); =20 // // Now we have got the full smbios record, call smbios protocol to add t= his record. diff --git a/Platform/Intel/QuarkPlatformPkg/Platform/Dxe/SmbiosMiscDxe/Mis= cSystemManufacturerFunction.c b/Platform/Intel/QuarkPlatformPkg/Platform/Dx= e/SmbiosMiscDxe/MiscSystemManufacturerFunction.c index d7658f3d7c..d3bf9d3114 100644 --- a/Platform/Intel/QuarkPlatformPkg/Platform/Dxe/SmbiosMiscDxe/MiscSystem= ManufacturerFunction.c +++ b/Platform/Intel/QuarkPlatformPkg/Platform/Dxe/SmbiosMiscDxe/MiscSystem= ManufacturerFunction.c @@ -65,7 +65,7 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscSystemManufacturer) // // Update strings from PCD // - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemManufacturer), = Manufacturer); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemManufacturer),= Manufacturer, ARRAY_SIZE (Manufacturer)); if (StrLen (Manufacturer) > 0) { TokenToUpdate =3D STRING_TOKEN (STR_MISC_SYSTEM_MANUFACTURER); HiiSetString (mHiiHandle, TokenToUpdate, Manufacturer, NULL); @@ -77,7 +77,7 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscSystemManufacturer) return EFI_UNSUPPORTED; } =20 - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemProductName), P= roductName); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemProductName), = ProductName, ARRAY_SIZE (ProductName)); if (StrLen (ProductName) > 0) { TokenToUpdate =3D STRING_TOKEN (STR_MISC_SYSTEM_PRODUCT_NAME); HiiSetString (mHiiHandle, TokenToUpdate, ProductName, NULL); @@ -89,7 +89,7 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscSystemManufacturer) return EFI_UNSUPPORTED; } =20 - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemVersion), Versi= on); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemVersion), Vers= ion, ARRAY_SIZE (Version)); if (StrLen (Version) > 0) { TokenToUpdate =3D STRING_TOKEN (STR_MISC_SYSTEM_VERSION); HiiSetString (mHiiHandle, TokenToUpdate, Version, NULL); @@ -101,7 +101,7 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscSystemManufacturer) return EFI_UNSUPPORTED; } =20 - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSerialNumber), = SerialNumber); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSerialNumber),= SerialNumber, ARRAY_SIZE (SerialNumber)); if (StrLen (SerialNumber) > 0) { TokenToUpdate =3D STRING_TOKEN (STR_MISC_SYSTEM_SERIAL_NUMBER); HiiSetString (mHiiHandle, TokenToUpdate, SerialNumber, NULL); @@ -113,7 +113,7 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscSystemManufacturer) return EFI_UNSUPPORTED; } =20 - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSKUNumber), SKU= Number); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSKUNumber), SK= UNumber, ARRAY_SIZE (SKUNumber)); if (StrLen (SKUNumber) > 0) { TokenToUpdate =3D STRING_TOKEN (STR_MISC_SYSTEM_SKU_NUMBER); HiiSetString (mHiiHandle, TokenToUpdate, SKUNumber, NULL); @@ -125,7 +125,7 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscSystemManufacturer) return EFI_UNSUPPORTED; } =20 - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemFamily), Family= ); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemFamily), Famil= y, ARRAY_SIZE (Family)); if (StrLen (Family) > 0) { TokenToUpdate =3D STRING_TOKEN (STR_MISC_SYSTEM_FAMILY); HiiSetString (mHiiHandle, TokenToUpdate, Family, NULL); @@ -176,12 +176,12 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscSystemManufacturer) SmbiosRecord->WakeUpType =3D (UINT8)ForType1InputData->SystemWakeupType; =20 OptionalStrStart =3D (CHAR8 *)(SmbiosRecord + 1); - UnicodeStrToAsciiStr(ManufacturerPtr, OptionalStrStart); - UnicodeStrToAsciiStr(ProductNamePtr, OptionalStrStart + ManuStrLen + 1); - UnicodeStrToAsciiStr(VersionPtr, OptionalStrStart + ManuStrLen + 1 + PdN= ameStrLen + 1); - UnicodeStrToAsciiStr(SerialNumberPtr, OptionalStrStart + ManuStrLen + 1 = + PdNameStrLen + 1 + VerStrLen + 1); - UnicodeStrToAsciiStr(SKUNumberPtr, OptionalStrStart + ManuStrLen + 1 + P= dNameStrLen + 1 + VerStrLen + 1 + SerialNumStrLen+ 1); - UnicodeStrToAsciiStr(FamilyPtr, OptionalStrStart + ManuStrLen + 1 + PdNa= meStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + SKUNumStrLen+ 1); + UnicodeStrToAsciiStrS (ManufacturerPtr, OptionalStrStart, ManuStrLen + 1= ); + UnicodeStrToAsciiStrS (ProductNamePtr, OptionalStrStart + ManuStrLen + 1= , PdNameStrLen + 1); + UnicodeStrToAsciiStrS (VersionPtr, OptionalStrStart + ManuStrLen + 1 + P= dNameStrLen + 1, VerStrLen + 1); + UnicodeStrToAsciiStrS (SerialNumberPtr, OptionalStrStart + ManuStrLen + = 1 + PdNameStrLen + 1 + VerStrLen + 1, SerialNumStrLen + 1); + UnicodeStrToAsciiStrS (SKUNumberPtr, OptionalStrStart + ManuStrLen + 1 += PdNameStrLen + 1 + VerStrLen + 1 + SerialNumStrLen+ 1, SKUNumStrLen + 1); + UnicodeStrToAsciiStrS (FamilyPtr, OptionalStrStart + ManuStrLen + 1 + Pd= NameStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + SKUNumStrLen+ 1, Fam= ilyStrLen + 1); =20 // // Now we have got the full smbios record, call smbios protocol to add t= his record. diff --git a/Platform/Intel/QuarkPlatformPkg/Platform/Dxe/SmbiosMiscDxe/Mis= cSystemOptionStringFunction.c b/Platform/Intel/QuarkPlatformPkg/Platform/Dx= e/SmbiosMiscDxe/MiscSystemOptionStringFunction.c index a32765f836..28f0d4d374 100644 --- a/Platform/Intel/QuarkPlatformPkg/Platform/Dxe/SmbiosMiscDxe/MiscSystem= OptionStringFunction.c +++ b/Platform/Intel/QuarkPlatformPkg/Platform/Dxe/SmbiosMiscDxe/MiscSystem= OptionStringFunction.c @@ -64,7 +64,7 @@ MISC_SMBIOS_TABLE_FUNCTION(SystemOptionString) =20 SmbiosRecord->StringCount =3D 1; OptionalStrStart =3D (CHAR8*) (SmbiosRecord + 1); - UnicodeStrToAsciiStr(OptionString, OptionalStrStart); + UnicodeStrToAsciiStrS (OptionString, OptionalStrStart, OptStrLen + 1); // // Now we have got the full smbios record, call smbios protocol to add t= his record. // diff --git a/Platform/Intel/QuarkPlatformPkg/Platform/Dxe/SmbiosMiscDxe/Mis= cSystemSlotDesignationFunction.c b/Platform/Intel/QuarkPlatformPkg/Platform= /Dxe/SmbiosMiscDxe/MiscSystemSlotDesignationFunction.c index 6a7348e3df..344daca9c1 100644 --- a/Platform/Intel/QuarkPlatformPkg/Platform/Dxe/SmbiosMiscDxe/MiscSystem= SlotDesignationFunction.c +++ b/Platform/Intel/QuarkPlatformPkg/Platform/Dxe/SmbiosMiscDxe/MiscSystem= SlotDesignationFunction.c @@ -69,7 +69,7 @@ GetMiscSLotConfigFromPcd () // Type 9 // SMBIOSlotConfig.SMBIOSSystemSlotNumber =3D PcdGet8 (PcdSMBIOSSystemSlotN= umber); - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot1Designatio= n), SMBIOSlotConfig.SMBIOSSystemSlot[0].SlotDesignation); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot1Designati= on), SMBIOSlotConfig.SMBIOSSystemSlot[0].SlotDesignation, ARRAY_SIZE (SMBIO= SlotConfig.SMBIOSSystemSlot[0].SlotDesignation)); SMBIOSlotConfig.SMBIOSSystemSlot[0].SlotType =3D PcdGet8(PcdSMBIOSSystem= Slot1Type); SMBIOSlotConfig.SMBIOSSystemSlot[0].SlotDataBusWidth =3D PcdGet8(PcdSMBI= OSSystemSlot1DataBusWidth); SMBIOSlotConfig.SMBIOSSystemSlot[0].SlotUsage =3D PcdGet8(PcdSMBIOSSyste= mSlot1Usage); @@ -77,7 +77,7 @@ GetMiscSLotConfigFromPcd () SMBIOSlotConfig.SMBIOSSystemSlot[0].SlotId =3D PcdGet16(PcdSMBIOSSystemS= lot1Id); SMBIOSlotConfig.SMBIOSSystemSlot[0].SlotCharacteristics =3D PcdGet32(Pcd= SMBIOSSystemSlot1Characteristics); =20 - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot2Designatio= n), SMBIOSlotConfig.SMBIOSSystemSlot[1].SlotDesignation); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot2Designati= on), SMBIOSlotConfig.SMBIOSSystemSlot[1].SlotDesignation, ARRAY_SIZE (SMBIO= SlotConfig.SMBIOSSystemSlot[1].SlotDesignation)); SMBIOSlotConfig.SMBIOSSystemSlot[1].SlotType =3D PcdGet8(PcdSMBIOSSystem= Slot2Type); SMBIOSlotConfig.SMBIOSSystemSlot[1].SlotDataBusWidth =3D PcdGet8(PcdSMBI= OSSystemSlot2DataBusWidth); SMBIOSlotConfig.SMBIOSSystemSlot[1].SlotUsage =3D PcdGet8(PcdSMBIOSSyste= mSlot2Usage); @@ -85,7 +85,7 @@ GetMiscSLotConfigFromPcd () SMBIOSlotConfig.SMBIOSSystemSlot[1].SlotId =3D PcdGet16(PcdSMBIOSSystemS= lot2Id); SMBIOSlotConfig.SMBIOSSystemSlot[1].SlotCharacteristics =3D PcdGet32(Pcd= SMBIOSSystemSlot2Characteristics); =20 - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot3Designatio= n), SMBIOSlotConfig.SMBIOSSystemSlot[2].SlotDesignation); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot3Designati= on), SMBIOSlotConfig.SMBIOSSystemSlot[2].SlotDesignation, ARRAY_SIZE (SMBIO= SlotConfig.SMBIOSSystemSlot[2].SlotDesignation)); SMBIOSlotConfig.SMBIOSSystemSlot[2].SlotType =3D PcdGet8(PcdSMBIOSSystem= Slot3Type); SMBIOSlotConfig.SMBIOSSystemSlot[2].SlotDataBusWidth =3D PcdGet8(PcdSMBI= OSSystemSlot3DataBusWidth); SMBIOSlotConfig.SMBIOSSystemSlot[2].SlotUsage =3D PcdGet8(PcdSMBIOSSyste= mSlot3Usage); @@ -93,7 +93,7 @@ GetMiscSLotConfigFromPcd () SMBIOSlotConfig.SMBIOSSystemSlot[2].SlotId =3D PcdGet16(PcdSMBIOSSystemS= lot3Id); SMBIOSlotConfig.SMBIOSSystemSlot[2].SlotCharacteristics =3D PcdGet32(Pcd= SMBIOSSystemSlot3Characteristics); =20 - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot4Designatio= n), SMBIOSlotConfig.SMBIOSSystemSlot[3].SlotDesignation); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot4Designati= on), SMBIOSlotConfig.SMBIOSSystemSlot[3].SlotDesignation, ARRAY_SIZE (SMBIO= SlotConfig.SMBIOSSystemSlot[3].SlotDesignation)); SMBIOSlotConfig.SMBIOSSystemSlot[3].SlotType =3D PcdGet8(PcdSMBIOSSystem= Slot4Type); SMBIOSlotConfig.SMBIOSSystemSlot[3].SlotDataBusWidth =3D PcdGet8(PcdSMBI= OSSystemSlot4DataBusWidth); SMBIOSlotConfig.SMBIOSSystemSlot[3].SlotUsage =3D PcdGet8(PcdSMBIOSSyste= mSlot4Usage); @@ -101,7 +101,7 @@ GetMiscSLotConfigFromPcd () SMBIOSlotConfig.SMBIOSSystemSlot[3].SlotId =3D PcdGet16(PcdSMBIOSSystemS= lot4Id); SMBIOSlotConfig.SMBIOSSystemSlot[3].SlotCharacteristics =3D PcdGet32(Pcd= SMBIOSSystemSlot4Characteristics); =20 - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot5Designatio= n), SMBIOSlotConfig.SMBIOSSystemSlot[4].SlotDesignation); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot5Designati= on), SMBIOSlotConfig.SMBIOSSystemSlot[4].SlotDesignation, ARRAY_SIZE (SMBIO= SlotConfig.SMBIOSSystemSlot[4].SlotDesignation)); SMBIOSlotConfig.SMBIOSSystemSlot[4].SlotType =3D PcdGet8(PcdSMBIOSSystem= Slot5Type); SMBIOSlotConfig.SMBIOSSystemSlot[4].SlotDataBusWidth =3D PcdGet8(PcdSMBI= OSSystemSlot5DataBusWidth); SMBIOSlotConfig.SMBIOSSystemSlot[4].SlotUsage =3D PcdGet8(PcdSMBIOSSyste= mSlot5Usage); @@ -109,7 +109,7 @@ GetMiscSLotConfigFromPcd () SMBIOSlotConfig.SMBIOSSystemSlot[4].SlotId =3D PcdGet16(PcdSMBIOSSystemS= lot5Id); SMBIOSlotConfig.SMBIOSSystemSlot[4].SlotCharacteristics =3D PcdGet32(Pcd= SMBIOSSystemSlot5Characteristics); =20 - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot6Designatio= n), SMBIOSlotConfig.SMBIOSSystemSlot[5].SlotDesignation); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot6Designati= on), SMBIOSlotConfig.SMBIOSSystemSlot[5].SlotDesignation, ARRAY_SIZE (SMBIO= SlotConfig.SMBIOSSystemSlot[5].SlotDesignation)); SMBIOSlotConfig.SMBIOSSystemSlot[5].SlotType =3D PcdGet8(PcdSMBIOSSystem= Slot6Type); SMBIOSlotConfig.SMBIOSSystemSlot[5].SlotDataBusWidth =3D PcdGet8(PcdSMBI= OSSystemSlot6DataBusWidth); SMBIOSlotConfig.SMBIOSSystemSlot[5].SlotUsage =3D PcdGet8(PcdSMBIOSSyste= mSlot6Usage); @@ -117,7 +117,7 @@ GetMiscSLotConfigFromPcd () SMBIOSlotConfig.SMBIOSSystemSlot[5].SlotId =3D PcdGet16(PcdSMBIOSSystemS= lot6Id); SMBIOSlotConfig.SMBIOSSystemSlot[5].SlotCharacteristics =3D PcdGet32(Pcd= SMBIOSSystemSlot6Characteristics); =20 - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot7Designatio= n), SMBIOSlotConfig.SMBIOSSystemSlot[6].SlotDesignation); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot7Designati= on), SMBIOSlotConfig.SMBIOSSystemSlot[6].SlotDesignation, ARRAY_SIZE (SMBIO= SlotConfig.SMBIOSSystemSlot[6].SlotDesignation)); SMBIOSlotConfig.SMBIOSSystemSlot[6].SlotType =3D PcdGet8(PcdSMBIOSSystem= Slot7Type); SMBIOSlotConfig.SMBIOSSystemSlot[6].SlotDataBusWidth =3D PcdGet8(PcdSMBI= OSSystemSlot7DataBusWidth); SMBIOSlotConfig.SMBIOSSystemSlot[6].SlotUsage =3D PcdGet8(PcdSMBIOSSyste= mSlot7Usage); @@ -125,7 +125,7 @@ GetMiscSLotConfigFromPcd () SMBIOSlotConfig.SMBIOSSystemSlot[6].SlotId =3D PcdGet16(PcdSMBIOSSystemS= lot7Id); SMBIOSlotConfig.SMBIOSSystemSlot[6].SlotCharacteristics =3D PcdGet32(Pcd= SMBIOSSystemSlot7Characteristics); =20 - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot8Designatio= n), SMBIOSlotConfig.SMBIOSSystemSlot[7].SlotDesignation); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot8Designati= on), SMBIOSlotConfig.SMBIOSSystemSlot[7].SlotDesignation, ARRAY_SIZE (SMBIO= SlotConfig.SMBIOSSystemSlot[7].SlotDesignation)); SMBIOSlotConfig.SMBIOSSystemSlot[7].SlotType =3D PcdGet8(PcdSMBIOSSystem= Slot8Type); SMBIOSlotConfig.SMBIOSSystemSlot[7].SlotDataBusWidth =3D PcdGet8(PcdSMBI= OSSystemSlot8DataBusWidth); SMBIOSlotConfig.SMBIOSSystemSlot[7].SlotUsage =3D PcdGet8(PcdSMBIOSSyste= mSlot8Usage); @@ -133,7 +133,7 @@ GetMiscSLotConfigFromPcd () SMBIOSlotConfig.SMBIOSSystemSlot[7].SlotId =3D PcdGet16(PcdSMBIOSSystemS= lot8Id); SMBIOSlotConfig.SMBIOSSystemSlot[7].SlotCharacteristics =3D PcdGet32(Pcd= SMBIOSSystemSlot8Characteristics); =20 - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot9Designatio= n), SMBIOSlotConfig.SMBIOSSystemSlot[8].SlotDesignation); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot9Designati= on), SMBIOSlotConfig.SMBIOSSystemSlot[8].SlotDesignation, ARRAY_SIZE (SMBIO= SlotConfig.SMBIOSSystemSlot[8].SlotDesignation)); SMBIOSlotConfig.SMBIOSSystemSlot[8].SlotType =3D PcdGet8(PcdSMBIOSSystem= Slot9Type); SMBIOSlotConfig.SMBIOSSystemSlot[8].SlotDataBusWidth =3D PcdGet8(PcdSMBI= OSSystemSlot9DataBusWidth); SMBIOSlotConfig.SMBIOSSystemSlot[8].SlotUsage =3D PcdGet8(PcdSMBIOSSyste= mSlot9Usage); @@ -141,7 +141,7 @@ GetMiscSLotConfigFromPcd () SMBIOSlotConfig.SMBIOSSystemSlot[8].SlotId =3D PcdGet16(PcdSMBIOSSystemS= lot9Id); SMBIOSlotConfig.SMBIOSSystemSlot[8].SlotCharacteristics =3D PcdGet32(Pcd= SMBIOSSystemSlot9Characteristics); =20 - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot10Designati= on), SMBIOSlotConfig.SMBIOSSystemSlot[9].SlotDesignation); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot10Designat= ion), SMBIOSlotConfig.SMBIOSSystemSlot[9].SlotDesignation, ARRAY_SIZE (SMBI= OSlotConfig.SMBIOSSystemSlot[9].SlotDesignation)); SMBIOSlotConfig.SMBIOSSystemSlot[9].SlotType =3D PcdGet8(PcdSMBIOSSystem= Slot10Type); SMBIOSlotConfig.SMBIOSSystemSlot[9].SlotDataBusWidth =3D PcdGet8(PcdSMBI= OSSystemSlot10DataBusWidth); SMBIOSlotConfig.SMBIOSSystemSlot[9].SlotUsage =3D PcdGet8(PcdSMBIOSSyste= mSlot10Usage); @@ -149,7 +149,7 @@ GetMiscSLotConfigFromPcd () SMBIOSlotConfig.SMBIOSSystemSlot[9].SlotId =3D PcdGet16(PcdSMBIOSSystemS= lot10Id); SMBIOSlotConfig.SMBIOSSystemSlot[9].SlotCharacteristics =3D PcdGet32(Pcd= SMBIOSSystemSlot10Characteristics); =20 - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot11Designati= on), SMBIOSlotConfig.SMBIOSSystemSlot[10].SlotDesignation); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot11Designat= ion), SMBIOSlotConfig.SMBIOSSystemSlot[10].SlotDesignation, ARRAY_SIZE (SMB= IOSlotConfig.SMBIOSSystemSlot[10].SlotDesignation)); SMBIOSlotConfig.SMBIOSSystemSlot[10].SlotType =3D PcdGet8(PcdSMBIOSSyste= mSlot11Type); SMBIOSlotConfig.SMBIOSSystemSlot[10].SlotDataBusWidth =3D PcdGet8(PcdSMB= IOSSystemSlot11DataBusWidth); SMBIOSlotConfig.SMBIOSSystemSlot[10].SlotUsage =3D PcdGet8(PcdSMBIOSSyst= emSlot11Usage); @@ -157,7 +157,7 @@ GetMiscSLotConfigFromPcd () SMBIOSlotConfig.SMBIOSSystemSlot[10].SlotId =3D PcdGet16(PcdSMBIOSSystem= Slot11Id); SMBIOSlotConfig.SMBIOSSystemSlot[10].SlotCharacteristics =3D PcdGet32(Pc= dSMBIOSSystemSlot11Characteristics); =20 - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot12Designati= on), SMBIOSlotConfig.SMBIOSSystemSlot[11].SlotDesignation); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot12Designat= ion), SMBIOSlotConfig.SMBIOSSystemSlot[11].SlotDesignation, ARRAY_SIZE (SMB= IOSlotConfig.SMBIOSSystemSlot[11].SlotDesignation)); SMBIOSlotConfig.SMBIOSSystemSlot[11].SlotType =3D PcdGet8(PcdSMBIOSSyste= mSlot12Type); SMBIOSlotConfig.SMBIOSSystemSlot[11].SlotDataBusWidth =3D PcdGet8(PcdSMB= IOSSystemSlot12DataBusWidth); SMBIOSlotConfig.SMBIOSSystemSlot[11].SlotUsage =3D PcdGet8(PcdSMBIOSSyst= emSlot12Usage); @@ -165,7 +165,7 @@ GetMiscSLotConfigFromPcd () SMBIOSlotConfig.SMBIOSSystemSlot[11].SlotId =3D PcdGet16(PcdSMBIOSSystem= Slot12Id); SMBIOSlotConfig.SMBIOSSystemSlot[11].SlotCharacteristics =3D PcdGet32(Pc= dSMBIOSSystemSlot12Characteristics); =20 - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot13Designati= on), SMBIOSlotConfig.SMBIOSSystemSlot[12].SlotDesignation); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot13Designat= ion), SMBIOSlotConfig.SMBIOSSystemSlot[12].SlotDesignation, ARRAY_SIZE (SMB= IOSlotConfig.SMBIOSSystemSlot[12].SlotDesignation)); SMBIOSlotConfig.SMBIOSSystemSlot[12].SlotType =3D PcdGet8(PcdSMBIOSSyste= mSlot13Type); SMBIOSlotConfig.SMBIOSSystemSlot[12].SlotDataBusWidth =3D PcdGet8(PcdSMB= IOSSystemSlot13DataBusWidth); SMBIOSlotConfig.SMBIOSSystemSlot[12].SlotUsage =3D PcdGet8(PcdSMBIOSSyst= emSlot13Usage); @@ -173,7 +173,7 @@ GetMiscSLotConfigFromPcd () SMBIOSlotConfig.SMBIOSSystemSlot[12].SlotId =3D PcdGet16(PcdSMBIOSSystem= Slot13Id); SMBIOSlotConfig.SMBIOSSystemSlot[12].SlotCharacteristics =3D PcdGet32(Pc= dSMBIOSSystemSlot13Characteristics); =20 - AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot14Designati= on), SMBIOSlotConfig.SMBIOSSystemSlot[13].SlotDesignation); + AsciiStrToUnicodeStrS ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot14Designat= ion), SMBIOSlotConfig.SMBIOSSystemSlot[13].SlotDesignation, ARRAY_SIZE (SMB= IOSlotConfig.SMBIOSSystemSlot[13].SlotDesignation)); SMBIOSlotConfig.SMBIOSSystemSlot[13].SlotType =3D PcdGet8(PcdSMBIOSSyste= mSlot14Type); SMBIOSlotConfig.SMBIOSSystemSlot[13].SlotDataBusWidth =3D PcdGet8(PcdSMB= IOSSystemSlot14DataBusWidth); SMBIOSlotConfig.SMBIOSSystemSlot[13].SlotUsage =3D PcdGet8(PcdSMBIOSSyst= emSlot14Usage); @@ -269,7 +269,7 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscSystemSlotDesignator) // Slot Characteristics // OptionalStrStart =3D (CHAR8 *)(SmbiosRecord + 1); - UnicodeStrToAsciiStr(SlotDesignation, OptionalStrStart); + UnicodeStrToAsciiStrS (SlotDesignation, OptionalStrStart, SlotDesignatio= nStrLen + 1); // // Now we have got the full smbios record, call smbios protocol to add t= his record. // --=20 2.29.2.windows.2 -=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 (#68446): https://edk2.groups.io/g/devel/message/68446 Mute This Topic: https://groups.io/mt/78798415/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- From nobody Thu May 2 01:38:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+68447+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+68447+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1607409797; cv=none; d=zohomail.com; s=zohoarc; b=A9KXbsDupVZkjcSvLvd0UwA3BGMJHv+ju6TyR7aFLjJB9bmHGxWXKHU8+2qrkhfbEQEDngKZ3CxR1r2f3gUjDfHYMIXUOz8HWA5dfZIQ0/N/wtzDJ4WcScnSV59Wpg0ggRrH4AtFf0CqK5ZOjYcxQcIn5JK7s6+rNW68AJoRYSA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607409797; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=lxWYnlfGPBqKJL4izVml9cRubn+mm253VI4bG6lAgPI=; b=QMaJH8EzZR8OgiNL7rWiDkaONClt4+SXwXc/Xz3uDmkBsRA8SF8m/WP/LdTlpEge6mjyc1t1LXEbQ8PUMZjNaDZJv7mmYF8HW9TuuzhJvRJodh/Mwl/GdcDEMBmh3ka8UCPIktavj4drqmNpDM1ke8gTu6sO5NpSHhAxLI6rDX4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+68447+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1607409797135212.50373183630302; Mon, 7 Dec 2020 22:43:17 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id H7iwYY1788612xT6fsH78HA5; Mon, 07 Dec 2020 22:43:16 -0800 X-Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web12.5100.1607409790798613345 for ; Mon, 07 Dec 2020 22:43:10 -0800 IronPort-SDR: o0ysQB9d5xdNlU1PIDqThq/b06jnsemGH0i5qkANGy6RzsIKsf8wANCDt1MlZLMXqiiXPIM9gn LEP99AeRBHXA== X-IronPort-AV: E=McAfee;i="6000,8403,9828"; a="192123193" X-IronPort-AV: E=Sophos;i="5.78,401,1599548400"; d="scan'208";a="192123193" X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2020 22:43:09 -0800 IronPort-SDR: mNFUHoTab/hFSkkR/2Klb8h5uqQ39ftoWuiBNS7g+igeBM6pXF0reh3UI0Z+qsmSxTQXa8wOtK j0/TZRB5qpAw== X-IronPort-AV: E=Sophos;i="5.78,401,1599548400"; d="scan'208";a="363514574" X-Received: from mdkinney-mobl2.amr.corp.intel.com ([10.252.133.198]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2020 22:43:09 -0800 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Kelly Steele Subject: [edk2-devel] [Patch 2/2] Platform/QuarkPlatformPkg: Add VariablePolicy resolutions Date: Mon, 7 Dec 2020 22:42:48 -0800 Message-Id: <20201208064248.1167-3-michael.d.kinney@intel.com> In-Reply-To: <20201208064248.1167-1-michael.d.kinney@intel.com> References: <20201208064248.1167-1-michael.d.kinney@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,michael.d.kinney@intel.com X-Gm-Message-State: CTJp2kyfDQjQOPwGkarNSv1Tx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1607409796; bh=xepEHTnSGfSjbQS2IcPtWQgt/E85/VTLp7BRqRQCpSs=; h=Cc:Date:From:Reply-To:Subject:To; b=kjO9Nd2xOpi7U5CxUHWsBAWTkjw+Pj1EKttuPiZUN4wrhwqvT27CeMZhWUfqN3s5AaF 5xQHZJMRjN2YlDny0wbqvZQJwmJ3+l7Xu1IwL66A783CQlhG29+7Uji9OODnfjtSjFn8l 4vTPTBvHdfbHTgseC06IuzMGQlKipg/Px9Q= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Add resolutions for - VariablePolicyLib - VariablePolicyHelperLib - VariablePolicyLib (DXE_RUNTIME_DRIVER) Cc: Kelly Steele Signed-off-by: Michael D Kinney Reviewed-by: Kelly Steele --- Platform/Intel/QuarkPlatformPkg/Quark.dsc | 5 +++++ Platform/Intel/QuarkPlatformPkg/QuarkMin.dsc | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/Platform/Intel/QuarkPlatformPkg/Quark.dsc b/Platform/Intel/Qua= rkPlatformPkg/Quark.dsc index 2e4e3491ee..9f64dcb627 100644 --- a/Platform/Intel/QuarkPlatformPkg/Quark.dsc +++ b/Platform/Intel/QuarkPlatformPkg/Quark.dsc @@ -122,6 +122,7 @@ [LibraryClasses] UefiCpuLib|UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.inf SortLib|MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManag= erLib.inf + SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf =20 # # Generic Modules @@ -146,6 +147,8 @@ [LibraryClasses] ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExt= ractGuidedSectionLib.inf LockBoxLib|MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxDxeLib.inf VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf + VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyL= ib.inf + VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/Var= iablePolicyHelperLib.inf DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseD= ebugPrintErrorLevelLib.inf !if $(LOGGING) DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf @@ -309,6 +312,7 @@ [LibraryClasses.IA32.DXE_RUNTIME_DRIVER] DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf !endif ReportStatusCodeLib|MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/R= untimeDxeReportStatusCodeLib.inf + VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyL= ibRuntimeDxe.inf QNCAccessLib|QuarkSocPkg/QuarkNorthCluster/Library/QNCAccessLib/RuntimeQ= NCAccessLib.inf PciLib|MdePkg/Library/BasePciLibCf8/BasePciLibCf8.inf !if $(SECURE_BOOT_ENABLE) || $(MEASURED_BOOT_ENABLE) @@ -683,6 +687,7 @@ [Components.IA32] MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf { NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf + NULL|MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.inf NULL|MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiLib.inf NULL|MdeModulePkg/Library/VarCheckPcdLib/VarCheckPcdLib.inf } diff --git a/Platform/Intel/QuarkPlatformPkg/QuarkMin.dsc b/Platform/Intel/= QuarkPlatformPkg/QuarkMin.dsc index ec52fe0fe4..db144aab75 100644 --- a/Platform/Intel/QuarkPlatformPkg/QuarkMin.dsc +++ b/Platform/Intel/QuarkPlatformPkg/QuarkMin.dsc @@ -110,6 +110,7 @@ [LibraryClasses] UefiCpuLib|UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.inf SortLib|MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManag= erLib.inf + SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf =20 # # Generic Modules @@ -134,6 +135,8 @@ [LibraryClasses] ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExt= ractGuidedSectionLib.inf LockBoxLib|MdeModulePkg/Library/LockBoxNullLib/LockBoxNullLib.inf VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf + VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyL= ib.inf + VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/Var= iablePolicyHelperLib.inf DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseD= ebugPrintErrorLevelLib.inf !if $(LOGGING) DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf @@ -266,6 +269,7 @@ [LibraryClasses.IA32.SMM_CORE] =20 [LibraryClasses.IA32.DXE_RUNTIME_DRIVER] ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseRepor= tStatusCodeLibNull.inf + VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyL= ibRuntimeDxe.inf QNCAccessLib|QuarkSocPkg/QuarkNorthCluster/Library/QNCAccessLib/RuntimeQ= NCAccessLib.inf PciLib|MdePkg/Library/BasePciLibCf8/BasePciLibCf8.inf !if $(SECURE_BOOT_ENABLE) --=20 2.29.2.windows.2 -=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 (#68447): https://edk2.groups.io/g/devel/message/68447 Mute This Topic: https://groups.io/mt/78798416/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-