From b6cdc9f4849d944156b5796026210b1c43b21e88 Mon Sep 17 00:00:00 2001 From: Nikolaj Schlej Date: Mon, 19 Jun 2023 18:01:25 -0700 Subject: [PATCH] Add support for long paths in Windows 10+ --- .github/workflows/main.yml | 6 ++-- UEFIExtract/CMakeLists.txt | 2 +- UEFIExtract/ffsdumper.cpp | 5 +-- UEFIExtract/uefiextract.manifest | 8 +++++ UEFIExtract/uefiextract_main.cpp | 5 ++- UEFIFind/uefifind.cpp | 8 ++--- common/basetypes.h | 6 ---- common/bstrlib/bstrlib.h | 7 +++- common/bstrlib/bstrwrap.h | 1 - common/ffsparser.cpp | 4 +-- common/filesystem.cpp | 58 ++++++++++++++++++++------------ common/filesystem.h | 5 ++- common/guids.csv | 36 ++++++++++++++++++++ common/ustring.h | 8 +++-- 14 files changed, 108 insertions(+), 51 deletions(-) create mode 100644 UEFIExtract/uefiextract.manifest diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8342320..cc3a2f9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -159,7 +159,7 @@ jobs: - name: Configure UEFIExtract shell: bash working-directory: ${{runner.workspace}}/build/UEFIExtract - run: cmake -G "Visual Studio 16 2019" -T "v141_xp" ../../UEFITool/UEFIExtract/ + run: cmake -G "Visual Studio 16 2019" -A Win32 -T "v141_xp" -DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded" ../../UEFITool/UEFIExtract/ - name: Build UEFIExtract working-directory: ${{runner.workspace}}/build/UEFIExtract shell: bash @@ -175,7 +175,7 @@ jobs: - name: Configure UEFIFind working-directory: ${{runner.workspace}}/build/UEFIFind shell: bash - run: cmake -G "Visual Studio 16 2019" -T "v141_xp" ../../UEFITool/UEFIFind/ + run: cmake -G "Visual Studio 16 2019" -A Win32 -T "v141_xp" -DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded" ../../UEFITool/UEFIFind/ - name: Build UEFIFind working-directory: ${{runner.workspace}}/build/UEFIFind shell: bash @@ -238,7 +238,7 @@ jobs: - name: Configure everything working-directory: ${{runner.workspace}}/build shell: cmd - run: cmake -DCMAKE_PREFIX_PATH="D:\a\UEFITool\qt-6.5.0-static-x64-msvc2022" -DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded" ../UEFITool + run: cmake -DCMAKE_PREFIX_PATH="D:\a\UEFITool\qt-6.5.0-static-x64-msvc2022" -DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded" -A x64 ../UEFITool - name: Build everything working-directory: ${{runner.workspace}}/build shell: bash diff --git a/UEFIExtract/CMakeLists.txt b/UEFIExtract/CMakeLists.txt index bfcb773..850a74d 100644 --- a/UEFIExtract/CMakeLists.txt +++ b/UEFIExtract/CMakeLists.txt @@ -69,7 +69,7 @@ ADD_DEFINITIONS( -DU_ENABLE_GUID_DATABASE_SUPPORT ) -ADD_EXECUTABLE(UEFIExtract ${PROJECT_SOURCES}) +ADD_EXECUTABLE(UEFIExtract ${PROJECT_SOURCES} uefiextract.manifest) IF(UNIX) SET_TARGET_PROPERTIES(UEFIExtract PROPERTIES OUTPUT_NAME uefiextract) diff --git a/UEFIExtract/ffsdumper.cpp b/UEFIExtract/ffsdumper.cpp index cb4b617..44e639b 100644 --- a/UEFIExtract/ffsdumper.cpp +++ b/UEFIExtract/ffsdumper.cpp @@ -33,8 +33,9 @@ USTATUS FfsDumper::dump(const UModelIndex & root, const UString & path, const Du printf("Error %zu returned from recursiveDump (directory \"%s\").\n", result, (const char*)path.toLocal8Bit()); return result; } else if (!dumped) { - removeDirectory(path); - printf("Removed directory \"%s\" since nothing was dumped.\n", (const char*)path.toLocal8Bit()); + if (removeDirectory(path)) { + printf("Removed directory \"%s\" since nothing was dumped.\n", (const char*)path.toLocal8Bit()); + } return U_ITEM_NOT_FOUND; } diff --git a/UEFIExtract/uefiextract.manifest b/UEFIExtract/uefiextract.manifest new file mode 100644 index 0000000..9e1a8e3 --- /dev/null +++ b/UEFIExtract/uefiextract.manifest @@ -0,0 +1,8 @@ + + + + + true + + + \ No newline at end of file diff --git a/UEFIExtract/uefiextract_main.cpp b/UEFIExtract/uefiextract_main.cpp index 0a022ab..78db042 100644 --- a/UEFIExtract/uefiextract_main.cpp +++ b/UEFIExtract/uefiextract_main.cpp @@ -72,9 +72,8 @@ int main(int argc, char *argv[]) USTATUS result; UByteArray buffer; UString path = getAbsPath(argv[1]); - result = readFileIntoBuffer(path, buffer); - if (result) - return result; + if (false == readFileIntoBuffer(path, buffer)) + return U_FILE_OPEN; // Hack to support legacy UEFIDump mode if (argc == 3 && !std::strcmp(argv[2], "unpack")) { diff --git a/UEFIFind/uefifind.cpp b/UEFIFind/uefifind.cpp index 4e7412a..5b2d848 100644 --- a/UEFIFind/uefifind.cpp +++ b/UEFIFind/uefifind.cpp @@ -32,13 +32,11 @@ UEFIFind::~UEFIFind() USTATUS UEFIFind::init(const UString & path) { - USTATUS result; UByteArray buffer; - result = readFileIntoBuffer(path, buffer); - if (result) - return result; + if (false == readFileIntoBuffer(path, buffer)) + return U_FILE_OPEN; - result = ffsParser->parse(buffer); + USTATUS result = ffsParser->parse(buffer); if (result) return result; diff --git a/common/basetypes.h b/common/basetypes.h index 99bbb0e..89c94f9 100644 --- a/common/basetypes.h +++ b/common/basetypes.h @@ -226,10 +226,4 @@ typedef struct EFI_TIME_ { #define __STDC_FORMAT_MACROS #include -#if defined(__clang__) || defined(__GNUC__) -#define ATTRIBUTE_FORMAT_(t,f,a) __attribute__((format(t, f, a))) -#else -#define ATTRIBUTE_FORMAT_(t,f,a) -#endif - #endif // BASETYPES_H diff --git a/common/bstrlib/bstrlib.h b/common/bstrlib/bstrlib.h index 39fa835..81b6a82 100644 --- a/common/bstrlib/bstrlib.h +++ b/common/bstrlib/bstrlib.h @@ -22,7 +22,6 @@ extern "C" { #include #include #include -#include "../basetypes.h" #if !defined (BSTRLIB_VSNP_OK) && !defined (BSTRLIB_NOVSNP) # if defined (__TURBOC__) && !defined (__BORLANDC__) @@ -30,6 +29,12 @@ extern "C" { # endif #endif +#if defined(__clang__) || defined(__GNUC__) +#define ATTRIBUTE_FORMAT_(t,f,a) __attribute__((format(t, f, a))) +#else +#define ATTRIBUTE_FORMAT_(t,f,a) +#endif + #define BSTR_ERR (-1) #define BSTR_OK (0) #define BSTR_BS_BUFF_LENGTH_GET (0) diff --git a/common/bstrlib/bstrwrap.h b/common/bstrlib/bstrwrap.h index b8f628d..5532bee 100644 --- a/common/bstrlib/bstrwrap.h +++ b/common/bstrlib/bstrwrap.h @@ -52,7 +52,6 @@ #include #include "bstrlib.h" #include "../ubytearray.h" -#include "../basetypes.h" #ifdef __cplusplus diff --git a/common/ffsparser.cpp b/common/ffsparser.cpp index e3eaf52..93d3e6c 100644 --- a/common/ffsparser.cpp +++ b/common/ffsparser.cpp @@ -1135,7 +1135,7 @@ USTATUS FfsParser::parseVolumeHeader(const UByteArray & volume, const UINT32 loc msgInvalidChecksum = true; // Get info - if (headerSize >= volume.size()) { + if (headerSize >= (UINT32)volume.size()) { return U_INVALID_VOLUME; } UByteArray header = volume.left(headerSize); @@ -1166,7 +1166,7 @@ USTATUS FfsParser::parseVolumeHeader(const UByteArray & volume, const UINT32 loc return U_INVALID_VOLUME; } if (volumeHeader->Revision > 1 && volumeHeader->ExtHeaderOffset) { - if (volume.size() < volumeHeader->ExtHeaderOffset + sizeof(EFI_FIRMWARE_VOLUME_EXT_HEADER)) { + if ((UINT32)volume.size() < volumeHeader->ExtHeaderOffset + sizeof(EFI_FIRMWARE_VOLUME_EXT_HEADER)) { return U_INVALID_VOLUME; } const EFI_FIRMWARE_VOLUME_EXT_HEADER* extendedHeader = (const EFI_FIRMWARE_VOLUME_EXT_HEADER*)(volume.constData() + volumeHeader->ExtHeaderOffset); diff --git a/common/filesystem.cpp b/common/filesystem.cpp index d59a47b..b2b8d65 100644 --- a/common/filesystem.cpp +++ b/common/filesystem.cpp @@ -15,76 +15,90 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include -USTATUS readFileIntoBuffer(const UString& inPath, UByteArray& buf) { +bool readFileIntoBuffer(const UString& inPath, UByteArray& buf) +{ if (!isExistOnFs(inPath)) - return U_FILE_OPEN; + return false; std::ifstream inputFile(inPath.toLocal8Bit(), std::ios::in | std::ios::binary); if (!inputFile) - return U_FILE_OPEN; + return false; std::vector buffer(std::istreambuf_iterator(inputFile), (std::istreambuf_iterator())); inputFile.close(); buf = buffer; - return U_SUCCESS; + return true; } - #if defined(_WIN32) || defined(__MINGW32__) #include #include -bool isExistOnFs(const UString & path) { +bool isExistOnFs(const UString & path) +{ struct _stat buf; return (_stat(path.toLocal8Bit(), &buf) == 0); } -bool makeDirectory(const UString & dir) { +bool makeDirectory(const UString & dir) +{ return (_mkdir(dir.toLocal8Bit()) == 0); } -bool changeDirectory(const UString & dir) { +bool changeDirectory(const UString & dir) +{ return (_chdir(dir.toLocal8Bit()) == 0); } -void removeDirectory(const UString & dir) { +bool removeDirectory(const UString & dir) +{ int r = _rmdir(dir.toLocal8Bit()); - // Hack: unlike *nix, Windows does not permit deleting current directories. + // Hack: unlike *nix, Windows does not permit deleting current directories if (r < 0 && errno == EACCES && changeDirectory(dir + UString("/../"))) { - (void)_rmdir(dir.toLocal8Bit()); + return (_rmdir(dir.toLocal8Bit()) == 0); } + return (r == 0); } -UString getAbsPath(const UString & path) { - char abs[_MAX_PATH] = {}; - if (_fullpath(abs, path.toLocal8Bit(), sizeof(abs))) - return UString(abs); - return path; +UString getAbsPath(const UString & path) +{ + char * abs = (char*)calloc(0x8000, 1); + UString new_path; + if (_fullpath(abs, path.toLocal8Bit(), 0x8000)) + new_path = UString(abs); + else + new_path = path; + free(abs); + return new_path; } #else #include #include -bool isExistOnFs(const UString & path) { +bool isExistOnFs(const UString & path) +{ struct stat buf; return (stat(path.toLocal8Bit(), &buf) == 0); } -bool makeDirectory(const UString & dir) { +bool makeDirectory(const UString & dir) +{ return (mkdir(dir.toLocal8Bit(), ACCESSPERMS) == 0); } -void removeDirectory(const UString & dir) { - rmdir(dir.toLocal8Bit()); +bool removeDirectory(const UString & dir) +{ + return (rmdir(dir.toLocal8Bit()) == 0); } -bool changeDirectory(const UString & dir) { +bool changeDirectory(const UString & dir) +{ return (chdir(dir.toLocal8Bit()) == 0); } UString getAbsPath(const UString & path) { char abs[PATH_MAX] = {}; - // Last is a non-standard extension for non-existent files. + // Last is a non-standard extension for non-existent files if (realpath(path.toLocal8Bit(), abs) || abs[0] != '\0') return UString(abs); return path; diff --git a/common/filesystem.h b/common/filesystem.h index 2101809..fbad5f3 100644 --- a/common/filesystem.h +++ b/common/filesystem.h @@ -14,15 +14,14 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #ifndef FILESYSTEM_H #define FILESYSTEM_H -#include "basetypes.h" #include "ustring.h" #include "ubytearray.h" bool isExistOnFs(const UString& path); bool makeDirectory(const UString& dir); bool changeDirectory(const UString& dir); -void removeDirectory(const UString& dir); +bool removeDirectory(const UString& dir); +bool readFileIntoBuffer(const UString& inPath, UByteArray& buf); UString getAbsPath(const UString& path); -USTATUS readFileIntoBuffer(const UString& inPath, UByteArray& buf); #endif diff --git a/common/guids.csv b/common/guids.csv index 444c948..da2ee91 100644 --- a/common/guids.csv +++ b/common/guids.csv @@ -212,6 +212,7 @@ 054F2504-E2BC-4641-83FC-502588FE1F28,CpuInitDxe 0559E886-AC78-4BCC-899A-E7830B5D6462,SystemSmbiosBcpSmm 0565365C-2FE1-4F88-B3BE-624C04623A20,MicrocodeUpdateDxe +0565963B-3DFD-4712-9CFD-614C5EDBE592,MsiBoardPei 056623DC-1285-4EAF-9446-75C3B00F78C6,FchMultiFchDxe 05687F4A-3CA7-4D19-9BC5-E180CEA3569F,AmiPlatformSecurityChipGuid 056BCA18-2F19-41EE-84EA-83746CB5069A,CrystalRidgeSMM @@ -326,6 +327,7 @@ 085DDD80-CE41-4FA8-B298-6071E8F62BC5,SmcOobPlatformPolicyDxe 085E8CC2-8EC9-4666-BD2A-49D481E95FA7,FjEvteLaunch 086147FA-4C0D-4781-AD27-0A3725F03F2B,DxeDg2OpregionInit +0872E0A5-6D38-4567-964C-7A3B48053A4F,FdmInitDxe 08747359-BA88-42F8-9D25-F71D93B6CD26,EcFlashSmm 087568D7-5A70-4DDC-84FD-92E358E7BF2C,NvmePciHcPei 087E9760-1FB5-49F7-879A-853D2B214CC7,LenovoSlp2Dxe @@ -553,6 +555,7 @@ 0DED86EE-6E79-4764-AA83-37A472F48123,ChkrecoveryFile 0E00B084-2D16-4A27-B172-B1F68C2CC55D,MicrocodeUpdates 0E06A80E-D726-4BAF-A0CF-211260FE69D8,OemSSIDUpdate +0E109C7B-8790-4B9D-981C-9D4B079E98D4,MsiSGSmm 0E135E4D-E63E-45C6-A9A2-E9363477DDFC,AmdNbioBaseMdnDxe 0E1B2F3C-DD5F-44CE-8D37-5AEC2B339B5C,BiosConnectSOSLauncher 0E1D2972-65AF-4AC1-BFA3-CEF4AB0C38FE,EfiCapsuleCrashGuid @@ -645,6 +648,7 @@ 1015EA63-7421-417D-BB51-E5193061C551,DxeIpmiUsb 10164673-D365-4BE2-8513-1497CC07611D,ScPolicyPpiGuid 102287B4-6B12-4D41-91E1-EBEE1F3AA614,UefiDebugLibDebugPortProtocol +1034183F-AF0A-4716-BE0E-4CB5319D6193,PciHotPlugNonRpDxe 1051EC65-F6FC-41EA-BA51-344C37F60CDF,BoardConfigInitPreMem 105884E1-57DA-4F36-9104-8D092339D234,DellThermInfoConfigDxe 105FF0EA-A0C0-48A8-B8F7-E8B4D62A1019,FmpAuthenticationLibRsa2048Sha256 @@ -1478,6 +1482,7 @@ 2515F54F-3277-47DA-86A5-484510DD08E1,AmdPspDxeV2Mdn 25247A74-9440-47D5-BF0A-ED92A4D6EBA4,DellComputraceBinary 2525B0F0-80C2-4AF7-BC68-3BE4BB42C11E,PermanentlyDisabled +2525C3F2-E255-4375-A7C9-92D1054D62B8,MsiBoardECPei 252E599F-D604-4BEA-8FEB-347668E93B8F,FjRTS54xx 25330D5D-5474-4EB8-8192-E6DE3D5ED0B6,DellVariable2Smm 253E85E9-993B-439B-B74C-6120F77B4723,PlatformReset @@ -1689,6 +1694,7 @@ 2A0168CC-4320-452F-BACA-8BAEC7DAFBCA,AmdI2CMasterPei 2A1961E8-099E-4701-AEE0-F58C1ECF5B11,FjMiscControlSmm 2A197802-E469-4FA7-A37B-2D681BCF416F,TrackPointElan +2A1A6774-328D-4C58-9F30-019EFF54F9B2,MSIInBIOSFlash 2A1E1C92-AABA-4D62-AC40-F3A4C3387356,PeiSmbusLibSmbus2Ppi 2A205AA9-F7EA-47BE-B3BD-7631E99B4351,G3WakeupPei 2A2997C0-FC32-4098-A88D-0E5D7165C93F,ThermalSetting @@ -1855,6 +1861,7 @@ 2DF5E0F8-469F-4730-983E-A7520FCF7108,CsmLoader 2DF61403-C180-45A5-A22B-1A3DB88FE9BA,DellGenericSioDxe 2DF6BA0B-7092-440D-BD04-FB091EC3F3C1,EdkiiPlatformSpecificResetHandlerProtocol +2DFE2E00-2CE9-4122-9B1F-DC5A6454C8AD,FixedFlashInfo 2E058B2B-EDC1-4431-87D9-C6C4EA102BE3,ScNvsAreaProtocolGuid 2E0F6A1D-B08E-456D-8815-77AEF39D4941,OemSlic 2E1128A1-18EC-419D-A058-1076E243E323,HpSioSecuritySmmProtocol @@ -2118,6 +2125,7 @@ 3417B225-916A-49F5-9AF5-C9C7BF937EA2,EfiMemoryMapDataHobBdat 34199FAA-81FC-44A2-9E66-56E2B18A1338,DashIoCfgPolicy 3423D855-3419-4D5D-B9EA-6C339FACBBE6,HPWMI +342414B7-0CDA-4BCD-9681-314FB865657D,MsiMeUpdateControl 343FF38A-32E2-48B3-910F-37E7FE9EF72E,MeCapsuleDxe 3458636B-9A94-44E7-BCA9-F8DFA1F5D894,LenovoSecureWipeLoader 345ECC0E-0CB6-4B75-BB57-1B129C47333E,EfiPlatformToDriverConfigurationClpGuid @@ -2290,6 +2298,7 @@ 3876F590-7AC6-4E0C-82EF-7B9A8A7B8DC9,GpioPolicyPei 38802700-868A-4B4E-81D4-4F1BDCCFB46F,EfiExtendedSalSst 388278D3-7B85-42F0-ABA9-FB4BFD69F5AB,EfiBluetoothIoServiceBindingProtocolGuid +3885474D-8395-4AAB-8AA4-3743CE287646,FnWinKeySwap 38871BF0-C64A-4896-B8E4-62D4850C7E68,DellOemSxSmm 38871BF0-C64A-4896-B8E4-62D7750C7D68,DellAcLossSmm 389244DB-3D6E-4E50-835D-5A775A325D89,LenovoMx25L64XflashPartDxe @@ -2334,6 +2343,7 @@ 398262C1-5165-4725-87FC-BB786A972582,IchPowerButton 39882267-CE96-4F37-A3EB-00B03BA4FC55,EcSecureFlashSmm 39968AEF-54B2-42BF-8E3F-DF0B70A49356,OemGigaLanDriver +3999379D-F9CB-4EF2-BD0E-F241FF804628,RTS52xx 399A229D-F654-4CEF-9ED3-6FC3C992E311,PciDxeInit 399A229D-F654-4CEF-9ED3-6FC3C992E39C,PciDxeInit 399CF3A7-82C7-4D9B-9123-DB11842986D3,DpcDxe @@ -2357,6 +2367,7 @@ 39F5FC8B-F34D-4256-8689-DA3A44580544,DellNbEcSmm 39F62CCE-6825-4669-BB56-541ABA753A07,EfiGraphicsInfoHobGuid 39FD1631-64CB-410C-874D-240F88AED5F1,IGD +3A05D1CE-E283-4738-88C9-D152F335C0DC,MSIFreeDOS 3A09E64D-08A9-42D5-8234-1127E6AF05EB,SioPowerButtonOverrideSmm 3A18A5AF-F25B-42EE-8606-8D30A974916B,PasswordEncodeSmmProtocol 3A29DD19-2C84-4A70-9A01-FBDDAFFB6461,DellMemoryS4 @@ -2537,6 +2548,7 @@ 3E20BE3F-F9B0-460B-B43D-ECC3497D7BC7,DellSoftTAADxe 3E26A614-09F7-486A-A88F-A99BF15E1FA1,LenovoPcdInit 3E2F4F05-26FA-490F-AC3B-351BAF08B28D,ArmaniSxCallback +3E3066C0-BD31-4ADB-B2A4-6E6654C7B81F,LenovoEventLogSelfhealingEvent 3E3099F5-CBCC-4AE8-AEA0-2B7D1E7F8294,LpssDxe 3E35C163-4074-45DD-431E-23989DD86B32,EfiHttpUtilitiesProtocolGuid 3E405418-0D8C-4F1A-B055-BEF90841468D,TcoWdtHob @@ -2676,6 +2688,7 @@ 41AA21FB-7B8F-46D2-B726-C1BC5FE65243,HpSmbiosDoneDxe 41B13735-0E0A-4F67-96D1-B15DA28205FA,SIOBasicIODXE 41B168D3-7C13-430C-BFEE-B438C2795C1F,SmmWhea +41CF3880-0560-4D01-8624-3A0A47894574,DetectDevice 41D94CD2-35B6-455A-8258-D4E51334AADD,EfiIp4ProtocolGuid 41E26B9C-ADA6-45B3-808E-2357A35B60D6,ArmBootMonFsFileInfoGuid 41E2F0CE-238A-4906-AEF8-37C531ADDF89,ThermalModePei @@ -3343,6 +3356,7 @@ 520C3847-71A0-40E7-A895-8C8997C33455,AmdMemFeatPei 520F9C58-9F9D-48C6-A0A0-D9FE6D8FDE77,LenovoTdtAm 5210F89F-899E-4075-81F9-35594E77CB9D,CcgOnlyPei +5215290B-7FE9-44D4-8DDB-251166EEBE7F,OemMonotonicDxe 522670C3-3D4E-4EC3-8A83-34467DAFE4BA,SmmSxDispatch2OnSmmSxDispatchThunk 52272F15-C22F-4B53-830A-FBEF9C3F643B,RealtekLan 5229AE5A-AB8E-4693-A8FD-B7D7CBCE694C,PTSataController @@ -3405,6 +3419,7 @@ 53984C6A-1B4A-4174-9512-A65E5BC8B278,PlatformStage1 539A558A-C4C7-4978-B52D-1492415EF64D,RomDataMigration 539D8AAD-C6AC-426C-B61F-228E6D1501B6,LenovoHpmDxe +53A3CB31-7E97-4512-B2EB-BFA0AB8FD75A,DeviceDetect 53A4BF3F-82A4-4758-8A08-7EDD2EDFF2B5,PlatformEmmcController 53A4C71B-B581-4170-91B3-8DB87A4B5C46,EfiFvbExtensionProtocol 53A58D06-AC27-4D8C-B5E9-F08A80654170,EfiExtendedSalStallServicesProtocolGuid @@ -3796,6 +3811,7 @@ 5D8AFDDF-5C95-4DA5-BB46-832F0D4BBC76,HpGraphicalFontSubComp 5D9498AB-959E-4E6F-8C0B-8691C029B71C,OobMsmDxeDriver 5D9516D3-BC49-4337-9FC7-29DF3526EC87,EfiPeiPlatformTypeLightningRidgeEX8S2NPpi +5D9631B7-578B-43E0-9EFC-EB2C20124801,SkipPlatformAuth 5D9F96DB-E731-4CAA-A00D-72E187CD7762,EfiEapProtocolGuid 5DA9E544-DC2D-4670-A3D5-985236D5DE45,DellHotSosSmmDriver 5DAA4237-0031-4B0B-967C-74477129D6F0,H19CheckPointMultiThreaing @@ -4547,10 +4563,12 @@ 7064F130-846E-4CE2-83C1-4BBCBCBF1AE5,AppleBootPolicy 706B0EFA-8768-44B6-8CB2-469B47A80C47,LenovoFidoCp 706C1E0C-44FC-4012-9B71-3DBFEC762F35,PlatformFlashSmm +70718A53-E05E-41A4-8420-378BEA75951F,ClickBiosUiSimple 7076876E-80C2-4EE6-AAD2-28B349A6865B,EfiCertX509Sha384Guid 707B3C6E-99A6-4E17-84A0-40284C1B3F38,LenovoPiSaveStateAccess 707BE83E-0BF6-40A5-BE64-34C03AA0B8E2,EfiSmbusArpMapGuid 7081E22F-CAC6-4053-9468-675782CF88E5,EfiEventDxeDispatchGuid +70858A67-D4D5-4632-BF0E-D18E2C29C550,DTBTPEI 70995504-D7AA-4BBA-803A-A3A9C729A37E,DellSmmDpstProtocol 709E6472-1BCD-43BD-8B6B-CD2D6D08B967,AcpiAtd 70A4D159-1F01-4203-A598-7C2794151CE6,EfiOsBootOptionNames @@ -4896,6 +4914,7 @@ 7958EB26-C098-46EC-B5B7-BE9FF13F8E32,DellBoardPolicyPei 7979919A-3D8D-4BB5-B832-45CC4FC7DE57,DellDptfPolicyProtocol 797A72A9-EAE3-495E-995D-A20D85F509AB,PreserveHobVariablesToNvram +7982477A-B285-42E8-B22D-A30E7E3CFE26,Dispatcher 79839D38-DD05-489C-B3EF-F27BDA08E572,AmiAgesaSxSmi 798B3F5F-F5FE-4AE7-9E85-D71613D8CFFC,KEMaEAPI 798E722E-15B2-4E13-8AE9-6BA30FF7F167,IntelSmbiosDataHobGuid @@ -4962,6 +4981,7 @@ 7AD33249-4BC9-4D31-9855-06D3A8C052A0,WlanControllerSmm 7AD9BAE7-864D-4F7E-9D11-1CAD8018FE7A,LenovoTpmFwUpdateSmm 7ADBAD98-7FE1-4774-9260-747327435E6D,SpsAcpiHooks +7AE1026D-C7FA-4867-9C14-A00534A6C547,DMIRecovery 7AE3CEB7-2EE2-48FA-AA49-3510BC83CABF,PeiSeCPlatformPolicyPpiGuid 7AF77F94-4C38-4FF1-8CCD-3E084F2FFEC0,SkylakeGraphics 7AFFD257-51D0-439A-A89A-85A3419308E4,DellJSONParserDriver @@ -5013,6 +5033,7 @@ 7C04A583-9E3E-4F1C-AD65-E05268D0B4D1,FullShell 7C069ADA-DE4E-488C-B0FC-4F2E057D96D8,DUFontDriver 7C095EED-C8DE-49BD-90D4-6C9A3A3BE9C3,DellRmtPlatSiSmm +7C0C91D4-63DF-4AB4-AD2E-B01C6DF3E07B,OemStandaloneDxe 7C0D8842-B2D7-4E06-863D-F84218013BC7,LenovoPttPolicyDxe 7C245213-345E-44EF-9FD3-7B6DA92AA499,UsbPortDisableOverrideDxe 7C257A30-F8BA-404A-8476-666F9E19BC56,GabiSettingItemCallbackDxe @@ -5020,6 +5041,7 @@ 7C2D1E53-E565-47EA-8A1E-DC97459926B0,OemServiceSmm 7C2E0E5E-7C35-4611-BC93-036013EDBE3D,AsusWmiAtkDxeSmmCoreBin 7C2E2D27-E8BD-4F5C-A569-AF65B77AA55D,DellPttSetupDxe +7C2E3F7B-A17A-4070-AE83-13FF416F62B2,MsiBoardNvs 7C347F9B-6FAE-45A5-906E-F8DFEBEE64FF,DellWmiSecurityMgr 7C380900-1B96-4615-978E-89E02E2C89D0,DebugDriverDxe 7C46C6A4-362F-4964-AF20-9333E552DCC3,PciHotPlug @@ -5183,6 +5205,7 @@ 80A29A57-BF37-4403-B7B0-D654E84F8A6D,PchInitDxeEhl 80AADD0D-8053-4BA7-941B-36F48BB23001,DellSystemPwSmm 80B08E6A-C6CE-430F-9C07-52A9526DB0F9,CompalWSMTDxe +80B33A95-B978-434A-9195-3C118E9F35CB,MsiBoardSmm 80BD20ED-46AC-4F66-ACBA-9A1658DB1830,AcerSystemStatusProtocol 80C905A4-1E0C-47F2-8417-977FB539C06F,PowerButton 80CF7257-87AB-47F9-A3FE-D50B76D89541,PcdDxe @@ -6595,6 +6618,7 @@ A3922B1A-35E4-4132-9CED-91D38D7171D8,FpgaSocketPkgList A3979E64-ACE8-4DDC-BC07-4D66B8FD0977,EfiIpSec2ProtocolGuid A3A209D9-2DE3-403B-9C6C-DB3CDC5ECFCD,LnvSolPei A3AD355A-13D0-4DCF-9C21-3D2C5F1BAD5F,FboGroupForm +A3AEC012-9A26-4AA5-986C-004423E43975,SnapshotLite A3B3D093-1B04-45BF-8D23-2334607C7B40,PlatformDeepS5 A3B3E6F8-EFCA-4BC1-88FB-CB87339B2579,EfiKmsFormatGeneric160Guid A3BC19A6-3572-4AF4-BCE4-CD43A8D1F6AF,ASUSITEBS @@ -6888,6 +6912,7 @@ AAF32C78-947B-439A-A180-2E144EC37792,EfiAuthenticatedVariableGuid AAF691F4-9851-4120-8A43-1129B2829899,FjDtPowerFailureRecoveryPlatformDxe AAF875D2-0968-4585-A40A-B35C9FE0CAEC,AodSmmZp AB1404CA-4801-4208-98BF-30D521DAD4D3,AmiTseUserPasswordValidGuid +AB189162-6DB5-4EFC-AC59-D0B3CC851119,OemEarlyPei AB1C1816-D542-4E6F-9B1E-8ECD9253E2E7,ArmGlobalVariablePpiGuid AB21ACC3-BA33-EE2C-66BC-125677111AB2,AmiDebuggerCpuProtocol AB226E66-31D8-4613-879D-D2FAB610263C,EdkiiDynamicTablesPkgTokenSpace @@ -7068,6 +7093,7 @@ AF43E178-C2E9-4712-A7CD-08BFDAC7482C,UfsPciHcDxe AF4A1998-4949-4545-9C4C-C1E7C042E056,ScPcieDeviceTablePpiGuid AF4CC162-D41C-455A-AB45-6DBCC1CD32F3,LpssDummyProtocolGuid AF4F281F-519F-4A39-8182-4B053D429874,DellTpmBusConfigDxe +AF525A5E-183E-4309-9E49-EA22CF412EAE,MsiBoardECSmm AF56054C-8B1A-409F-BAF0-893CB964AA4E,FjSysmanWatchdogPeiBin AF59F2F5-5E28-4E03-80E2-4727545AF811,PchReset AF5B3C56-95E6-4434-9373-39BB718ACD00,DellFmpInterface @@ -7433,6 +7459,7 @@ B7F50E91-A759-412C-ADE4-DCD03E7F7C28,XhciDxe B7FC8359-5175-457C-B591-8AE8FDC47605,UsbOcUpdateDxeEVB B80764EF-4E70-419E-9FF7-A98910504B90,PS8625PeiPkg B8167809-E73A-4387-8323-0AFE83D3074F,SmmAslSmiProtocol +B8192EAD-CB81-4712-AC86-CA44D1B19265,DisableUsbSmiMode B81A9587-D1D1-418E-CCCF-508DAFCE4D8C,GraphicsConfigurationDefaultsSmm B81BFAB0-0EB3-4CF9-8465-7FA986361664,EfiUfsDeviceConfigProtocolGuid B831F761-ACBB-49B7-A5D4-EF4B77502A9E,SmbiosDataUpdateDxeBlizzard @@ -8237,6 +8264,7 @@ CD167C1E-6E0B-42B3-82F6-E3E906199810,FspReadyForNotifyPhasePpi CD1B61E8-C6B4-420D-A1C5-2A75083CB0A6,FjMasterPasswordSmm CD1C556B-62BF-4EEC-8E73-7731F8E847B2,AmdCpmGpioInitSmm CD2333D7-6A0A-4C76-8350-240ADA36A2C7,DxePlatformSaPolicy +CD26C70C-F69D-419C-AE25-50E844D1DAE8,RtkMAPT CD28DACA-BDBE-481A-90AC-625C79CF234C,H19BIOSLock CD2B6EB3-EA11-4848-B687-AFE57D3D1C0F,ApplePpiPlatformInfoDB CD31F8A8-28A6-4E49-8B3E-4142BD006C41,MeUlvCheckDxe @@ -8304,6 +8332,7 @@ CEA4FF9C-D7BC-4F07-96F1-03F41F2B17AE,BaseFspDebugLibSerialPort CEAB683C-EC56-4A2D-A906-4053FA4E9C16,EfiTemporaryRamDonePpiGuid CEB0203C-DE91-4ECE-A95F-0217E959E191,SystemSecureFlashAuthenticationDxe CEB7FE23-21A1-4B5C-8E92-2E7B52A95076,Legacy8259 +CEB904D8-DE67-4286-8D3F-2259E6B781B8,UsbPowerShare CED4EAC6-49F3-4C12-A597-FC8C33447691,PeimBoardInitPreMem CED56284-CDAC-499C-9FED-69A944CE26CD,EcIoPeim CEE19373-FB2A-4B8E-BEF5-B6D7731F4939,I2cBus @@ -8783,6 +8812,7 @@ DB3FC2DF-7376-4A8D-82AB-9154A136A65A,UniversalPayloadPlatformBootManagerOverride DB41E01B-A8B0-4E15-B619-4463975B357B,SetupDataChecksumErr DB47D7D3-FE81-11D3-9A35-0090273FC14D,EfiFileSystemVolumeLabelInfoIdGuid DB4DB11A-0E5C-40B5-8E46-17D04486A21B,LenovoMx25L64XflashPartSmm +DB4DC31F-F307-4D6A-A347-180FD27EC10A,MsiTouchPanel DB4E8151-57ED-4BED-8833-6751B5D1A8D7,ConnectConInEventGuid DB551771-4449-4387-908D-F70685B1DCAF,PlatformMilestoneHookSmm DB63592C-B8CC-44C8-918C-51F534598A5A,PchResetProtocolGuid @@ -8885,6 +8915,7 @@ DDCBCFBA-8EEB-488A-96D6-097831A6E50B,HashLibBaseCryptoRouterPei DDCF3616-3275-4164-98B6-FE85707FFE7D,EfiVariableInfoGuid DDE1BC72-D45E-4209-AB85-14462D2F5074,RomImageAddress DDE31574-3589-4FA9-BC69-1729AF6FDA4E,AmiNvramUpdateProtocolGuid +DDED691E-0495-45DB-ADFF-D68452C9A5A4,Float DDEF12C9-944D-4757-A3EC-CCFBADA96DD2,DellFlashBios DDFB5557-3E2E-4569-B459-BEFFE189B8B0,AmiSmbiosFlashDataProtocolGuid DE0EE9A4-3C7A-44F2-B78B-E3CCD69C3AF7,EfiExtendedSalBootServiceProtocolGuid @@ -9080,6 +9111,7 @@ E2347FA9-FD73-4165-B15C-C4665A259E53,AmtGbeChecksum E234A986-8946-485D-A645-C806225F0213,BiosDiags_2_0 E23F86E1-056E-4888-B685-CFCD67C179D4,SbRun E2441B64-7EF4-41FE-B3A3-8CAA7F8D3017,PciPlatform +E252C258-C839-48CF-A85C-E8F4C3235BDA,OemApVariable E2657A19-7CD8-5389-98BC-6E201BBF4F70,MonacoFont2x E269AC86-6049-4509-8D16-8899DA529BBB,PeiCmosInit E273212C-11D9-4728-B1AC-B6EE5083EED6,TbtRetimerCapsule1Dxe @@ -9375,6 +9407,7 @@ E9D7735D-06E2-47B7-B856-2A20138FAEA4,FchHuashanSmmInit E9DB0D58-D48D-47F6-9C6E-6F40E86C7B41,PeiTpmInitializedPpiGuid E9DD7F62-25EC-4F9D-A4AB-AAD20BF59A10,StatusCodePei E9DEB2B3-88E4-46D2-B9A4-F60CACB918DC,SmcRiserCardPei +E9E59DF7-5D38-4097-90D5-8379E9A262EA,MsiSG E9EC9168-1065-4F90-8C44-C1413AAAE43F,ODMAdminPasswordCheckVariable E9F02217-2093-4470-8A54-5C2CFFE73ECB,EfiSpiSmmHcProtocolGuid E9F05D70-9946-4AB9-A7F7-070E92C415BD,Int15BootTV @@ -9951,6 +9984,7 @@ F7B0E92D-AB47-4A1D-8BDE-41E529EB5A70,H19UnlockPswd F7B87A79-A640-4AA5-8C1E-453FB26EF376,EfiPeiPlatformTypeBuchananPassPpi F7CA7568-5A09-4D2C-8A9B-758468592AE2,AmiNvramControlProtocolGuid F7CAAF4A-B2DD-431A-8964-375D7E71B9B1,SMBIOSTypeDAhCallingInterfaceSmm +F7CAD0AB-DFA4-40D2-8AFA-B7A8BE017031,MsiBoardEC F7D19491-EA53-970D-5508-75ACDFA41974,SbSocBristolDxe F7D22BCA-1BCA-5591-CC8B-1CA98F2890FE,AmiCpuS3Pei F7D6D25E-6243-4D5C-9BA5-C2DC48F003B0,AmiFlashLibPei @@ -9989,6 +10023,7 @@ F8626165-6CEB-924A-BAFC-F13AB9D65728,EmuSystemConfigGuid F866226A-EAA5-4F5A-A90A-6CFBA57C588E,SmmPerformanceProtocolGuid F866AD0F-1FBB-4D52-813D-7EB95E2F19D4,menu_mid_right F8673422-16DE-449C-8728-AB0361DBF9F0,LegacyInterruptHookDxe +F872A62B-3151-4F39-805E-5702CE1F7504,MsiPtpTouchPad F8775D50-8ABD-4ADF-92AC-853E51F6C8DC,IoMmuAbsentProtocol F87A3D1B-B0C3-44B6-B470-F4F4C09C110C,AsusQuickVgaPei F880AAE0-E4AC-4C64-A326-82709CC241EA,UsbDbg @@ -10044,6 +10079,7 @@ FA177FF7-1FC7-458D-A358-D9D62AE61CEC,PeimEntryPoint FA1B2631-91C4-43F0-BA91-AFBFC7452087,DellEnhancedVersionDxe FA20568B-548B-4B2B-81EF-1BA08D4A3CEC,BootScriptExecutorDxe FA2338AD-80DF-49D0-9396-CF7145D03A76,TxtOneTouchOpProtocol +FA2ED6B0-F606-4450-B4F1-4ED34A17E076,MsiBoardDxe FA327F24-2DE2-4B60-871A-436BC90605D4,LEMComputraceApiDxe FA3AD693-D58A-4619-960B-8EE85C914870,PeiPciLibPciCfg2 FA3CDE4C-87C2-427D-AEDE-7DD096C88C58,IscsiV4Private diff --git a/common/ustring.h b/common/ustring.h index 4100b13..c143df4 100644 --- a/common/ustring.h +++ b/common/ustring.h @@ -13,8 +13,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #ifndef USTRING_H #define USTRING_H -#include "basetypes.h" - #if defined (QT_CORE_LIB) // Use Qt class, if Qt is available #include @@ -27,6 +25,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #define UString CBString #endif // QT_CORE_LIB +#if defined(__clang__) || defined(__GNUC__) +#define ATTRIBUTE_FORMAT_(t,f,a) __attribute__((format(t, f, a))) +#else +#define ATTRIBUTE_FORMAT_(t,f,a) +#endif + UString usprintf(const char* fmt, ...) ATTRIBUTE_FORMAT_(printf, 1, 2); UString urepeated(char c, int len); UString uFromUcs2(const char* str, size_t max_len = 0);