From nobody Sat Nov 2 16:24:37 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1485942581299893.9980625140722; Wed, 1 Feb 2017 01:49:41 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id E4DB581F87; Wed, 1 Feb 2017 01:49:33 -0800 (PST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 1244681FAB for ; Wed, 1 Feb 2017 01:49:31 -0800 (PST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP; 01 Feb 2017 01:49:30 -0800 Received: from mdkinney-mobl.amr.corp.intel.com ([10.254.89.179]) by fmsmga005.fm.intel.com with ESMTP; 01 Feb 2017 01:49:30 -0800 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,319,1477983600"; d="scan'208";a="59876493" From: Michael Kinney To: edk2-devel@lists.01.org Date: Wed, 1 Feb 2017 01:49:10 -0800 Message-Id: <1485942552-47388-5-git-send-email-michael.d.kinney@intel.com> X-Mailer: git-send-email 2.6.3.windows.1 In-Reply-To: <1485942552-47388-1-git-send-email-michael.d.kinney@intel.com> References: <1485942552-47388-1-git-send-email-michael.d.kinney@intel.com> Subject: [edk2] [staging/edk2-test PATCH V2 4/6] TestFrameworkPkg: Fix GCC compatibility issues X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Fish MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Cc: Andrew Fish Cc: Supreeth Venkatesh Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney --- TestFrameworkPkg/Eftp/ComponentName.c | 4 + TestFrameworkPkg/Eftp/EftpDriver.h | 5 + TestFrameworkPkg/Eftp/EftpMain.c | 2 + TestFrameworkPkg/Eftp/EftpPacket.c | 2 - TestFrameworkPkg/Eftp/EftpRRQ.c | 13 +- TestFrameworkPkg/Eftp/EftpRRQ.h | 8 +- TestFrameworkPkg/Eftp/EftpWRQ.c | 7 +- TestFrameworkPkg/Eftp/EftpWRQ.h | 2 + TestFrameworkPkg/Include/Library/EntsLib.h | 225 ------- TestFrameworkPkg/Include/Protocol/WBTest.h | 84 --- TestFrameworkPkg/Include/Protocol/WbTest.h | 84 +++ TestFrameworkPkg/InstallSct/InstallSct.c | 15 +- TestFrameworkPkg/Library/EasLib/EntsContext.c | 83 +-- TestFrameworkPkg/Library/EasLib/EntsDpath.c | 60 +- TestFrameworkPkg/Library/EasLib/EntsGuid.c | 113 ++-- TestFrameworkPkg/Library/EasLib/EntsLib.c | 21 +- TestFrameworkPkg/Library/EasLib/EntsLib.inf | 1 + TestFrameworkPkg/Library/EasLib/EntsStr.c | 690 -----------------= ---- TestFrameworkPkg/Library/EasLib/EntsSupport.c | 11 +- TestFrameworkPkg/Library/EasLib/EntsTime.c | 2 +- TestFrameworkPkg/Library/EfiTestLib/EfiTestLib.c | 4 + .../IP4NetworkMonitor/IP4NetworkMonitor.c | 30 +- .../IP4NetworkMonitor/IP4NetworkMonitor.h | 8 +- .../ManagedNetworkMonitor/ManagedNetworkMonitor.c | 25 +- .../ManagedNetworkMonitor/ManagedNetworkMonitor.h | 6 + .../PeiSctManageModule/PeiSctManageModule.c | 15 +- TestFrameworkPkg/Sct/Core/SctInit.c | 2 - TestFrameworkPkg/Sct/Data/TestCaseEx.c | 2 - TestFrameworkPkg/Sct/Data/TestNode.c | 2 - TestFrameworkPkg/Sct/ENTS/EasDispatcher/Core/Eas.c | 3 - .../Sct/ENTS/EasDispatcher/Exec/EasCmdDisp.c | 3 +- .../Sct/ENTS/EasDispatcher/Rivl/RivlType.c | 8 +- .../Sct/ENTS/EasDispatcher/Rivl/RivlVariable.c | 9 +- TestFrameworkPkg/Sct/Execute/Execute.c | 5 - TestFrameworkPkg/Sct/Execute/ExecuteSupport.c | 1 + TestFrameworkPkg/Sct/Execute/ExecuteSupport.h | 1 + TestFrameworkPkg/Sct/Include/SctCore.h | 1 + TestFrameworkPkg/Sct/Include/SctDef.h | 2 +- TestFrameworkPkg/Sct/Misc/SctMisc.c | 2 +- TestFrameworkPkg/Sct/UI/BuildMenu.c | 2 + TestFrameworkPkg/Sct/UI/BuildMenu.h | 11 +- TestFrameworkPkg/Sct/UI/ConfigMenu.c | 23 +- TestFrameworkPkg/Sct/UI/Dialog.h | 2 +- TestFrameworkPkg/Sct/UI/DisplayUi.c | 14 +- TestFrameworkPkg/Sct/UI/FileDialog.c | 2 - TestFrameworkPkg/Sct/UI/FileDialog.h | 2 +- TestFrameworkPkg/Sct/UI/KeyFunction.c | 18 + TestFrameworkPkg/Sct/UI/LogFileDialog.c | 4 +- TestFrameworkPkg/Sct/UI/LogFileDialog.h | 2 +- TestFrameworkPkg/Sct/UI/MainMenu.c | 18 + TestFrameworkPkg/Sct/UI/TestNodeMenu.c | 12 + TestFrameworkPkg/Sct/UI/TestNodeMenu.h | 2 +- TestFrameworkPkg/Sct/UI/UI.h | 16 + .../Support/StandardTest/StandardTest.c | 34 +- TestFrameworkPkg/Support/TestLogging/TestLogging.c | 17 +- TestFrameworkPkg/Support/TestProfile/TestProfile.c | 658 ++++++-----------= --- .../Support/TestProfile/TestProfile.inf | 1 + 57 files changed, 614 insertions(+), 1785 deletions(-) delete mode 100644 TestFrameworkPkg/Include/Protocol/WBTest.h create mode 100644 TestFrameworkPkg/Include/Protocol/WbTest.h diff --git a/TestFrameworkPkg/Eftp/ComponentName.c b/TestFrameworkPkg/Eftp/= ComponentName.c index 7956658..3ab1bfc 100644 --- a/TestFrameworkPkg/Eftp/ComponentName.c +++ b/TestFrameworkPkg/Eftp/ComponentName.c @@ -17,6 +17,7 @@ // EFI Component Name Functions // EFI_STATUS +EFIAPI EftpComponentNameGetDriverName ( IN EFI_COMPONENT_NAME2_PROTOCOL *This, IN CHAR8 *Language, @@ -24,6 +25,7 @@ EftpComponentNameGetDriverName ( ); =20 EFI_STATUS +EFIAPI EftpComponentNameGetControllerName ( IN EFI_COMPONENT_NAME2_PROTOCOL *= This, IN EFI_HANDLE C= ontrollerHandle, @@ -53,6 +55,7 @@ static EFI_UNICODE_STRING_TABLE mEftpDriverNameTable[] = =3D { }; =20 EFI_STATUS +EFIAPI EftpComponentNameGetDriverName ( IN EFI_COMPONENT_NAME2_PROTOCOL *This, IN CHAR8 *Language, @@ -94,6 +97,7 @@ EftpComponentNameGetDriverName ( } =20 EFI_STATUS +EFIAPI EftpComponentNameGetControllerName ( IN EFI_COMPONENT_NAME2_PROTOCOL *= This, IN EFI_HANDLE C= ontrollerHandle, diff --git a/TestFrameworkPkg/Eftp/EftpDriver.h b/TestFrameworkPkg/Eftp/Eft= pDriver.h index a6fac3f..4bcefbe 100644 --- a/TestFrameworkPkg/Eftp/EftpDriver.h +++ b/TestFrameworkPkg/Eftp/EftpDriver.h @@ -80,6 +80,7 @@ typedef struct _EFTP_SERVICE_BINDING_PRIVATE { } EFTP_SERVICE_BINDING_PRIVATE; =20 EFI_STATUS +EFIAPI EftpDriverBindingSupported ( IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, @@ -106,6 +107,7 @@ Returns: ; =20 EFI_STATUS +EFIAPI EftpDriverBindingStart ( IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, @@ -133,6 +135,7 @@ Returns: ; =20 EFI_STATUS +EFIAPI EftpDriverBindingStop ( IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, @@ -160,6 +163,7 @@ EftpDriverBindingStop ( ; =20 EFI_STATUS +EFIAPI EftpServiceBindingCreateChild ( IN EFI_SERVICE_BINDING_PROTOCOL *This, IN OUT EFI_HANDLE *ChildHandle @@ -185,6 +189,7 @@ Returns: ; =20 EFI_STATUS +EFIAPI EftpServiceBindingDestroyChild ( IN EFI_SERVICE_BINDING_PROTOCOL *This, IN EFI_HANDLE ChildHandle diff --git a/TestFrameworkPkg/Eftp/EftpMain.c b/TestFrameworkPkg/Eftp/EftpM= ain.c index f9e84c5..e88dfe8 100644 --- a/TestFrameworkPkg/Eftp/EftpMain.c +++ b/TestFrameworkPkg/Eftp/EftpMain.c @@ -458,6 +458,7 @@ CleanUp: } =20 EFI_STATUS +EFIAPI EftpReadFile ( IN EFI_EFTP_PROTOCOL *This, IN EFI_EFTP_TOKEN *Token @@ -581,6 +582,7 @@ Returns: } =20 EFI_STATUS +EFIAPI EftpConfigure ( IN EFI_EFTP_PROTOCOL *This, IN EFI_EFTP_CONFIG_DATA *EftpConfigData // OPTIONAL diff --git a/TestFrameworkPkg/Eftp/EftpPacket.c b/TestFrameworkPkg/Eftp/Eft= pPacket.c index 1c813f0..f403e4a 100644 --- a/TestFrameworkPkg/Eftp/EftpPacket.c +++ b/TestFrameworkPkg/Eftp/EftpPacket.c @@ -565,7 +565,6 @@ Returns: EFI_EFTP_PACKET *Packet; EFI_STATUS Status; UINT32 Len; - CHAR8 *P; =20 ASSERT (Private && Err); =20 @@ -581,7 +580,6 @@ Returns: } =20 Packet =3D Buf->Packet; - P =3D AsciiStrCpy (Packet->Error.ErrorMessage, Err->Desc); =20 Status =3D gBS->CreateEvent ( EVT_NOTIFY_SIGNAL, diff --git a/TestFrameworkPkg/Eftp/EftpRRQ.c b/TestFrameworkPkg/Eftp/EftpRR= Q.c index 9c6d952..4bf15f7 100644 --- a/TestFrameworkPkg/Eftp/EftpRRQ.c +++ b/TestFrameworkPkg/Eftp/EftpRRQ.c @@ -55,6 +55,7 @@ EftpListIntegrityCheck ( =20 STATIC VOID +EFIAPI EftpRrqTxCallback ( IN EFI_EVENT Event, IN VOID *Context @@ -156,6 +157,7 @@ Returns: } =20 VOID +EFIAPI EftpRrqRxCallback ( IN EFI_EVENT Event, IN VOID *Context @@ -527,6 +529,7 @@ Returns: } =20 VOID +EFIAPI EftpRrqTimer ( IN EFI_EVENT Event, IN VOID *Context @@ -664,6 +667,7 @@ Returns: =20 STATIC VOID +EFIAPI EftpRrqTxCallback ( IN EFI_EVENT Event, IN VOID *Context @@ -763,7 +767,6 @@ Returns: =20 --*/ { - EFTP_OPTION *Opt; EFTP_RRQ_STATE *Rrq; EFTP_PACKET_BUFFER *Buf; BOOLEAN Copy; @@ -773,7 +776,6 @@ Returns: ASSERT (Private && Private->RrqState && Packet); =20 Rrq =3D Private->RrqState; - Opt =3D &Private->Option; =20 // // Ignore the data packet with wrong opcode @@ -1081,6 +1083,7 @@ Returns: =20 STATIC VOID +EFIAPI EftpRrqInitTimer ( IN EFI_EVENT Event, IN VOID *Context @@ -1203,8 +1206,6 @@ Returns: =20 --*/ { - EFTP_OPTION *Opt; - EFTP_RRQ_STATE *Rrq; EFTP_PACKET_BUFFER *Buf; EFTP_ERRINFO Err; EFI_STATUS Status; @@ -1213,9 +1214,6 @@ Returns: =20 ASSERT (Private && Private->RrqState && Packet); =20 - Rrq =3D Private->RrqState; - Opt =3D &Private->Option; - // // Ignore the data packet with wrong opcode // @@ -1503,6 +1501,7 @@ Returns: =20 STATIC VOID +EFIAPI EftpRrqActiveTimer ( IN EFI_EVENT Event, IN VOID *Context diff --git a/TestFrameworkPkg/Eftp/EftpRRQ.h b/TestFrameworkPkg/Eftp/EftpRR= Q.h index 16008f9..6bb6c85 100644 --- a/TestFrameworkPkg/Eftp/EftpRRQ.h +++ b/TestFrameworkPkg/Eftp/EftpRRQ.h @@ -146,6 +146,7 @@ Returns: ; =20 VOID +EFIAPI EftpRrqRxCallback ( IN EFI_EVENT Event, IN VOID *Context @@ -169,7 +170,12 @@ Returns: --*/ ; =20 -VOID EftpRrqTimer (IN EFI_EVENT Event, IN VOID *Context) +VOID +EFIAPI +EftpRrqTimer ( + IN EFI_EVENT Event, + IN VOID *Context + ) /*++ =20 Routine Description: diff --git a/TestFrameworkPkg/Eftp/EftpWRQ.c b/TestFrameworkPkg/Eftp/EftpWR= Q.c index 495b2a2..10d38a1 100644 --- a/TestFrameworkPkg/Eftp/EftpWRQ.c +++ b/TestFrameworkPkg/Eftp/EftpWRQ.c @@ -16,6 +16,7 @@ =20 STATIC VOID +EFIAPI EftpWrqTxCallback ( IN EFI_EVENT Event, IN VOID *Context @@ -143,6 +144,7 @@ Returns: } =20 VOID +EFIAPI EftpWrqRxCallback ( IN EFI_EVENT Event, IN VOID *Context @@ -400,6 +402,7 @@ CleanUp: =20 STATIC VOID +EFIAPI EftpWrqTxCallback ( IN EFI_EVENT Event, IN VOID *Context @@ -472,6 +475,7 @@ Returns: } =20 VOID +EFIAPI EftpWrqTimer ( IN EFI_EVENT Event, IN VOID *Context @@ -654,7 +658,6 @@ Returns: --*/ { EFI_STATUS Status; - EFTP_OPTION *Opt; UINT64 AckNo; EFTP_ERRINFO Err; EFTP_PACKET_BUFFER *Buf; @@ -662,8 +665,6 @@ Returns: =20 ASSERT (Private && Private->WrqState && Packet); =20 - Opt =3D &Private->Option; - // // Ignore the ACK packet with wrong opcode // diff --git a/TestFrameworkPkg/Eftp/EftpWRQ.h b/TestFrameworkPkg/Eftp/EftpWR= Q.h index 55585e2..4201bf9 100644 --- a/TestFrameworkPkg/Eftp/EftpWRQ.h +++ b/TestFrameworkPkg/Eftp/EftpWRQ.h @@ -67,6 +67,7 @@ Returns: ; =20 VOID +EFIAPI EftpWrqRxCallback ( IN EFI_EVENT Event, IN VOID *Context @@ -113,6 +114,7 @@ Returns: ; =20 VOID +EFIAPI EftpWrqTimer ( IN EFI_EVENT Event, IN VOID *Context diff --git a/TestFrameworkPkg/Include/Library/EntsLib.h b/TestFrameworkPkg/= Include/Library/EntsLib.h index 03cfcab..c324765 100644 --- a/TestFrameworkPkg/Include/Library/EntsLib.h +++ b/TestFrameworkPkg/Include/Library/EntsLib.h @@ -247,29 +247,6 @@ EntsStrDuplicate ( ) ; =20 -INTN -EntsLibStubStriCmp ( - IN EFI_UNICODE_COLLATION_PROTOCOL *This, - IN CHAR16 *s1, - IN CHAR16 *s2 - ) -; - -VOID -EntsLibStubStrLwrUpr ( - IN EFI_UNICODE_COLLATION_PROTOCOL *This, - IN CHAR16 *Str - ) -; - -BOOLEAN -EntsLibStubMetaiMatch ( - IN EFI_UNICODE_COLLATION_PROTOCOL *This, - IN CHAR16 *String, - IN CHAR16 *Pattern - ) -; - EFI_STATUS Char16ToChar8 ( IN CHAR16 *Src, @@ -361,23 +338,6 @@ strtok_line ( ; =20 CHAR16 * -strtok_arg ( - CHAR16 *s, - const CHAR16 *ct - ) -/*++ - -Routine Description: - - Find the next token in a string - Tokens are separated by separators defined in "ct" - If enclosed in double quotations, other separators are invalid. Then tok= en is - the content in the quotations. - ---*/ -; - -CHAR16 * strtok_field ( CHAR16 *s, const CHAR16 *ct @@ -406,30 +366,6 @@ EntsHexStrToUINTN ( ; =20 EFI_STATUS -EntsStrToValue ( - IN CHAR16 *Buffer, - OUT UINTN *Value - ) -/*++ - -Routine Description: - - Convert a string to a value. - -Arguments: - - Buffer - String buffer. - Value - Pointer to receive the converted value. - -Returns: - - EFI_INVALID_PARAMETER - Parameter invalid. - EFI_SUCCESS - Operation succeeded. - ---*/ -; - -EFI_STATUS EntsValueToStr ( IN UINTN Value, OUT CHAR16 *Buffer @@ -453,103 +389,6 @@ Returns: --*/ ; =20 -EFI_STATUS -EntsHexValueToStr ( - IN UINTN Value, - OUT CHAR16 *Buffer - ) -/*++ - -Routine Description: - - Convert a hexadecimal value to a string. - -Arguments: - - Value - Value to be converted. - Buffer - Pointer to string receive buffer. - -Returns: - - EFI_INVALID_PARAMETER - Parameter invalid. - EFI_SUCCESS - Operation succeeded. - ---*/ -; - -EFI_STATUS -EntsStrToHexValue ( - IN CHAR16 *Buffer, - OUT UINTN *Value - ) -/*++ - -Routine Description: - - Convert a string to a hexadecimal value. - -Arguments: - - Buffer - String buffer to be converted. - Value - Receive value pointer. - -Returns: - - EFI_INVALID_PARAMETER - Parameter invalid. - EFI_SUCCESS - Operation succeeded. - ---*/ -; - -EFI_STATUS -EntsBooleanToStr ( - IN BOOLEAN Value, - OUT CHAR16 *Buffer - ) -/*++ - -Routine Description: - - Convert a boolean to a string. - -Arguments: - - Value - Boolean value. - Buffer - Receive string buffer. - -Returns: - - EFI_INVALID_PARAMETER - Parameter invalid. - EFI_SUCCESS - Operation succeeded. - ---*/ -; - -EFI_STATUS -EntsStrToBoolean ( - IN CHAR16 *Buffer, - OUT BOOLEAN *Value - ) -/*++ - -Routine Description: - - Convert a string to a boolean. - -Arguments: - - Buffer - String buffer to be converted. - Value - Receive value pointer. - -Returns: - - EFI_INVALID_PARAMETER - Parameter invalid. - EFI_UNSUPPORTED - String not supported. - EFI_SUCCESS - Operation succeeded. - ---*/ -; - BOOLEAN EntsStrBeginWith ( IN CHAR16 *Str, @@ -581,12 +420,6 @@ Returns: --*/ ; =20 -CHAR16 * -EntsStrChr ( - IN CHAR16 *Str, - IN CHAR16 c - ); - UINTN EntsStrStr ( IN CHAR16 *Str, @@ -611,70 +444,12 @@ Returns: --*/ ; =20 -UINTN -HexStringToValue ( - IN CHAR16 *String, - IN UINTN Length - ) -/*++ - -Routine Description: - - Convert a hex string to a value. - -Arguments: - - String - Hex string buffer. - Length - Hex string length. - -Returns: - - Converted value. - ---*/ -; - INTN a2i ( IN CHAR16 Ch ) ; =20 -CHAR16 -i2A ( - UINTN x - ) -; - -CHAR16 -i2a ( - UINTN x - ) -; - -EFI_STATUS -EntsIpToStr ( - IN EFI_IP_ADDRESS *IpAddr, - IN UINTN StrSize, - IN OUT CHAR16 *Str - ) -; - -EFI_STATUS -EntsStrToMac ( - IN CHAR16 *Str, - IN OUT EFI_MAC_ADDRESS *MacAddr - ) -; - -EFI_STATUS -EntsMacToStr ( - IN EFI_MAC_ADDRESS *MacAddr, - IN UINTN StrSize, - IN OUT CHAR16 *Str - ) -; - EFI_STATUS EntsTimeToStr ( IN EFI_TIME *Time, diff --git a/TestFrameworkPkg/Include/Protocol/WBTest.h b/TestFrameworkPkg/= Include/Protocol/WBTest.h deleted file mode 100644 index b85b6ae..0000000 --- a/TestFrameworkPkg/Include/Protocol/WBTest.h +++ /dev/null @@ -1,84 +0,0 @@ -/** @file - This file defines the EFI White-Box Test Protocol. - - Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
- This program and the accompanying materials - are licensed and made available under the terms and conditions of the BS= D License - which accompanies this distribution. The full text of the license may b= e found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. - -**/ - -#ifndef _EFI_WB_TEST_H_ -#define _EFI_WB_TEST_H_ - -// -// Includes -// -#include - -// -// EFI White-Box Test Protocol Definitions -// - -#define EFI_WB_TEST_GUID \ - { 0x0B486CED, 0x25EB, 0x448a, {0xB2, 0xB2, 0x22, 0x4E, 0x7A, 0x20, 0xCF,= 0x57 } } - -#define EFI_WB_TEST_REVISION 0x00010000 - -// -// Forward reference for pure ANSI compatibility -// -typedef struct _EFI_WB_TEST_ENTRY EFI_WB_TEST_ENTRY; -typedef struct _EFI_WB_TEST_PROTOCOL EFI_WB_TEST_PROTOCOL; - -// -// EFI White-Box Test Entry Point -// - -typedef -EFI_STATUS -(EFIAPI *EFI_WB_ENTRY_POINT) ( - IN EFI_WB_TEST_PROTOCOL *This, - IN EFI_TEST_LEVEL TestLevel, - IN EFI_HANDLE SupportHandle - ); - -// -// EFI White-Box Test Entry -// - -struct _EFI_WB_TEST_ENTRY { - EFI_WB_TEST_ENTRY *Next; - EFI_GUID EntryId; - CHAR16 *Name; - CHAR16 *Description; - EFI_TEST_LEVEL TestLevelSupportMap; - EFI_GUID *SupportProtocols; - EFI_TEST_ATTRIBUTE CaseAttribute; - EFI_WB_ENTRY_POINT EntryPoint; -} ; - -// -// EFI White-Box Test Protocol -// - -struct _EFI_WB_TEST_PROTOCOL { - UINT64 TestRevision; - EFI_GUID CategoryGuid; - EFI_HANDLE ClientHandle; - CHAR16 *Name; - CHAR16 *Description; - EFI_WB_TEST_ENTRY *EntryList; -}; - -// -// Global ID for EFI White-Box Test Protocol -// - -extern EFI_GUID gEfiWbTestGuid; - -#endif diff --git a/TestFrameworkPkg/Include/Protocol/WbTest.h b/TestFrameworkPkg/= Include/Protocol/WbTest.h new file mode 100644 index 0000000..b85b6ae --- /dev/null +++ b/TestFrameworkPkg/Include/Protocol/WbTest.h @@ -0,0 +1,84 @@ +/** @file + This file defines the EFI White-Box Test Protocol. + + Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
+ This program and the accompanying materials + are licensed and made available under the terms and conditions of the BS= D License + which accompanies this distribution. The full text of the license may b= e found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + +**/ + +#ifndef _EFI_WB_TEST_H_ +#define _EFI_WB_TEST_H_ + +// +// Includes +// +#include + +// +// EFI White-Box Test Protocol Definitions +// + +#define EFI_WB_TEST_GUID \ + { 0x0B486CED, 0x25EB, 0x448a, {0xB2, 0xB2, 0x22, 0x4E, 0x7A, 0x20, 0xCF,= 0x57 } } + +#define EFI_WB_TEST_REVISION 0x00010000 + +// +// Forward reference for pure ANSI compatibility +// +typedef struct _EFI_WB_TEST_ENTRY EFI_WB_TEST_ENTRY; +typedef struct _EFI_WB_TEST_PROTOCOL EFI_WB_TEST_PROTOCOL; + +// +// EFI White-Box Test Entry Point +// + +typedef +EFI_STATUS +(EFIAPI *EFI_WB_ENTRY_POINT) ( + IN EFI_WB_TEST_PROTOCOL *This, + IN EFI_TEST_LEVEL TestLevel, + IN EFI_HANDLE SupportHandle + ); + +// +// EFI White-Box Test Entry +// + +struct _EFI_WB_TEST_ENTRY { + EFI_WB_TEST_ENTRY *Next; + EFI_GUID EntryId; + CHAR16 *Name; + CHAR16 *Description; + EFI_TEST_LEVEL TestLevelSupportMap; + EFI_GUID *SupportProtocols; + EFI_TEST_ATTRIBUTE CaseAttribute; + EFI_WB_ENTRY_POINT EntryPoint; +} ; + +// +// EFI White-Box Test Protocol +// + +struct _EFI_WB_TEST_PROTOCOL { + UINT64 TestRevision; + EFI_GUID CategoryGuid; + EFI_HANDLE ClientHandle; + CHAR16 *Name; + CHAR16 *Description; + EFI_WB_TEST_ENTRY *EntryList; +}; + +// +// Global ID for EFI White-Box Test Protocol +// + +extern EFI_GUID gEfiWbTestGuid; + +#endif diff --git a/TestFrameworkPkg/InstallSct/InstallSct.c b/TestFrameworkPkg/In= stallSct/InstallSct.c index b6a2298..e4d9654 100644 --- a/TestFrameworkPkg/InstallSct/InstallSct.c +++ b/TestFrameworkPkg/InstallSct/InstallSct.c @@ -152,7 +152,6 @@ RemoveDirFile ( IN CHAR16 *Path ) { - EFI_STATUS Status; EFI_STATUS ExecuteStatus; CHAR16 *CmdLine; =20 @@ -175,13 +174,13 @@ RemoveDirFile ( // Execute this shell command // Print (L"ShellExecute %s\n", CmdLine); - Status =3D ShellExecute ( - &gImageHandle, - CmdLine, - FALSE, - NULL, - &ExecuteStatus - ); + ShellExecute ( + &gImageHandle, + CmdLine, + FALSE, + NULL, + &ExecuteStatus + ); if (EFI_ERROR (ExecuteStatus)) { Print (L"Error: Could not execute \"%s\"\n", CmdLine); } diff --git a/TestFrameworkPkg/Library/EasLib/EntsContext.c b/TestFrameworkP= kg/Library/EasLib/EntsContext.c index 0433877..f3072a3 100644 --- a/TestFrameworkPkg/Library/EasLib/EntsContext.c +++ b/TestFrameworkPkg/Library/EasLib/EntsContext.c @@ -94,65 +94,6 @@ _RecordListPrint( #define RecordListPrint(RecordList) #endif =20 -/*--------------------------Internal string library function--------------= -------------*/ -STATIC -UINTN -strlen( - CHAR8 *str - ) -{ - CHAR8 *s; - - for (s =3D str; *s; ++s) - ; - return (UINTN)(s - str); -} - -STATIC -CHAR8 * -strcpy( - CHAR8 *to, - CHAR8 *from - ) -{ - CHAR8 *save; - - save =3D to; - for (; (*to =3D *from) !=3D 0 ; ++from, ++to) - ; - return(save); -} - -STATIC -INTN -strcmp( - CHAR8 *s1, - CHAR8 *s2 - ) -{ - while (*s1 =3D=3D *s2++) { - if (*s1++ =3D=3D 0) - return 0; - } - return (*s1 - *s2 - 1); -} - -STATIC -CHAR8 * -strchr ( - CHAR8 *p, - INTN ch - ) -{ - for (; ; ++p) { - if (*p =3D=3D ch) - return((CHAR8 *)p); - if (!*p) - return((CHAR8 *)NULL); - } - /* NOTREACHED */ -} - /*------------------------------------------------------------------------= -------------*/ STATIC EFI_STATUS @@ -188,7 +129,7 @@ ParseRecordLine ( VOID *ValueBuf; UINTN ValueSize; =20 - TmpStr =3D strchr(LineBuf, '|'); + TmpStr =3D AsciiStrStr(LineBuf, "|"); if (TmpStr =3D=3D NULL) { return EFI_INVALID_PARAMETER; } @@ -197,7 +138,7 @@ ParseRecordLine ( if (KeyBuf =3D=3D NULL) { return EFI_OUT_OF_RESOURCES; } - strcpy (KeyBuf, LineBuf); + AsciiStrCpy (KeyBuf, LineBuf); TmpStr++; CopyMem(&ValueSize, TmpStr, sizeof(UINTN)); ValueBuf =3D (VOID *)AllocateZeroPool (ValueSize); @@ -347,8 +288,8 @@ WriteRecordsToFile( FileHandle =3D Context->FileHandle; =20 for (Record =3D RecordListHead; Record !=3D NULL; Record =3D Record->Nex= t) { - strcpy(Buffer, Record->Key); - Index =3D strlen(Record->Key); + AsciiStrCpy(Buffer, Record->Key); + Index =3D AsciiStrLen(Record->Key); Buffer[Index++] =3D '|'; CopyMem(Buffer + Index, &Record->Size, sizeof(UINTN)); Index +=3D sizeof(UINTN); @@ -385,7 +326,7 @@ SetRecord ( } =20 for (Record =3D RecordListHead; Record !=3D NULL; Record =3D Record->Nex= t) { - if (strcmp(Key, Record->Key) =3D=3D 0) { + if (AsciiStrCmp(Key, Record->Key) =3D=3D 0) { break; } } @@ -400,7 +341,7 @@ SetRecord ( Status =3D EFI_OUT_OF_RESOURCES; goto FreeAndReturn; } - KeyBuf =3D (CHAR8 *)AllocateZeroPool (strlen(Key) + 1); + KeyBuf =3D (CHAR8 *)AllocateZeroPool (AsciiStrLen(Key) + 1); if (KeyBuf =3D=3D NULL) { FreePool(Record); Status =3D EFI_OUT_OF_RESOURCES; @@ -413,7 +354,7 @@ SetRecord ( Status =3D EFI_OUT_OF_RESOURCES; goto FreeAndReturn; } - strcpy(KeyBuf, Key); + AsciiStrCpy(KeyBuf, Key); CopyMem(ValueBuf, RecordValue, RecordSize); Record->Key =3D KeyBuf; Record->Size =3D RecordSize; @@ -476,7 +417,7 @@ GetRecord ( // the records in the list are same as the ones in file // for (Record =3D RecordListHead; Record !=3D NULL; Record =3D Record->Nex= t) { - if (strcmp(Record->Key, Key) =3D=3D 0) { + if (AsciiStrCmp(Record->Key, Key) =3D=3D 0) { break; } } @@ -526,12 +467,12 @@ DelRecord ( if (RecordListHead =3D=3D NULL) { return EFI_NOT_FOUND; } else { - if (strcmp(Key, RecordListHead->Key) =3D=3D 0) { + if (AsciiStrCmp(Key, RecordListHead->Key) =3D=3D 0) { Record =3D RecordListHead; RecordListHead =3D RecordListHead->Next; } else { for (Record =3D RecordListHead; Record->Next !=3D NULL; Record =3D R= ecord->Next) { - if (strcmp(Key, Record->Next->Key) =3D=3D 0) { + if (AsciiStrCmp(Key, Record->Next->Key) =3D=3D 0) { break; } } @@ -872,11 +813,11 @@ SetContextRecord ( } =20 Unicode2Ascii(AsciiKey, Key); - if (strlen(AsciiKey) + Size + 1 > MAX_RECORD_LEN) { + if (AsciiStrLen(AsciiKey) + Size + 1 > MAX_RECORD_LEN) { return EFI_INVALID_PARAMETER; } =20 - if (strchr(AsciiKey, '=3D') !=3D NULL) { + if (AsciiStrStr(AsciiKey, "=3D") !=3D NULL) { EFI_ENTS_DEBUG((EFI_ENTS_D_ERROR, L"The KEY of record can not contain = =3D")); return EFI_INVALID_PARAMETER; } diff --git a/TestFrameworkPkg/Library/EasLib/EntsDpath.c b/TestFrameworkPkg= /Library/EasLib/EntsDpath.c index 1b44d5b..6a8abae 100644 --- a/TestFrameworkPkg/Library/EasLib/EntsDpath.c +++ b/TestFrameworkPkg/Library/EasLib/EntsDpath.c @@ -777,38 +777,38 @@ struct { UINT8 SubType; VOID (*Function) (ENTS_POOL_PRINT *, VOID *); } DevPathTable[] =3D { - HARDWARE_DEVICE_PATH, HW_PCI_DP, _DevPathPci, - HARDWARE_DEVICE_PATH, HW_PCCARD_DP, _DevPathPccard, - HARDWARE_DEVICE_PATH, HW_MEMMAP_DP, _DevPathMemMap, - HARDWARE_DEVICE_PATH, HW_VENDOR_DP, _DevPathVendor, - HARDWARE_DEVICE_PATH, HW_CONTROLLER_DP, _DevPathContro= ller, - ACPI_DEVICE_PATH, ACPI_DP, _DevPathAcpi, - ACPI_DEVICE_PATH, ACPI_EXTENDED_DP, _DevPathExtend= edAcpi, - ACPI_DEVICE_PATH, ACPI_ADR_DP, _DevPathAdrAcp= i, - MESSAGING_DEVICE_PATH, MSG_ATAPI_DP, _DevPathAtapi, - MESSAGING_DEVICE_PATH, MSG_SCSI_DP, _DevPathScsi, - MESSAGING_DEVICE_PATH, MSG_FIBRECHANNEL_DP, _DevPathFibre, - MESSAGING_DEVICE_PATH, MSG_1394_DP, _DevPath1394, - MESSAGING_DEVICE_PATH, MSG_USB_DP, _DevPathUsb, - MESSAGING_DEVICE_PATH, MSG_USB_CLASS_DP, _DevPathUsbCla= ss, - MESSAGING_DEVICE_PATH, MSG_I2O_DP, _DevPathI2O, - MESSAGING_DEVICE_PATH, MSG_MAC_ADDR_DP, _DevPathMacAdd= r, - MESSAGING_DEVICE_PATH, MSG_IPv4_DP, _DevPathIPv4, - MESSAGING_DEVICE_PATH, MSG_IPv6_DP, _DevPathIPv6, - MESSAGING_DEVICE_PATH, MSG_INFINIBAND_DP, _DevPathInfini= Band, - MESSAGING_DEVICE_PATH, MSG_UART_DP, _DevPathUart, - MESSAGING_DEVICE_PATH, MSG_VENDOR_DP, _DevPathVendor, - MEDIA_DEVICE_PATH, MEDIA_HARDDRIVE_DP, _DevPathHardDr= ive, - MEDIA_DEVICE_PATH, MEDIA_CDROM_DP, _DevPathCDROM, - MEDIA_DEVICE_PATH, MEDIA_VENDOR_DP, _DevPathVendor, - MEDIA_DEVICE_PATH, MEDIA_FILEPATH_DP, _DevPathFilePa= th, - MEDIA_DEVICE_PATH, MEDIA_PROTOCOL_DP, _DevPathMediaP= rotocol, + { HARDWARE_DEVICE_PATH, HW_PCI_DP, _DevPathPci}, + { HARDWARE_DEVICE_PATH, HW_PCCARD_DP, _DevPathPcca= rd}, + { HARDWARE_DEVICE_PATH, HW_MEMMAP_DP, _DevPathMemM= ap}, + { HARDWARE_DEVICE_PATH, HW_VENDOR_DP, _DevPathVend= or}, + { HARDWARE_DEVICE_PATH, HW_CONTROLLER_DP, _DevPathCont= roller}, + { ACPI_DEVICE_PATH, ACPI_DP, _DevPathAcpi= }, + { ACPI_DEVICE_PATH, ACPI_EXTENDED_DP, _DevPathExte= ndedAcpi}, + { ACPI_DEVICE_PATH, ACPI_ADR_DP, _DevPathAdrA= cpi}, + { MESSAGING_DEVICE_PATH, MSG_ATAPI_DP, _DevPathAtap= i}, + { MESSAGING_DEVICE_PATH, MSG_SCSI_DP, _DevPathScsi= }, + { MESSAGING_DEVICE_PATH, MSG_FIBRECHANNEL_DP, _DevPathFibr= e}, + { MESSAGING_DEVICE_PATH, MSG_1394_DP, _DevPath1394= }, + { MESSAGING_DEVICE_PATH, MSG_USB_DP, _DevPathUsb}, + { MESSAGING_DEVICE_PATH, MSG_USB_CLASS_DP, _DevPathUsbC= lass}, + { MESSAGING_DEVICE_PATH, MSG_I2O_DP, _DevPathI2O}, + { MESSAGING_DEVICE_PATH, MSG_MAC_ADDR_DP, _DevPathMacA= ddr}, + { MESSAGING_DEVICE_PATH, MSG_IPv4_DP, _DevPathIPv4= }, + { MESSAGING_DEVICE_PATH, MSG_IPv6_DP, _DevPathIPv6= }, + { MESSAGING_DEVICE_PATH, MSG_INFINIBAND_DP, _DevPathInfi= niBand}, + { MESSAGING_DEVICE_PATH, MSG_UART_DP, _DevPathUart= }, + { MESSAGING_DEVICE_PATH, MSG_VENDOR_DP, _DevPathVend= or}, + { MEDIA_DEVICE_PATH, MEDIA_HARDDRIVE_DP, _DevPathHard= Drive}, + { MEDIA_DEVICE_PATH, MEDIA_CDROM_DP, _DevPathCDRO= M}, + { MEDIA_DEVICE_PATH, MEDIA_VENDOR_DP, _DevPathVend= or}, + { MEDIA_DEVICE_PATH, MEDIA_FILEPATH_DP, _DevPathFile= Path}, + { MEDIA_DEVICE_PATH, MEDIA_PROTOCOL_DP, _DevPathMedi= aProtocol}, #if (EFI_SPECIFICATION_VERSION < 0x00020000) - MEDIA_DEVICE_PATH, MEDIA_FV_FILEPATH_DP, _DevPathFvFile= Path, + { MEDIA_DEVICE_PATH, MEDIA_FV_FILEPATH_DP, _DevPathFvFi= lePath}, #endif - BBS_DEVICE_PATH, BBS_BBS_DP, _DevPathBssBss, - END_DEVICE_PATH_TYPE, END_INSTANCE_DEVICE_PATH_SUBTYPE, _DevPathEndIns= tance, - 0, 0, NULL + { BBS_DEVICE_PATH, BBS_BBS_DP, _DevPathBssB= ss}, + { END_DEVICE_PATH_TYPE, END_INSTANCE_DEVICE_PATH_SUBTYPE, _DevPathEndI= nstance}, + { 0, 0, NULL} }; =20 UINTN diff --git a/TestFrameworkPkg/Library/EasLib/EntsGuid.c b/TestFrameworkPkg/= Library/EasLib/EntsGuid.c index 3e02e69..0bd8bc3 100644 --- a/TestFrameworkPkg/Library/EasLib/EntsGuid.c +++ b/TestFrameworkPkg/Library/EasLib/EntsGuid.c @@ -17,27 +17,27 @@ =20 #define SHELL_INTERFACE_PROTOCOL \ { \ - 0x47c7b223, 0xc42a, 0x11d2, 0x8e, 0x57, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0= x3b \ + 0x47c7b223, 0xc42a, 0x11d2, {0x8e, 0x57, 0x0, 0xa0, 0xc9, 0x69, 0x72, = 0x3b} \ } =20 #define ENVIRONMENT_VARIABLE_ID \ { \ - 0x47c7b224, 0xc42a, 0x11d2, 0x8e, 0x57, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0= x3b \ + 0x47c7b224, 0xc42a, 0x11d2, {0x8e, 0x57, 0x0, 0xa0, 0xc9, 0x69, 0x72, = 0x3b} \ } =20 #define DEVICE_PATH_MAPPING_ID \ { \ - 0x47c7b225, 0xc42a, 0x11d2, 0x8e, 0x57, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0= x3b \ + 0x47c7b225, 0xc42a, 0x11d2, {0x8e, 0x57, 0x0, 0xa0, 0xc9, 0x69, 0x72, = 0x3b} \ } =20 #define PROTOCOL_ID_ID \ { \ - 0x47c7b226, 0xc42a, 0x11d2, 0x8e, 0x57, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0= x3b \ + 0x47c7b226, 0xc42a, 0x11d2, {0x8e, 0x57, 0x0, 0xa0, 0xc9, 0x69, 0x72, = 0x3b} \ } =20 #define ALIAS_ID \ { \ - 0x47c7b227, 0xc42a, 0x11d2, 0x8e, 0x57, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0= x3b \ + 0x47c7b227, 0xc42a, 0x11d2, {0x8e, 0x57, 0x0, 0xa0, 0xc9, 0x69, 0x72, = 0x3b} \ } =20 static EFI_GUID ShellInterfaceProtocol =3D SHELL_INTERFACE_PROTOCOL; @@ -51,72 +51,43 @@ struct { CHAR16 *GuidName; } EntsKnownGuids[] =3D { - &tNullGuid, - L"G0", - &tEfiGlobalVariable, - L"Efi", - - >EfiDevicePathProtocolGuid, - L"dpath", - >EfiLoadedImageProtocolGuid, - L"image", - >EfiSimpleTextInProtocolGuid, - L"txtin", - >EfiSimpleTextOutProtocolGuid, - L"txtout", - >EfiBlockIoProtocolGuid, - L"blkio", - >EfiDiskIoProtocolGuid, - L"diskio", - >EfiSimpleFileSystemProtocolGuid, - L"fs", - >EfiLoadFileProtocolGuid, - L"load", - >EfiDeviceIoProtocolGuid, - L"DevIo", - - &tGenericFileInfo, - L"GenFileInfo", - >EfiFileSystemInfoGuid, - L"FileSysInfo", - - >EfiUnicodeCollationProtocolGuid, - L"UnicodeCollation", - >EfiSerialIoProtocolGuid, - L"serialio", - >EfiSimpleNetworkProtocolGuid, - L"net", - >EfiNetworkInterfaceIdentifierProtocolGuid, - L"nii", - >EfiPxeBaseCodeProtocolGuid, - L"pxebc", - >EfiPxeCallbackProtocolGuid, - L"pxecb", - - &tPcAnsiProtocol, - L"PcAnsi", - &tVt100Protocol, - L"Vt100", - >EfiUnknownDeviceGuid, - L"Unknown Device", - - >EfiPartTypeSystemPartitionGuid, - L"ESP", - >EfiPartTypeLegacyMbrGuid, - L"GPT MBR", - - &ShellInterfaceProtocol, - L"ShellInt", - &SEnvId, - L"SEnv", - &SProtId, - L"ShellProtId", - &SMapId, - L"ShellDevPathMap", - &SAliasId, - L"ShellAlias", - - NULL + { &tNullGuid, L"G0"}, + { &tEfiGlobalVariable, L"Efi"}, + + { >EfiDevicePathProtocolGuid, L"dpath"}, + { >EfiLoadedImageProtocolGuid, L"image"}, + { >EfiSimpleTextInProtocolGuid, L"txtin"}, + { >EfiSimpleTextOutProtocolGuid, L"txtout"}, + { >EfiBlockIoProtocolGuid, L"blkio"}, + { >EfiDiskIoProtocolGuid, L"diskio"}, + { >EfiSimpleFileSystemProtocolGuid, L"fs"}, + { >EfiLoadFileProtocolGuid, L"load"}, + { >EfiDeviceIoProtocolGuid, L"DevIo"}, + + { &tGenericFileInfo, L"GenFileInfo"}, + { >EfiFileSystemInfoGuid, L"FileSysInfo"}, + + { >EfiUnicodeCollationProtocolGuid, L"UnicodeCollation"}, + { >EfiSerialIoProtocolGuid, L"serialio"}, + { >EfiSimpleNetworkProtocolGuid, L"net"}, + { >EfiNetworkInterfaceIdentifierProtocolGuid, L"nii"}, + { >EfiPxeBaseCodeProtocolGuid, L"pxebc"}, + { >EfiPxeCallbackProtocolGuid, L"pxecb"}, + + { &tPcAnsiProtocol, L"PcAnsi"}, + { &tVt100Protocol, L"Vt100"}, + { >EfiUnknownDeviceGuid, L"Unknown Device"}, + + { >EfiPartTypeSystemPartitionGuid, L"ESP"}, + { >EfiPartTypeLegacyMbrGuid, L"GPT MBR"}, + + { &ShellInterfaceProtocol, L"ShellInt"}, + { &SEnvId, L"SEnv"}, + { &SProtId, L"ShellProtId"}, + { &SMapId, L"ShellDevPathMap"}, + { &SAliasId, L"ShellAlias"}, + + { NULL, NULL} }; =20 VOID diff --git a/TestFrameworkPkg/Library/EasLib/EntsLib.c b/TestFrameworkPkg/L= ibrary/EasLib/EntsLib.c index 38300c2..97603c9 100644 --- a/TestFrameworkPkg/Library/EasLib/EntsLib.c +++ b/TestFrameworkPkg/Library/EasLib/EntsLib.c @@ -29,26 +29,13 @@ EFI_RUNTIME_SERVICES *gntRT =3D NULL; // EFI_MEMORY_TYPE EntsPoolAllocationType =3D EfiBootServices= Data; =20 -// -// Unicode collation functions that are in use -// -EFI_UNICODE_COLLATION_PROTOCOL EntsLibStubUnicodeInterface =3D { - EntsLibStubStriCmp, - EntsLibStubMetaiMatch, - EntsLibStubStrLwrUpr, - EntsLibStubStrLwrUpr, - NULL, // FatToStr - NULL, // StrToFat - NULL // SupportedLanguages -}; - -EFI_UNICODE_COLLATION_PROTOCOL *EntsUnicodeInterface =3D &EntsLibStubUnic= odeInterface; +EFI_UNICODE_COLLATION_PROTOCOL *EntsUnicodeInterface =3D NULL; =20 // // EFI IDs // EFI_GUID tEfiGlobalVariable =3D EFI_GLOBAL_VARIABL= E; -EFI_GUID tNullGuid =3D { 0, 0, 0, 0, 0, 0= , 0, 0, 0, 0, 0 }; +EFI_GUID tNullGuid =3D { 0, 0, 0, {0, 0, = 0, 0, 0, 0, 0, 0 }}; =20 // // Protocol IDs @@ -153,6 +140,10 @@ Returns: if (EFI_ERROR(Status)) { return Status; } + Status =3D gntBS->LocateProtocol(&gEfiUnicodeCollation2ProtocolGuid, N= ULL, (VOID**)&EntsUnicodeInterface); + if (EFI_ERROR(Status)) { + return Status; + } } =20 return EFI_SUCCESS; diff --git a/TestFrameworkPkg/Library/EasLib/EntsLib.inf b/TestFrameworkPkg= /Library/EasLib/EntsLib.inf index acdc0ad..d9f00ff 100644 --- a/TestFrameworkPkg/Library/EasLib/EntsLib.inf +++ b/TestFrameworkPkg/Library/EasLib/EntsLib.inf @@ -83,3 +83,4 @@ gEfiManagedNetworkProtocolGuid gEfiManagedNetworkServiceBindingProtocolGuid gEfiSimpleNetworkProtocolGuid + gEfiUnicodeCollation2ProtocolGuid diff --git a/TestFrameworkPkg/Library/EasLib/EntsStr.c b/TestFrameworkPkg/L= ibrary/EasLib/EntsStr.c index 1ba83a7..ed2e268 100644 --- a/TestFrameworkPkg/Library/EasLib/EntsStr.c +++ b/TestFrameworkPkg/Library/EasLib/EntsStr.c @@ -240,25 +240,6 @@ EntsStrDuplicate ( } =20 INTN -EntsLibStubStriCmp ( - IN EFI_UNICODE_COLLATION_PROTOCOL *This, - IN CHAR16 *s1, - IN CHAR16 *s2 - ) -{ - return StrCmp (s1, s2); -} - -VOID -EntsLibStubStrLwrUpr ( - IN EFI_UNICODE_COLLATION_PROTOCOL *This, - IN CHAR16 *Str - ) -{ - return; -} - -INTN EFIAPI StriCmp ( IN CHAR16 *s1, @@ -268,146 +249,6 @@ StriCmp ( return EntsUnicodeInterface->StriColl (EntsUnicodeInterface, s1, s2); } =20 -STATIC -BOOLEAN -MetaMatch ( - IN CHAR16 *String, - IN CHAR16 *Pattern - ) -{ - CHAR16 c; - - CHAR16 p; - - CHAR16 l; - - for (;;) { - p =3D *Pattern; - Pattern +=3D 1; - - switch (p) { - case 0: - // - // End of pattern. If end of string, TRUE match - // - return (BOOLEAN) (*String ? FALSE : TRUE); - - case '*': - // - // Match zero or more chars - // - while (*String) { - if (MetaMatch (String, Pattern)) { - return TRUE; - } - - String +=3D 1; - } - - return MetaMatch (String, Pattern); - - case '?': - // - // Match any one char - // - if (!*String) { - return FALSE; - } - - String +=3D 1; - break; - - case '[': - // - // Match char set - // - c =3D *String; - if (!c) { - return FALSE; - // - // syntax problem - // - } - - l =3D 0; - p =3D *Pattern++; - while (p) { - if (p =3D=3D ']') { - return FALSE; - } - - if (p =3D=3D '-') { - // - // if range of chars, - // - p =3D *Pattern; - // - // get high range - // - if (p =3D=3D 0 || p =3D=3D ']') { - return FALSE; - // - // syntax problem - // - } - - if (c >=3D l && c <=3D p) { - // - // if in range, - // - break; - // - // it's a match - // - } - } - - l =3D p; - if (c =3D=3D p) { - // - // if char matches - // - break; - // - // move on - // - } - - p =3D *Pattern++; - } - // - // skip to end of match char set - // - while (p && p !=3D ']') { - p =3D *Pattern; - Pattern +=3D 1; - } - - String +=3D 1; - break; - - default: - c =3D *String; - if (c !=3D p) { - return FALSE; - } - - String +=3D 1; - break; - } - } -} - -BOOLEAN -EntsLibStubMetaiMatch ( - IN EFI_UNICODE_COLLATION_PROTOCOL *This, - IN CHAR16 *String, - IN CHAR16 *Pattern - ) -{ - return MetaMatch (String, Pattern); -} - UINTN Atoi ( CHAR16 *str @@ -532,23 +373,6 @@ Returns: return EFI_SUCCESS; } =20 -CHAR16 * -EntsStrChr ( - IN CHAR16 *Str, - IN CHAR16 c - ) -{ - ASSERT (Str !=3D NULL); - - for (; *Str !=3D c; ++Str) { - if (*Str =3D=3D '\0') { - return NULL; - } - } - - return (CHAR16 *) Str; -} - UINTN EntsStrStr ( IN CHAR16 *Str, @@ -654,69 +478,6 @@ strtok_line ( } =20 CHAR16 * -strtok_arg ( - CHAR16 *s, - const CHAR16 *ct - ) -/*++ - -Routine Description: - - Find the next token in a string - Tokens are separated by separators defined in "ct" - If enclosed in double quotations, other separators are invalid. Then tok= en is - the content in the quotations. - ---*/ -{ - CHAR16 *sbegin; - - CHAR16 *send; - INT32 l; - - sbegin =3D s ? s : ___strtok_arg; - if (!sbegin) { - return NULL; - } - - sbegin +=3D strspn (sbegin, ct); - - // - // extract string enclosed in double quotation marks - // - if ((*sbegin =3D=3D '"') || (*sbegin =3D=3D 'L' && *(sbegin + 1) =3D=3D = '"')) { - l =3D (*sbegin =3D=3D 'L') ? 2 : 1; - sbegin +=3D l; - if (!sbegin) { - return NULL; - } - - send =3D strpbrk (sbegin, L"\""); - if (send && (*send !=3D '\0')) { - *send++ =3D '\0'; - } - - ___strtok_arg =3D send; - return sbegin - l; - } - // - // extract string separated per ct - // - if (*sbegin =3D=3D '\0') { - ___strtok_arg =3D NULL; - return NULL; - } - - send =3D strpbrk (sbegin, ct); - if (send && (*send !=3D '\0')) { - *send++ =3D '\0'; - } - - ___strtok_arg =3D send; - return sbegin; -} - -CHAR16 * strtok_field ( CHAR16 *s, const CHAR16 *ct @@ -819,44 +580,6 @@ Routine Description: return NULL; } =20 -EFI_STATUS -EntsStrToValue ( - IN CHAR16 *Buffer, - OUT UINTN *Value - ) -/*++ - -Routine Description: - - Convert a string to a value. - -Arguments: - - Buffer - String buffer. - Value - Pointer to receive the converted value. - -Returns: - - EFI_INVALID_PARAMETER - Parameter invalid. - EFI_SUCCESS - Operation succeeded. - ---*/ -{ - if ((Buffer =3D=3D NULL) || (Value =3D=3D NULL)) { - return EFI_INVALID_PARAMETER; - } - // - // Convert a string to a value - // - if (Buffer[0] =3D=3D L'-') { - *Value =3D (UINTN) (0 - Atoi (Buffer + 1)); - } else { - *Value =3D Atoi (Buffer); - } - - return EFI_SUCCESS; -} - INTN EntsStrToUINTN ( IN CHAR16 *Str, @@ -922,229 +645,6 @@ EntsHexStrToUINTN ( return Index; } =20 -EFI_STATUS -EntsHexValueToStr ( - IN UINTN Value, - OUT CHAR16 *Buffer - ) -/*++ - -Routine Description: - - Convert a hexadecimal value to a string. - -Arguments: - - Value - Value to be converted. - Buffer - Pointer to string receive buffer. - -Returns: - - EFI_INVALID_PARAMETER - Parameter invalid. - EFI_SUCCESS - Operation succeeded. - ---*/ -{ - if (Buffer =3D=3D NULL) { - return EFI_INVALID_PARAMETER; - } - // - // Convert a value to a string - // - EntsSPrint (Buffer, 0, L"0x%x", Value); - - return EFI_SUCCESS; -} - -EFI_STATUS -EntsStrToHexValue ( - IN CHAR16 *Buffer, - OUT UINTN *Value - ) -/*++ - -Routine Description: - - Convert a string to a hexadecimal value. - -Arguments: - - Buffer - String buffer to be converted. - Value - Receive value pointer. - -Returns: - - EFI_INVALID_PARAMETER - Parameter invalid. - EFI_SUCCESS - Operation succeeded. - ---*/ -{ - CHAR16 c; - - if ((Buffer =3D=3D NULL) || (Value =3D=3D NULL)) { - return EFI_INVALID_PARAMETER; - } - // - // skip preceeding white space - // - while (*Buffer && *Buffer =3D=3D ' ') { - Buffer +=3D 1; - } - // - // skip preceeding zeros - // - while (*Buffer && *Buffer =3D=3D '0') { - Buffer +=3D 1; - } - // - // skip preceeding white space - // - if (*Buffer && (*Buffer =3D=3D 'x' || *Buffer =3D=3D 'X')) { - Buffer +=3D 1; - } - - *Value =3D 0; - c =3D *(Buffer++); - while (c) { - if (c >=3D 'a' && c <=3D 'f') { - c -=3D 'a' - 'A'; - } - - if ((c >=3D '0' && c <=3D '9') || (c >=3D 'A' && c <=3D 'F')) { - *Value =3D *Value << 4 | c - (c >=3D 'A' ? 'A' - 10 : '0'); - } else { - break; - } - - c =3D *(Buffer++); - } - - return EFI_SUCCESS; -} - -EFI_STATUS -EntsBooleanToStr ( - IN BOOLEAN Value, - OUT CHAR16 *Buffer - ) -/*++ - -Routine Description: - - Convert a boolean to a string. - -Arguments: - - Value - Boolean value. - Buffer - Receive string buffer. - -Returns: - - EFI_INVALID_PARAMETER - Parameter invalid. - EFI_SUCCESS - Operation succeeded. - ---*/ -{ - if (Buffer =3D=3D NULL) { - return EFI_INVALID_PARAMETER; - } - // - // Convert a boolean to a string - // - if (Value) { - StrCpy (Buffer, L"True"); - } else { - StrCpy (Buffer, L"False"); - } - - return EFI_SUCCESS; -} - -EFI_STATUS -EntsStrToBoolean ( - IN CHAR16 *Buffer, - OUT BOOLEAN *Value - ) -/*++ - -Routine Description: - - Convert a string to a boolean. - -Arguments: - - Buffer - String buffer to be converted. - Value - Receive value pointer. - -Returns: - - EFI_INVALID_PARAMETER - Parameter invalid. - EFI_UNSUPPORTED - String not supported. - EFI_SUCCESS - Operation succeeded. - ---*/ -{ - if ((Buffer =3D=3D NULL) || (Value =3D=3D NULL)) { - return EFI_INVALID_PARAMETER; - } - - if (StriCmp (Buffer, L"True") =3D=3D 0) { - *Value =3D TRUE; - } else if (StriCmp (Buffer, L"False") =3D=3D 0) { - *Value =3D FALSE; - } else { - return EFI_UNSUPPORTED; - } - - return EFI_SUCCESS; -} - -BOOLEAN -EntStrBeginWith ( - IN CHAR16 *Str, - IN CHAR16 *SubStr - ) -/*++ - -Routine Description: - - Test if the string is begin with the sub string. - -Arguments: - - Str - The pointer to the string being tested - SubStr - The pointer to the sub string - -Returns: - - TRUE - The Str is begin with SubStr. - FALSE - The Str not begin with SubStr. - ---*/ -{ - CHAR16 *Temp; - - if ((Str =3D=3D NULL) || (SubStr =3D=3D NULL) || (StrLen (Str) < StrLen = (SubStr))) { - return FALSE; - } - // - // Remove the pre-space characters - // - Temp =3D SubStr; - - while (*Temp =3D=3D L' ') { - Temp =3D Temp + 1; - } - // - // Compare - // - if (StrnCmp (Str, Temp, StrLen (Temp)) =3D=3D 0) { - return TRUE; - } else { - return FALSE; - } -} - BOOLEAN EntsStrEndWith ( IN CHAR16 *Str, @@ -1222,48 +722,6 @@ Returns: return EFI_SUCCESS; } =20 -UINTN -HexStringToValue ( - IN CHAR16 *String, - IN UINTN Length - ) -/*++ - -Routine Description: - - Convert a hex string to a value. - -Arguments: - - String - Hex string buffer. - Length - Hex string length. - -Returns: - - Converted value. - ---*/ -{ - UINTN Index; - UINTN Value; - - Value =3D 0; - - for (Index =3D 0; Index < Length; Index++) { - if ((String[Index] >=3D L'0') && (String[Index] <=3D L'9')) { - Value =3D (Value << 4) + (String[Index] - L'0'); - } else if ((String[Index] >=3D L'A') && (String[Index] <=3D L'F')) { - Value =3D (Value << 4) + (String[Index] - L'A' + 10); - } else if ((String[Index] >=3D L'a') && (String[Index] <=3D L'f')) { - Value =3D (Value << 4) + (String[Index] - L'a' + 10); - } else { - return 0; - } - } - - return Value; -} - INTN a2i ( IN CHAR16 Ch @@ -1284,154 +742,6 @@ a2i ( return -1; } =20 -CHAR16 -i2A ( - UINTN x - ) -{ - if (x >=3D 0 && x <=3D 9) { - return (CHAR16) (x + '0'); - } - - if (x >=3D 10 && x <=3D 15) { - return (CHAR16) (x - 10 + 'A'); - } - - return 0; -} - -CHAR16 -i2a ( - UINTN x - ) -{ - if (x >=3D 0 && x <=3D 9) { - return (CHAR16) (x + '0'); - } - - if (x >=3D 10 && x <=3D 15) { - return (CHAR16) (x - 10 + 'a'); - } - - return 0; -} - -EFI_STATUS -EntsStrToIp ( - IN CHAR16 *Str, - IN OUT EFI_IP_ADDRESS *IpAddr - ) -{ - UINT8 i; - INTN templen; - CHAR16 *s; - UINTN temp; - - templen =3D 0; - s =3D Str; - temp =3D 0; - - SetMem (IpAddr, sizeof (EFI_IP_ADDRESS), 0); - for (i =3D 0; i < 4; i++) { - templen =3D EntsStrToUINTN (s, &temp); - if ((templen < 0) || (temp > 255)) { - return EFI_INVALID_PARAMETER; - } - - IpAddr->v4.Addr[i] =3D (UINT8) temp; - if (i =3D=3D 3) { - break; - } - - if (s[templen] !=3D L'.') { - return EFI_INVALID_PARAMETER; - } - - s =3D &s[templen + 1]; - } - - return EFI_SUCCESS; -} - -EFI_STATUS -EntsIpToStr ( - IN EFI_IP_ADDRESS *IpAddr, - IN UINTN StrSize, - OUT CHAR16 *Str - ) -{ - EntsSPrint ( - Str, - StrSize, - L"%d.%d.%d.%d", - IpAddr->v4.Addr[0], - IpAddr->v4.Addr[1], - IpAddr->v4.Addr[2], - IpAddr->v4.Addr[3] - ); - - return EFI_SUCCESS; -} - -EFI_STATUS -EntsStrToMac ( - IN CHAR16 *Str, - IN OUT EFI_MAC_ADDRESS *MacAddr - ) -{ - UINT8 i; - INTN templen; - CHAR16 *s; - UINTN temp; - - templen =3D 0; - s =3D Str; - temp =3D 0; - - SetMem (MacAddr, sizeof (EFI_MAC_ADDRESS), 0); - for (i =3D 0; i < 6; i++) { - templen =3D EntsHexStrToUINTN (s, &temp); - if ((templen < 0) || (temp > 255)) { - return EFI_INVALID_PARAMETER; - } - - MacAddr->Addr[i] =3D (UINT8) temp; - if (i =3D=3D 5) { - break; - } - - if (s[templen] !=3D L':') { - return EFI_INVALID_PARAMETER; - } - - s =3D &s[templen + 1]; - } - - return EFI_SUCCESS; -} - -EFI_STATUS -EntsMacToStr ( - IN OUT EFI_MAC_ADDRESS *MacAddr, - IN UINTN StrSize, - OUT CHAR16 *Str - ) -{ - EntsSPrint ( - Str, - StrSize, - L"%02x:%02x:%02x:%02x:%02x:%02x", - MacAddr->Addr[0], - MacAddr->Addr[1], - MacAddr->Addr[2], - MacAddr->Addr[3], - MacAddr->Addr[4], - MacAddr->Addr[5] - ); - - return EFI_SUCCESS; -} - EFI_STATUS EntsTimeToStr ( IN EFI_TIME *Time, diff --git a/TestFrameworkPkg/Library/EasLib/EntsSupport.c b/TestFrameworkP= kg/Library/EasLib/EntsSupport.c index 6cacd3b..efd2c87 100644 --- a/TestFrameworkPkg/Library/EasLib/EntsSupport.c +++ b/TestFrameworkPkg/Library/EasLib/EntsSupport.c @@ -49,21 +49,20 @@ UINTN NICDevicePathLen = =3D 0; CHAR16 NICDevicePathStr[MAX_DEVICE_PATH_STR_LEN] = =3D {0, }; =20 #define SCT_AGENT_NIC_DEVICE_PATH L"Sct Agent NIC Device Path" -EFI_GUID gSctVendorGuid =3D {0x72092b90, 0x17da, 0x47d1, 0x95, 0xce, 0x88,= 0xf0, 0x12, 0xe8, 0x50, 0x8d}; +EFI_GUID gSctVendorGuid =3D {0x72092b90, 0x17da, 0x47d1, {0x95, 0xce, 0x88= , 0xf0, 0x12, 0xe8, 0x50, 0x8d}}; =20 #define MAX_PACKET_LENGTH 1492 =20 STATIC EFI_MANAGED_NETWORK_TRANSMIT_DATA EntsMnpTxDataTemplate =3D { &NetAssertionConfigData.ServerMac, // DestinationAddress &NetAssertionConfigData.MacAddr, // SourceAddress - 0x0800, // ProtocolType + 0x0800, // ProtocolType 0, // DataLength 0, // HeaderLength 1, // FragmentCount - { - 0, - NULL - } // FragmentTable + { // FragmentTable + {0, NULL} + } }; =20 #define ENTS_SERVER_MAC_ADDRESS_NAME L"ServerMac" diff --git a/TestFrameworkPkg/Library/EasLib/EntsTime.c b/TestFrameworkPkg/= Library/EasLib/EntsTime.c index 2565443..c93e51c 100644 --- a/TestFrameworkPkg/Library/EasLib/EntsTime.c +++ b/TestFrameworkPkg/Library/EasLib/EntsTime.c @@ -18,7 +18,7 @@ // // Global variables and definitions // -#define IS_LEAP(y) (((y) % 4) =3D=3D 0 && ((y) % 100) !=3D 0 || ((y) % 40= 0) =3D=3D 0) +#define IS_LEAP(y) ((((y) % 4) =3D=3D 0 && ((y) % 100) !=3D 0) || ((y) % = 400) =3D=3D 0) =20 static const UINTN MonthLengths[2][12] =3D { { diff --git a/TestFrameworkPkg/Library/EfiTestLib/EfiTestLib.c b/TestFramewo= rkPkg/Library/EfiTestLib/EfiTestLib.c index ac9912b..20d2dec 100644 --- a/TestFrameworkPkg/Library/EfiTestLib/EfiTestLib.c +++ b/TestFrameworkPkg/Library/EfiTestLib/EfiTestLib.c @@ -87,6 +87,7 @@ CompareGuid ( ); =20 BOOLEAN +EFIAPI CheckBBTestCanRunAndRecordAssertion ( IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, IN CHAR16 *AssertionString, @@ -870,6 +871,7 @@ CompareGuid ( #if (EFI_SPECIFICATION_VERSION >=3D 0x00020000) =20 BOOLEAN +EFIAPI CheckBBTestCanRunAndRecordAssertion ( IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, IN CHAR16 *AssertionString, @@ -895,6 +897,7 @@ CheckBBTestCanRunAndRecordAssertion ( #else =20 BOOLEAN +EFIAPI CheckBBTestCanRunAndRecordAssertion ( IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, IN CHAR16 *AssertionString, @@ -908,6 +911,7 @@ CheckBBTestCanRunAndRecordAssertion ( #endif =20 EFI_STATUS +EFIAPI EfiTestLibGetSystemConfigurationTable ( IN EFI_GUID *TableGuid, IN OUT VOID **Table diff --git a/TestFrameworkPkg/MonitorServices/IP4NetworkMonitor/IP4NetworkM= onitor.c b/TestFrameworkPkg/MonitorServices/IP4NetworkMonitor/IP4NetworkMon= itor.c index a4775a2..40c6740 100644 --- a/TestFrameworkPkg/MonitorServices/IP4NetworkMonitor/IP4NetworkMonitor.c +++ b/TestFrameworkPkg/MonitorServices/IP4NetworkMonitor/IP4NetworkMonitor.c @@ -65,15 +65,15 @@ STATIC LINK_LAYER_STATUS LinkStatus =3D= WaitForPacket; =20 #define DESTINATION_ADDRESS \ { \ - 255, 255, 255, 255 \ + {255, 255, 255, 255} \ } #define STATION_ADDRESS \ { \ - 0, 0, 0, 0 \ + {0, 0, 0, 0} \ } #define SUBNET_MASK \ { \ - 0, 0, 0, 0 \ + {0, 0, 0, 0} \ } =20 EFI_IP4_CONFIG_DATA mIp4ConfigDataTemplate =3D { @@ -104,8 +104,7 @@ EFI_IP4_TRANSMIT_DATA mIp4TxDataTemplate =3D { 0, // TotalDataLength 1, // FragmentCount { - 0, - NULL + {0, NULL} } // FragmentTable }; =20 @@ -121,8 +120,7 @@ EFI_IP4_RECEIVE_DATA mIp4RxDataTemplate =3D { 0, // DataLength 1, // FragmentCount { - 0, - NULL + {0, NULL} } // FragmentTable }; =20 @@ -141,12 +139,14 @@ StartInitIp4 ( ); =20 VOID +EFIAPI NotifyFunctionSend ( EFI_EVENT Event, VOID *Context ); =20 VOID +EFIAPI NotifyFunctionListen ( EFI_EVENT Event, VOID *Context @@ -173,6 +173,7 @@ SetResendTimer ( ); =20 VOID +EFIAPI ReSendTimer ( IN EFI_EVENT Event, IN VOID *Context @@ -263,6 +264,7 @@ Error: } =20 EFI_STATUS +EFIAPI IP4NetworkMonitorUnload ( IN EFI_HANDLE ImageHandle ) @@ -303,6 +305,7 @@ Returns: // External functions implementations // EFI_STATUS +EFIAPI InitIP4Network ( IN EFI_ENTS_MONITOR_PROTOCOL *This ) @@ -411,6 +414,7 @@ Returns: } =20 EFI_STATUS +EFIAPI ResetIP4Network ( IN EFI_ENTS_MONITOR_PROTOCOL *This ) @@ -565,6 +569,7 @@ Returns: } =20 EFI_STATUS +EFIAPI IP4NetworkSaveContext( EFI_ENTS_MONITOR_PROTOCOL *This ) @@ -588,6 +593,7 @@ IP4NetworkSaveContext( } =20 EFI_STATUS +EFIAPI IP4NetworkRestoreContext( IN EFI_ENTS_MONITOR_PROTOCOL *This ) @@ -614,6 +620,7 @@ IP4NetworkRestoreContext( } =20 EFI_STATUS +EFIAPI IP4NetworkListener ( IN EFI_ENTS_MONITOR_PROTOCOL *This, IN OUT UINTN *Size, @@ -673,6 +680,7 @@ Returns: } =20 EFI_STATUS +EFIAPI IP4NetworkSender ( IN EFI_ENTS_MONITOR_PROTOCOL *This, IN CHAR16 *Buffer @@ -890,6 +898,7 @@ Returns: } =20 VOID +EFIAPI NotifyFunctionSend ( EFI_EVENT Event, VOID *Context @@ -915,6 +924,7 @@ Returns: } =20 VOID +EFIAPI NotifyFunctionListen ( EFI_EVENT Event, VOID *Context @@ -936,7 +946,6 @@ Returns: --*/ { EAS_IP4_FRAG_FLAG FragFlag; - EFI_STATUS Status; UINT32 SequenceID; UINTN Index; =20 @@ -944,7 +953,7 @@ Returns: // Timeout occur, continue // if (RxToken.Status =3D=3D EFI_TIMEOUT) { - Status =3D Ip4->Receive (Ip4, &RxToken); + Ip4->Receive (Ip4, &RxToken); return ; } =20 @@ -1093,12 +1102,13 @@ Returns: break; } =20 - Status =3D Ip4->Receive (Ip4, &RxToken); + Ip4->Receive (Ip4, &RxToken); =20 return ; } =20 VOID +EFIAPI ReSendTimer ( IN EFI_EVENT Event, IN VOID *Context diff --git a/TestFrameworkPkg/MonitorServices/IP4NetworkMonitor/IP4NetworkM= onitor.h b/TestFrameworkPkg/MonitorServices/IP4NetworkMonitor/IP4NetworkMon= itor.h index 5885a8d..256d2b2 100644 --- a/TestFrameworkPkg/MonitorServices/IP4NetworkMonitor/IP4NetworkMonitor.h +++ b/TestFrameworkPkg/MonitorServices/IP4NetworkMonitor/IP4NetworkMonitor.h @@ -20,7 +20,7 @@ =20 #define ENTS_VENDOR_GUID \ { \ - 0x868b4f16, 0xc83a, 0x4205, 0xa9, 0x3c, 0x3f, 0x51, 0xcf, 0x7f, 0x61, = 0xc0 \ + 0x868b4f16, 0xc83a, 0x4205, {0xa9, 0x3c, 0x3f, 0x51, 0xcf, 0x7f, 0x61,= 0xc0} \ } =20 #define ENTS_SERVER_IPV4_ADDRESS_NAME L"ServerIp" @@ -56,6 +56,7 @@ typedef enum { } LINK_LAYER_STATUS; =20 EFI_STATUS +EFIAPI IP4NetworkSaveContext( EFI_ENTS_MONITOR_PROTOCOL *This ) @@ -79,6 +80,7 @@ Returns: ; =20 EFI_STATUS +EFIAPI IP4NetworkRestoreContext( IN EFI_ENTS_MONITOR_PROTOCOL *This ) @@ -105,6 +107,7 @@ Returns: // External functions declarations // EFI_STATUS +EFIAPI IP4NetworkListener ( IN EFI_ENTS_MONITOR_PROTOCOL *This, IN OUT UINTN *Size, @@ -131,6 +134,7 @@ Returns: ; =20 EFI_STATUS +EFIAPI IP4NetworkSender ( IN EFI_ENTS_MONITOR_PROTOCOL *This, IN CHAR16 *Buffer @@ -157,6 +161,7 @@ Returns: ; =20 EFI_STATUS +EFIAPI InitIP4Network ( IN EFI_ENTS_MONITOR_PROTOCOL *This ) @@ -179,6 +184,7 @@ Returns: ; =20 EFI_STATUS +EFIAPI ResetIP4Network ( IN EFI_ENTS_MONITOR_PROTOCOL *This ) diff --git a/TestFrameworkPkg/MonitorServices/ManagedNetworkMonitor/Managed= NetworkMonitor.c b/TestFrameworkPkg/MonitorServices/ManagedNetworkMonitor/M= anagedNetworkMonitor.c index 8d2a8c2..d1e1a69 100644 --- a/TestFrameworkPkg/MonitorServices/ManagedNetworkMonitor/ManagedNetwork= Monitor.c +++ b/TestFrameworkPkg/MonitorServices/ManagedNetworkMonitor/ManagedNetwork= Monitor.c @@ -68,8 +68,8 @@ STATIC UINT32 mCurrentOpCod= e; STATIC UINT32 mCurrentSeqId; STATIC UINT32 mCurrentPacketLength; =20 -EFI_MAC_ADDRESS mDestinationAddress =3D { = 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; -EFI_MAC_ADDRESS mSourceAddress =3D { = 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; +EFI_MAC_ADDRESS mDestinationAddress =3D { = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff} }; +EFI_MAC_ADDRESS mSourceAddress =3D { = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff} }; =20 EFI_MANAGED_NETWORK_CONFIG_DATA mMnpConfigDataTemplate =3D { // @@ -95,8 +95,7 @@ EFI_MANAGED_NETWORK_TRANSMIT_DATA mMnpTxDataTem= plate =3D { 0, // HeaderLength 1, // FragmentCount { - 0, - NULL + {0,NULL} } // FragmentTable }; =20 @@ -142,12 +141,14 @@ MnpSendPacketOut ( ); =20 VOID +EFIAPI NotifyFunctionSend ( EFI_EVENT Event, VOID *Context ); =20 VOID +EFIAPI NotifyFunctionListen ( EFI_EVENT Event, VOID *Context @@ -180,12 +181,14 @@ SetResendTimer ( ); =20 VOID +EFIAPI ReSendTimer ( IN EFI_EVENT Event, IN VOID *Context ); =20 EFI_STATUS +EFIAPI ManagedNetworkMonitorUnload ( IN EFI_HANDLE ImageHandle ); @@ -755,9 +758,6 @@ Returns: --*/ { EFI_STATUS Status; - EFI_MANAGED_NETWORK_PROTOCOL *Mnp; - - Mnp =3D This->MonitorIo; =20 EntsPrint (L"MNP Send ...\n"); if (LinkStatus =3D=3D SendoutPacket) { @@ -858,7 +858,8 @@ Returns: // if (BufferSize <=3D MAX_PACKET_LENGTH) { IsOver =3D TRUE; - CLR_FLAG_MF (FragFlag.LLFlag); +// CLR_FLAG_MF (FragFlag.LLFlag); + FragFlag.Flag.MF =3D 0; PacketLength =3D (UINT32) BufferSize; FragFlag.Flag.Offset =3D HTONS ((UINT16)PacketStartPoint); } else { @@ -866,7 +867,8 @@ Returns: // Need more fragement // IsOver =3D FALSE; - SET_FLAG_MF (FragFlag.LLFlag); +// SET_FLAG_MF (FragFlag.LLFlag); + FragFlag.Flag.MF =3D 1; PacketLength =3D MAX_PACKET_LENGTH; FragFlag.Flag.Offset =3D HTONS ((UINT16)PacketStartPoint); BufferSize -=3D MAX_PACKET_LENGTH; @@ -1121,6 +1123,7 @@ ManagedNetworkRefresh( } =20 VOID +EFIAPI NotifyFunctionListen ( EFI_EVENT Event, VOID *Context @@ -1184,7 +1187,8 @@ Returns: SequenceId =3D NTOHL (FragFlag.Flag.SeqId); PacketStartPoint =3D NTOHS ((UINT16)(FragFlag.Flag.Offset)); PacketLength =3D RxData->DataLength - sizeof (EAS_MNP_FRAG_FLAG); - IsOver =3D HAS_FLAG_MF (FragFlag.LLFlag) ? FALSE : TRUE; +// IsOver =3D HAS_FLAG_MF (FragFlag.LLFlag) ? FALSE : TRUE; + IsOver =3D FragFlag.Flag.MF ? FALSE : TRUE; OpCode =3D FragFlag.Flag.OpCode; =20 // @@ -1399,6 +1403,7 @@ RESTART_RECEIVE: } =20 VOID +EFIAPI ReSendTimer ( IN EFI_EVENT Event, IN VOID *Context diff --git a/TestFrameworkPkg/MonitorServices/ManagedNetworkMonitor/Managed= NetworkMonitor.h b/TestFrameworkPkg/MonitorServices/ManagedNetworkMonitor/M= anagedNetworkMonitor.h index f7db299..f9ac4ad 100644 --- a/TestFrameworkPkg/MonitorServices/ManagedNetworkMonitor/ManagedNetwork= Monitor.h +++ b/TestFrameworkPkg/MonitorServices/ManagedNetworkMonitor/ManagedNetwork= Monitor.h @@ -75,6 +75,7 @@ typedef enum { #define MAX_PACKET_LENGTH 1492 =20 EFI_STATUS +EFIAPI ManagedNetworkSaveContext ( IN EFI_ENTS_MONITOR_PROTOCOL *This ) @@ -98,6 +99,7 @@ Returns: ; =20 EFI_STATUS +EFIAPI ManagedNetworkRestoreContext( IN EFI_ENTS_MONITOR_PROTOCOL *This ) @@ -124,6 +126,7 @@ Returns: // External functions declarations // EFI_STATUS +EFIAPI ManagedNetworkListener ( IN EFI_ENTS_MONITOR_PROTOCOL *This, IN OUT UINTN *Size, @@ -150,6 +153,7 @@ Returns: ; =20 EFI_STATUS +EFIAPI ManagedNetworkSender ( IN EFI_ENTS_MONITOR_PROTOCOL *This, IN CHAR16 *Buffer @@ -175,6 +179,7 @@ Returns: ; =20 EFI_STATUS +EFIAPI InitManagedNetwork ( IN EFI_ENTS_MONITOR_PROTOCOL *This ) /*++ @@ -196,6 +201,7 @@ Returns: ; =20 EFI_STATUS +EFIAPI ResetManagedNetwork ( IN EFI_ENTS_MONITOR_PROTOCOL *This ) /*++ diff --git a/TestFrameworkPkg/PeiSctManageModule/PeiSctManageModule.c b/Tes= tFrameworkPkg/PeiSctManageModule/PeiSctManageModule.c index e86a790..6389f7a 100644 --- a/TestFrameworkPkg/PeiSctManageModule/PeiSctManageModule.c +++ b/TestFrameworkPkg/PeiSctManageModule/PeiSctManageModule.c @@ -621,7 +621,6 @@ BurnFd ( CHAR16* FdPath ) { - EFI_STATUS Status; EFI_STATUS ExecuteStatus; VOID* CmdLine =3D NULL; SHELL_FILE_HANDLE BurnHandle =3D NULL; @@ -649,13 +648,13 @@ BurnFd ( Print (L"\n\n"); Print (L"Burning %s\n\n", FdPath); =20 - Status =3D ShellExecute ( - &ImageHandle, - CmdLine, - FALSE, - NULL, - &ExecuteStatus - ); + ShellExecute ( + &ImageHandle, + CmdLine, + FALSE, + NULL, + &ExecuteStatus + ); =20 FreePool (CmdLine); =20 diff --git a/TestFrameworkPkg/Sct/Core/SctInit.c b/TestFrameworkPkg/Sct/Cor= e/SctInit.c index 6e27eae..f29cd38 100644 --- a/TestFrameworkPkg/Sct/Core/SctInit.c +++ b/TestFrameworkPkg/Sct/Core/SctInit.c @@ -43,7 +43,6 @@ Returns: { EFI_STATUS Status; EFI_SHELL_PARAMETERS_PROTOCOL *ShellParameters; - UINTN Argc; CHAR16 **Argv; =20 // @@ -61,7 +60,6 @@ Returns: return Status; } =20 - Argc =3D ShellParameters->Argc; Argv =3D ShellParameters->Argv; =20 gBS->CloseProtocol( diff --git a/TestFrameworkPkg/Sct/Data/TestCaseEx.c b/TestFrameworkPkg/Sct/= Data/TestCaseEx.c index 4e49a52..d85c88f 100644 --- a/TestFrameworkPkg/Sct/Data/TestCaseEx.c +++ b/TestFrameworkPkg/Sct/Data/TestCaseEx.c @@ -149,7 +149,6 @@ Returns: =20 --*/ { - UINT32 Order; LIST_ENTRY *Link; EFI_SCT_TEST_CASE *TestCase; EFI_SCT_TEST_CASE *Target; @@ -164,7 +163,6 @@ Returns: // // Initialize // - Order =3D EFI_SCT_TEST_CASE_INVALID; Target =3D NULL; =20 // diff --git a/TestFrameworkPkg/Sct/Data/TestNode.c b/TestFrameworkPkg/Sct/Da= ta/TestNode.c index 30df071..bf98966 100644 --- a/TestFrameworkPkg/Sct/Data/TestNode.c +++ b/TestFrameworkPkg/Sct/Data/TestNode.c @@ -119,7 +119,6 @@ Returns: --*/ { EFI_STATUS Status; - LIST_ENTRY *CategoryList; LIST_ENTRY *TestFileList; LIST_ENTRY *Link; EFI_SCT_CATEGORY_DATA *Category; @@ -145,7 +144,6 @@ Returns: // // Walk through all test files // - CategoryList =3D &gFT->CategoryList; TestFileList =3D &gFT->TestFileList; =20 for (Link =3D TestFileList->ForwardLink; Link !=3D TestFileList; Link = =3D Link->ForwardLink) { diff --git a/TestFrameworkPkg/Sct/ENTS/EasDispatcher/Core/Eas.c b/TestFrame= workPkg/Sct/ENTS/EasDispatcher/Core/Eas.c index 96fb40a..3d64180 100644 --- a/TestFrameworkPkg/Sct/ENTS/EasDispatcher/Core/Eas.c +++ b/TestFrameworkPkg/Sct/ENTS/EasDispatcher/Core/Eas.c @@ -137,7 +137,6 @@ Returns: { EFI_STATUS Status; CHAR16 *Buffer; - CHAR16 *Arg; UINTN BufferSize; EFI_ENTS_MONITOR_PROTOCOL *EntsMonitor; =20 @@ -146,7 +145,6 @@ Returns: BufferSize =3D 0; Buffer =3D NULL; Status =3D EFI_SUCCESS; - Arg =3D NULL; EntsMonitor =3D gEasFT->Monitor; =20 Status =3D PostSctAgentDelayedCmd(); @@ -413,4 +411,3 @@ EmptyDelayedPostCmd ( Cmd->ComdInterface =3D NULL; } } - diff --git a/TestFrameworkPkg/Sct/ENTS/EasDispatcher/Exec/EasCmdDisp.c b/Te= stFrameworkPkg/Sct/ENTS/EasDispatcher/Exec/EasCmdDisp.c index cbb49dc..a278407 100644 --- a/TestFrameworkPkg/Sct/ENTS/EasDispatcher/Exec/EasCmdDisp.c +++ b/TestFrameworkPkg/Sct/ENTS/EasDispatcher/Exec/EasCmdDisp.c @@ -1070,7 +1070,6 @@ Returns: EFI_ENTS_PROTOCOL *EntsProtocol; ENTS_INTERFACE *EntsInterface; EFI_STATUS Status; - EFI_STATUS TestStatus; RIVL_VARIABLE *DelayTimeVariable; UINT64 StartTick; UINT64 StopTick; @@ -1111,7 +1110,7 @@ Returns: // Call the entry point // StartTick =3D AsmReadTsc (); - TestStatus =3D EntsInterface->EntsInterfaceEntry (EntsProtocol->ClientI= nterface); + EntsInterface->EntsInterfaceEntry (EntsProtocol->ClientInterface); StopTick =3D AsmReadTsc (); RecordExecTime (StartTick, StopTick); =20 diff --git a/TestFrameworkPkg/Sct/ENTS/EasDispatcher/Rivl/RivlType.c b/Test= FrameworkPkg/Sct/ENTS/EasDispatcher/Rivl/RivlType.c index 2d0bb28..d3ba7d4 100644 --- a/TestFrameworkPkg/Sct/ENTS/EasDispatcher/Rivl/RivlType.c +++ b/TestFrameworkPkg/Sct/ENTS/EasDispatcher/Rivl/RivlType.c @@ -80,7 +80,10 @@ RIVL_INTERNAL_TYPE gRivlInternalTypeArray[] =3D { L"POINTER", sizeof (VOID *) }, - 0 + { + L"", + 0 + } }; =20 // @@ -257,14 +260,13 @@ Returns: =20 --*/ { - EFI_STATUS Status; CHAR16 *Name; =20 // // If buf is NULL, delete all type // if (TypeBuf =3D=3D NULL) { - Status =3D DelRivlAllType (); + DelRivlAllType (); return EFI_SUCCESS; } // diff --git a/TestFrameworkPkg/Sct/ENTS/EasDispatcher/Rivl/RivlVariable.c b/= TestFrameworkPkg/Sct/ENTS/EasDispatcher/Rivl/RivlVariable.c index efb7289..8d74dad 100644 --- a/TestFrameworkPkg/Sct/ENTS/EasDispatcher/Rivl/RivlVariable.c +++ b/TestFrameworkPkg/Sct/ENTS/EasDispatcher/Rivl/RivlVariable.c @@ -162,14 +162,13 @@ Returns: =20 --*/ { - EFI_STATUS Status; CHAR16 *Name; =20 // // If buf is NULL, delete all variable // if (VarBuf =3D=3D NULL) { - Status =3D DelRivlAllVariable (); + DelRivlAllVariable (); return EFI_SUCCESS; } // @@ -1132,7 +1131,6 @@ Returns: RIVL_INTERNAL_TYPE *RivlInternalType; RIVL_MEMBER *RivlMember; CHAR16 *UnitName; - CHAR16 *ValueName; CHAR16 *IndexName; BOOLEAN HasIndex; UINTN IndexValue; @@ -1153,7 +1151,6 @@ Returns: } =20 UnitName =3D NULL; - ValueName =3D NULL; IndexName =3D NULL; HasIndex =3D FALSE; IndexValue =3D 0; @@ -1233,7 +1230,7 @@ Returns: return EFI_INVALID_PARAMETER; } =20 - ValueName =3D my_strtok_field (UnitName, L"("); + my_strtok_field (UnitName, L"("); IndexName =3D my_strtok_field (NULL, L")"); =20 if (IndexName =3D=3D NULL) { @@ -1344,7 +1341,7 @@ Returns: // Recursive search the member name // while (UnitName !=3D NULL) { - ValueName =3D my_strtok_field (UnitName, L"("); + my_strtok_field (UnitName, L"("); IndexName =3D my_strtok_field (NULL, L")"); =20 if (IndexName =3D=3D NULL) { diff --git a/TestFrameworkPkg/Sct/Execute/Execute.c b/TestFrameworkPkg/Sct/= Execute/Execute.c index a55586d..c76ba0b 100644 --- a/TestFrameworkPkg/Sct/Execute/Execute.c +++ b/TestFrameworkPkg/Sct/Execute/Execute.c @@ -1161,7 +1161,6 @@ Routine Description: --*/ { EFI_STATUS Status; - EFI_AP_TEST_INTERFACE *ApTest; =20 // // Check parameters @@ -1173,8 +1172,6 @@ Routine Description: // // Application test interface // - ApTest =3D (EFI_AP_TEST_INTERFACE *) ExecuteInfo->TestProtocol; - while (ExecuteInfo->Iteration < ExecuteInfo->TestCase->Iterations) { // // Application test @@ -1453,7 +1450,6 @@ Routine Description: EFI_STATUS TestStatus; BOOLEAN IsSkip; CHAR16 *CmdLine; - EFI_AP_TEST_INTERFACE *ApTest; EFI_AP_TEST_ENTRY *ApEntry; =20 // @@ -1466,7 +1462,6 @@ Routine Description: // // Application test instance // - ApTest =3D (EFI_AP_TEST_INTERFACE *) ExecuteInfo->TestProtocol; ApEntry =3D (EFI_AP_TEST_ENTRY *) ExecuteInfo->TestEntry; =20 TestStatus =3D EFI_UNSUPPORTED; diff --git a/TestFrameworkPkg/Sct/Execute/ExecuteSupport.c b/TestFrameworkP= kg/Sct/Execute/ExecuteSupport.c index 8036050..ecd4112 100644 --- a/TestFrameworkPkg/Sct/Execute/ExecuteSupport.c +++ b/TestFrameworkPkg/Sct/Execute/ExecuteSupport.c @@ -928,6 +928,7 @@ GatherConfigHandles ( } =20 BOOLEAN +EFIAPI IhvInterfaceFilter ( IN VOID *ClientInterface, IN EFI_HANDLE SupportHandle, diff --git a/TestFrameworkPkg/Sct/Execute/ExecuteSupport.h b/TestFrameworkP= kg/Sct/Execute/ExecuteSupport.h index 680eb2b..a98bac2 100644 --- a/TestFrameworkPkg/Sct/Execute/ExecuteSupport.h +++ b/TestFrameworkPkg/Sct/Execute/ExecuteSupport.h @@ -80,6 +80,7 @@ BOOLEAN ); =20 BOOLEAN +EFIAPI IhvInterfaceFilter ( IN VOID *ClientInterface, IN EFI_HANDLE SupportHandle, diff --git a/TestFrameworkPkg/Sct/Include/SctCore.h b/TestFrameworkPkg/Sct/= Include/SctCore.h index 36c2361..861cc0b 100644 --- a/TestFrameworkPkg/Sct/Include/SctCore.h +++ b/TestFrameworkPkg/Sct/Include/SctCore.h @@ -20,6 +20,7 @@ // =20 EFI_STATUS +EFIAPI InitializeSct ( IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable diff --git a/TestFrameworkPkg/Sct/Include/SctDef.h b/TestFrameworkPkg/Sct/I= nclude/SctDef.h index d0c4226..2d04ca9 100644 --- a/TestFrameworkPkg/Sct/Include/SctDef.h +++ b/TestFrameworkPkg/Sct/Include/SctDef.h @@ -65,7 +65,7 @@ // System hang assertion // #define EFI_SYSTEM_HANG_ASSERTION_GUID \ - { 0xde687a18, 0x0bbd, 0x4396, 0x85, 0x09, 0x49, 0x8f, 0xf2, 0x32, 0x34, = 0xf1 } + { 0xde687a18, 0x0bbd, 0x4396, {0x85, 0x09, 0x49, 0x8f, 0xf2, 0x32, 0x34,= 0xf1 }} =20 // // Global variables diff --git a/TestFrameworkPkg/Sct/Misc/SctMisc.c b/TestFrameworkPkg/Sct/Mis= c/SctMisc.c index 1108f63..73f63f5 100644 --- a/TestFrameworkPkg/Sct/Misc/SctMisc.c +++ b/TestFrameworkPkg/Sct/Misc/SctMisc.c @@ -1400,7 +1400,7 @@ Routine Description: StrCpy (Buffer, L"Exhaustive"); break; default: - EFI_UNSUPPORTED; + return EFI_UNSUPPORTED; } =20 return EFI_SUCCESS; diff --git a/TestFrameworkPkg/Sct/UI/BuildMenu.c b/TestFrameworkPkg/Sct/UI/= BuildMenu.c index 5d77dd5..dfa3d6c 100644 --- a/TestFrameworkPkg/Sct/UI/BuildMenu.c +++ b/TestFrameworkPkg/Sct/UI/BuildMenu.c @@ -40,6 +40,7 @@ CreateStandardMenuPage ( ); =20 EFI_STATUS +EFIAPI DestroyMenuPage ( IN EFI_MENU_PAGE *Page ); @@ -266,6 +267,7 @@ Returns: =20 =20 EFI_STATUS +EFIAPI DestroyMenuPage ( IN EFI_MENU_PAGE *Page ) diff --git a/TestFrameworkPkg/Sct/UI/BuildMenu.h b/TestFrameworkPkg/Sct/UI/= BuildMenu.h index 01ccdad..a2f4b80 100644 --- a/TestFrameworkPkg/Sct/UI/BuildMenu.h +++ b/TestFrameworkPkg/Sct/UI/BuildMenu.h @@ -20,7 +20,7 @@ // =20 #include "Sct.h" -#include "Ui.h" +#include "UI.h" =20 // // Definitions @@ -50,6 +50,7 @@ CreateStandardMenuPage ( ); =20 EFI_STATUS +EFIAPI DestroyMenuPage ( IN EFI_MENU_PAGE *Page ); @@ -169,6 +170,7 @@ DisplayMainMenu ( // =20 EFI_STATUS +EFIAPI DisplayConfigMenu ( IN EFI_MENU_PAGE *ParentPage ); @@ -178,6 +180,7 @@ DisplayConfigMenu ( // =20 EFI_STATUS +EFIAPI DisplayCaseMgmtMenu ( IN EFI_MENU_PAGE *ParentPage ); @@ -187,6 +190,7 @@ DisplayCaseMgmtMenu ( // =20 EFI_STATUS +EFIAPI DisplayProtocolMenu ( IN EFI_MENU_PAGE *ParentPage ); @@ -196,6 +200,7 @@ DisplayProtocolMenu ( // =20 EFI_STATUS +EFIAPI DisplayDriverMenu ( IN EFI_MENU_PAGE *ParentPage ); @@ -205,11 +210,13 @@ DisplayDriverMenu ( // =20 EFI_STATUS +EFIAPI DisplayFileNameMenu ( IN EFI_MENU_PAGE *ParentPage ); =20 EFI_STATUS +EFIAPI DisplaySequenceMenu ( IN EFI_MENU_PAGE *ParentPage ); @@ -228,6 +235,7 @@ DisplayCaseMenu ( //prototypes (from ResultMgmtMenu.c) // EFI_STATUS +EFIAPI DisplayResultMgmtMenu ( IN EFI_MENU_PAGE *ParentPage ); @@ -235,6 +243,7 @@ DisplayResultMgmtMenu ( //protypes (from UtilityMenu.c) // EFI_STATUS +EFIAPI DisplayUtilityMenu ( IN EFI_MENU_PAGE *ParentPage ); diff --git a/TestFrameworkPkg/Sct/UI/ConfigMenu.c b/TestFrameworkPkg/Sct/UI= /ConfigMenu.c index 8aebf4e..a679e21 100644 --- a/TestFrameworkPkg/Sct/UI/ConfigMenu.c +++ b/TestFrameworkPkg/Sct/UI/ConfigMenu.c @@ -12,7 +12,7 @@ =20 **/ =20 -#include "SCT.h" +#include "Sct.h" #include "BuildMenu.h" =20 // @@ -37,21 +37,25 @@ BOOLEAN ItemValueChanged =3D FALSE; // =20 EFI_STATUS +EFIAPI DisplayConfigMenu ( IN EFI_MENU_PAGE *ParentPage ); =20 EFI_STATUS +EFIAPI ConfigMenuEscFunc ( IN EFI_MENU_PAGE *Page ); =20 EFI_STATUS +EFIAPI ConfigMenuSetDefaultFunc ( IN EFI_MENU_PAGE *Page ); =20 EFI_STATUS +EFIAPI ConfigMenuDescPrintFunc ( IN EFI_MENU_ITEM *MenuItem, IN VOID *Context, @@ -64,6 +68,7 @@ ConfigMenuDescPrintFunc ( // =20 EFI_STATUS +EFIAPI DisplayConfigMenu ( IN EFI_MENU_PAGE *ParentPage ) @@ -511,6 +516,7 @@ Returns: } =20 EFI_STATUS +EFIAPI ConfigMenuSetDefaultFunc ( IN EFI_MENU_PAGE *MenuPage ) @@ -758,6 +764,7 @@ Returns: } =20 EFI_STATUS +EFIAPI ConfigMenuEscFunc ( IN EFI_MENU_PAGE *Page ) @@ -778,8 +785,7 @@ Returns: =20 --*/ { - EFI_STATUS Status; - EFI_MENU_ITEM *MenuItem; + EFI_MENU_ITEM *MenuItem; CHAR16 *FileName; UINTN TempValue; BOOLEAN TrueOrFalse; @@ -877,11 +883,11 @@ Returns: // //save config data into profile // - Status =3D SaveConfigData ( - gFT->DevicePath, - FileName, - gFT->ConfigData - ); + SaveConfigData ( + gFT->DevicePath, + FileName, + gFT->ConfigData + ); FreePool (FileName); } // @@ -898,6 +904,7 @@ Returns: } =20 EFI_STATUS +EFIAPI ConfigMenuDescPrintFunc ( IN EFI_MENU_ITEM *MenuItem, IN VOID *Context, diff --git a/TestFrameworkPkg/Sct/UI/Dialog.h b/TestFrameworkPkg/Sct/UI/Dia= log.h index d662602..90755b9 100644 --- a/TestFrameworkPkg/Sct/UI/Dialog.h +++ b/TestFrameworkPkg/Sct/UI/Dialog.h @@ -24,7 +24,7 @@ #include #include =20 -#include "Ui.h" +#include "UI.h" =20 #include =20 diff --git a/TestFrameworkPkg/Sct/UI/DisplayUi.c b/TestFrameworkPkg/Sct/UI/= DisplayUi.c index b04426c..2a000cf 100644 --- a/TestFrameworkPkg/Sct/UI/DisplayUi.c +++ b/TestFrameworkPkg/Sct/UI/DisplayUi.c @@ -45,21 +45,25 @@ SetScrollBarPos ( ); =20 EFI_STATUS +EFIAPI MenuBodyRefresh ( IN EFI_MENU_PAGE *MenuPage ); =20 EFI_STATUS +EFIAPI MenuFooterRefresh ( IN EFI_MENU_PAGE *MenuPage ); =20 EFI_STATUS +EFIAPI MenuBodyItemsRefresh ( IN EFI_MENU_PAGE *MenuPage ); =20 EFI_STATUS +EFIAPI MenuItemRefresh ( IN EFI_MENU_PAGE *MenuPage, IN EFI_MENU_ITEM *Item, @@ -67,6 +71,7 @@ MenuItemRefresh ( ); =20 EFI_STATUS +EFIAPI MenuPageRefresh ( IN EFI_MENU_PAGE *MenuPage ); @@ -278,6 +283,7 @@ Returns: } =20 EFI_STATUS +EFIAPI MenuHeaderRefresh ( IN EFI_MENU_PAGE *MenuPage ) @@ -379,6 +385,7 @@ Returns: } =20 EFI_STATUS +EFIAPI MenuBodyRefresh ( IN EFI_MENU_PAGE *MenuPage ) @@ -728,6 +735,7 @@ Returns: } =20 EFI_STATUS +EFIAPI MenuFooterRefresh ( IN EFI_MENU_PAGE *MenuPage ) @@ -753,7 +761,6 @@ Returns: UINTN X1; UINTN Y1; UINTN Lines; - UINTN Columns; UINTN Xpos; UINTN Ypos; EFI_HOT_KEY *HotKey; @@ -775,7 +782,6 @@ Returns: X1 =3D MenuPage->Footer.FooterRect.BottomRight.Col; Y1 =3D MenuPage->Footer.FooterRect.BottomRight.Row; Lines =3D Y1-Y0+1; - Columns =3D X1-X0+1; Xpos =3D X0; Ypos =3D Y0; =20 @@ -868,6 +874,7 @@ Returns: } =20 EFI_STATUS +EFIAPI MenuBodyItemsRefresh ( IN EFI_MENU_PAGE *MenuPage ) @@ -1061,6 +1068,7 @@ Returns: } =20 EFI_STATUS +EFIAPI MenuItemRefresh ( IN EFI_MENU_PAGE *MenuPage, IN EFI_MENU_ITEM *Item, @@ -1562,6 +1570,7 @@ Returns: } =20 EFI_STATUS +EFIAPI MenuItemStatusRefresh ( IN EFI_MENU_PAGE *MenuPage, IN EFI_MENU_ITEM *Item, @@ -1752,6 +1761,7 @@ Returns: } =20 EFI_STATUS +EFIAPI MenuPageRefresh ( IN EFI_MENU_PAGE *MenuPage ) diff --git a/TestFrameworkPkg/Sct/UI/FileDialog.c b/TestFrameworkPkg/Sct/UI= /FileDialog.c index c3e7732..4424dbc 100644 --- a/TestFrameworkPkg/Sct/UI/FileDialog.c +++ b/TestFrameworkPkg/Sct/UI/FileDialog.c @@ -2601,7 +2601,6 @@ Returns: EFI_INPUT_KEY Key; EFI_STATUS Status; EFI_FILE_HANDLE FHandle; - EFI_FILE_HANDLE TempHandle; BOOLEAN RET; CHAR16 *TempName; INTN Length; @@ -2631,7 +2630,6 @@ Returns: } else { ResultContextWasNull =3D FALSE; } - TempHandle =3D ResultContext->FHandle; =20 // //set the new file diff --git a/TestFrameworkPkg/Sct/UI/FileDialog.h b/TestFrameworkPkg/Sct/UI= /FileDialog.h index bfc2bf2..4801fc0 100644 --- a/TestFrameworkPkg/Sct/UI/FileDialog.h +++ b/TestFrameworkPkg/Sct/UI/FileDialog.h @@ -24,7 +24,7 @@ #include #include =20 -#include "Ui.h" +#include "UI.h" #include =20 // diff --git a/TestFrameworkPkg/Sct/UI/KeyFunction.c b/TestFrameworkPkg/Sct/U= I/KeyFunction.c index 34e683f..e585489 100644 --- a/TestFrameworkPkg/Sct/UI/KeyFunction.c +++ b/TestFrameworkPkg/Sct/UI/KeyFunction.c @@ -30,44 +30,52 @@ extern BOOLEAN gMenuExit; //protypes (external) // EFI_STATUS +EFIAPI DoDefault ( IN EFI_MENU_PAGE *MenuPage, IN EFI_INPUT_KEY *InKey ); =20 EFI_STATUS +EFIAPI UpFunc ( IN EFI_MENU_PAGE *MenuPage ); =20 EFI_STATUS +EFIAPI DownFunc ( IN EFI_MENU_PAGE *MenuPage ); =20 EFI_STATUS +EFIAPI DoEdit ( IN EFI_MENU_PAGE *MenuPage, IN OUT EFI_INPUT_KEY *InKey ); =20 EFI_STATUS +EFIAPI DoIterEdit ( IN EFI_MENU_PAGE *MenuPage, IN OUT EFI_INPUT_KEY *InKey ); =20 EFI_STATUS +EFIAPI SpaceFunc ( IN EFI_MENU_PAGE *MenuPage ); =20 EFI_STATUS +EFIAPI LeftArrowFunc ( IN EFI_MENU_PAGE *MenuPage ); =20 EFI_STATUS +EFIAPI RightArrowFunc ( IN EFI_MENU_PAGE *MenuPage ); @@ -110,6 +118,7 @@ CompareNumberString ( // =20 EFI_STATUS +EFIAPI DoDefault ( IN EFI_MENU_PAGE *MenuPage, IN EFI_INPUT_KEY *InKey @@ -141,6 +150,7 @@ Returns: } =20 EFI_STATUS +EFIAPI UpFunc ( IN EFI_MENU_PAGE *MenuPage ) @@ -237,6 +247,7 @@ Returns: } =20 EFI_STATUS +EFIAPI DownFunc ( IN EFI_MENU_PAGE *MenuPage ) @@ -359,6 +370,7 @@ Returns: } =20 EFI_STATUS +EFIAPI PageUpFunc ( IN EFI_MENU_PAGE *MenuPage ) @@ -469,6 +481,7 @@ Returns: } =20 EFI_STATUS +EFIAPI PageDownFunc ( IN EFI_MENU_PAGE *MenuPage ) @@ -603,6 +616,7 @@ Returns: =20 =20 EFI_STATUS +EFIAPI DoEdit ( IN EFI_MENU_PAGE *MenuPage, IN OUT EFI_INPUT_KEY *InKey @@ -1425,6 +1439,7 @@ Returns: } =20 EFI_STATUS +EFIAPI SpaceFunc( IN EFI_MENU_PAGE *MenuPage ) @@ -1542,6 +1557,7 @@ Returns: } =20 EFI_STATUS +EFIAPI LeftArrowFunc( IN EFI_MENU_PAGE *MenuPage ) @@ -1635,6 +1651,7 @@ Returns: } =20 EFI_STATUS +EFIAPI RightArrowFunc( IN EFI_MENU_PAGE *MenuPage ) @@ -2152,6 +2169,7 @@ Returns: } =20 EFI_STATUS +EFIAPI DoIterEdit ( IN EFI_MENU_PAGE *MenuPage, IN OUT EFI_INPUT_KEY *InKey diff --git a/TestFrameworkPkg/Sct/UI/LogFileDialog.c b/TestFrameworkPkg/Sct= /UI/LogFileDialog.c index 9b16ad8..e10fa73 100644 --- a/TestFrameworkPkg/Sct/UI/LogFileDialog.c +++ b/TestFrameworkPkg/Sct/UI/LogFileDialog.c @@ -2370,7 +2370,7 @@ Returns: if (*Ptr =3D=3D '\\' && *(Ptr+1) =3D=3D '.' && *(Ptr+2) =3D=3D '.' && = *(Ptr+3) !=3D 0) { =20 // - // Convert \Name\..\ to \ + // Convert "\Name\..\" to "\" // DO NOT convert the .. if it is at the end of the string. This wi= ll // break the .. behavior in changing directories. // @@ -2380,7 +2380,7 @@ Returns: } else if (*Ptr =3D=3D '\\' && *(Ptr+1) =3D=3D '.' && *(Ptr + 2) =3D= =3D '\\') { =20 // - // Convert a \.\ to a \ + // Convert a "\.\" to a "\" // StrCpy (TempStr, Ptr + 2); StrCpy (Ptr, TempStr); diff --git a/TestFrameworkPkg/Sct/UI/LogFileDialog.h b/TestFrameworkPkg/Sct= /UI/LogFileDialog.h index 1db7f09..10b21ac 100644 --- a/TestFrameworkPkg/Sct/UI/LogFileDialog.h +++ b/TestFrameworkPkg/Sct/UI/LogFileDialog.h @@ -24,7 +24,7 @@ #include #include =20 -#include "Ui.h" +#include "UI.h" #include =20 // diff --git a/TestFrameworkPkg/Sct/UI/MainMenu.c b/TestFrameworkPkg/Sct/UI/M= ainMenu.c index c44b406..cc79f8b 100644 --- a/TestFrameworkPkg/Sct/UI/MainMenu.c +++ b/TestFrameworkPkg/Sct/UI/MainMenu.c @@ -54,46 +54,55 @@ DisplayMainMenu ( // =20 VOID +EFIAPI DisplayDeviceConfig ( IN EFI_MENU_PAGE *Page ); =20 VOID +EFIAPI DisplayReportGenerator( IN EFI_MENU_PAGE *Page ); =20 VOID +EFIAPI DisplayLog( IN EFI_MENU_PAGE *Page ); =20 EFI_STATUS +EFIAPI MainMenuEnterFunc ( IN EFI_MENU_PAGE *Page ); =20 EFI_STATUS +EFIAPI MainMenuEscFunc ( IN EFI_MENU_PAGE *Page ); =20 EFI_STATUS +EFIAPI MainMenuLoadSeqFunc ( IN EFI_MENU_PAGE *Page ); =20 EFI_STATUS +EFIAPI MainMenuSaveSeqFunc ( IN EFI_MENU_PAGE *Page ); =20 EFI_STATUS +EFIAPI MainMenuF9Func( IN EFI_MENU_PAGE *Page ); =20 EFI_STATUS +EFIAPI MainMenuClearFunc ( IN EFI_MENU_PAGE *Page ); @@ -416,6 +425,7 @@ Returns: } =20 EFI_STATUS +EFIAPI MainMenuEnterFunc ( IN EFI_MENU_PAGE *Page ) @@ -472,6 +482,7 @@ Reutrns =20 =20 EFI_STATUS +EFIAPI MainMenuEscFunc ( IN EFI_MENU_PAGE *Page ) @@ -506,6 +517,7 @@ Returns: } =20 VOID +EFIAPI DisplayDeviceConfig ( IN EFI_MENU_PAGE *Page ) @@ -548,6 +560,7 @@ DisplayDeviceConfig ( } =20 VOID +EFIAPI DisplayReportGenerator( IN EFI_MENU_PAGE *Page ) @@ -661,6 +674,7 @@ DisplayReportGenerator( =20 =20 VOID +EFIAPI DisplayLog ( IN EFI_MENU_PAGE *Page ) @@ -767,6 +781,7 @@ DisplayLog ( } =20 EFI_STATUS +EFIAPI MainMenuLoadSeqFunc ( IN EFI_MENU_PAGE *Page ) @@ -853,6 +868,7 @@ MainMenuLoadSeqFunc ( =20 =20 EFI_STATUS +EFIAPI MainMenuSaveSeqFunc ( IN EFI_MENU_PAGE *Page ) @@ -944,6 +960,7 @@ MainMenuSaveSeqFunc ( } =20 EFI_STATUS +EFIAPI MainMenuF9Func( IN EFI_MENU_PAGE *Page ) @@ -1004,6 +1021,7 @@ Returns: } =20 EFI_STATUS +EFIAPI MainMenuClearFunc ( IN EFI_MENU_PAGE *Page ) diff --git a/TestFrameworkPkg/Sct/UI/TestNodeMenu.c b/TestFrameworkPkg/Sct/= UI/TestNodeMenu.c index 0cdf597..72ac50e 100644 --- a/TestFrameworkPkg/Sct/UI/TestNodeMenu.c +++ b/TestFrameworkPkg/Sct/UI/TestNodeMenu.c @@ -40,26 +40,31 @@ DisplayTestNodeMenu ( // Prototypes (internal) // EFI_STATUS +EFIAPI TestNodeMenuEnterFunc ( IN EFI_MENU_PAGE *Page ); =20 EFI_STATUS +EFIAPI TestNodeMenuEscFunc ( IN EFI_MENU_PAGE *Page ); =20 EFI_STATUS +EFIAPI TestNodeMenuSpaceFunc( IN EFI_MENU_PAGE *Page ); =20 EFI_STATUS +EFIAPI TestNodeMenuF9Func( IN EFI_MENU_PAGE *Page ); =20 EFI_STATUS +EFIAPI TestNodeMenuF8Func( IN EFI_MENU_PAGE *Page ); @@ -87,6 +92,7 @@ UnSelectTestNode ( ); =20 EFI_STATUS +EFIAPI TestNodeMenuDescPrintFunc ( IN EFI_MENU_ITEM *MenuItem, IN VOID *Context, @@ -388,6 +394,7 @@ Returns: } =20 EFI_STATUS +EFIAPI TestNodeMenuEnterFunc ( IN EFI_MENU_PAGE *Page ) @@ -449,6 +456,7 @@ Returns: } =20 EFI_STATUS +EFIAPI TestNodeMenuEscFunc ( IN EFI_MENU_PAGE *Page ) @@ -586,6 +594,7 @@ Returns: =20 =20 EFI_STATUS +EFIAPI TestNodeMenuSpaceFunc( IN EFI_MENU_PAGE *Page ) @@ -661,6 +670,7 @@ Returns: } =20 EFI_STATUS +EFIAPI TestNodeMenuF9Func( IN EFI_MENU_PAGE *Page ) @@ -721,6 +731,7 @@ Returns: } =20 EFI_STATUS +EFIAPI TestNodeMenuF8Func( IN EFI_MENU_PAGE *Page ) @@ -929,6 +940,7 @@ Arguments: } =20 EFI_STATUS +EFIAPI TestNodeMenuDescPrintFunc ( IN EFI_MENU_ITEM *MenuItem, IN VOID *Context, diff --git a/TestFrameworkPkg/Sct/UI/TestNodeMenu.h b/TestFrameworkPkg/Sct/= UI/TestNodeMenu.h index 8f86bfb..84348c1 100644 --- a/TestFrameworkPkg/Sct/UI/TestNodeMenu.h +++ b/TestFrameworkPkg/Sct/UI/TestNodeMenu.h @@ -20,7 +20,7 @@ // =20 #include "Sct.h" -#include "Ui.h" +#include "UI.h" #include "BuildMenu.h" #include "Dialog.h" =20 diff --git a/TestFrameworkPkg/Sct/UI/UI.h b/TestFrameworkPkg/Sct/UI/UI.h index dbd2d41..6304c78 100644 --- a/TestFrameworkPkg/Sct/UI/UI.h +++ b/TestFrameworkPkg/Sct/UI/UI.h @@ -242,6 +242,7 @@ Returns: =20 =20 EFI_STATUS +EFIAPI MenuHeaderRefresh ( IN EFI_MENU_PAGE *MenuPage ) @@ -264,6 +265,7 @@ Returns: ; =20 EFI_STATUS +EFIAPI MenuBodyRefresh ( IN EFI_MENU_PAGE *MenuPage ) @@ -290,6 +292,7 @@ Returns: // =20 EFI_STATUS +EFIAPI MenuBodyItemsRefresh ( IN EFI_MENU_PAGE *MenuPage ) @@ -312,6 +315,7 @@ Returns: ; =20 EFI_STATUS +EFIAPI MenuItemRefresh ( IN EFI_MENU_PAGE *MenuPage, IN EFI_MENU_ITEM *Item, @@ -338,6 +342,7 @@ Returns: ; =20 EFI_STATUS +EFIAPI MenuItemStatusRefresh( IN EFI_MENU_PAGE *MenuPage, IN EFI_MENU_ITEM *Item, @@ -363,6 +368,7 @@ Returns: ; =20 EFI_STATUS +EFIAPI MenuFooterRefresh ( IN EFI_MENU_PAGE *MenuPage ) @@ -385,6 +391,7 @@ Returns: ; =20 EFI_STATUS +EFIAPI MenuPageRefresh ( IN EFI_MENU_PAGE *MenuPage ) @@ -463,12 +470,14 @@ DisplayMessage ( ); =20 EFI_STATUS +EFIAPI DoEdit ( IN EFI_MENU_PAGE *MenuPage, IN EFI_INPUT_KEY *InKey ); =20 EFI_STATUS +EFIAPI DoIterEdit ( IN EFI_MENU_PAGE *MenuPage, IN EFI_INPUT_KEY *InKey @@ -479,36 +488,43 @@ DoIterEdit ( // =20 EFI_STATUS +EFIAPI UpFunc ( IN EFI_MENU_PAGE *MenuPage ); =20 EFI_STATUS +EFIAPI DownFunc ( IN EFI_MENU_PAGE *MenuPage ); =20 EFI_STATUS +EFIAPI PageUpFunc ( IN EFI_MENU_PAGE *MenuPage ); =20 EFI_STATUS +EFIAPI PageDownFunc ( IN EFI_MENU_PAGE *MenuPage ); =20 EFI_STATUS +EFIAPI SpaceFunc ( IN EFI_MENU_PAGE *MenuPage ); =20 EFI_STATUS +EFIAPI LeftArrowFunc ( IN EFI_MENU_PAGE *MenuPage ); =20 EFI_STATUS +EFIAPI RightArrowFunc ( IN EFI_MENU_PAGE *MenuPage ); diff --git a/TestFrameworkPkg/Support/StandardTest/StandardTest.c b/TestFra= meworkPkg/Support/StandardTest/StandardTest.c index 8ea22dd..270dc76 100644 --- a/TestFrameworkPkg/Support/StandardTest/StandardTest.c +++ b/TestFrameworkPkg/Support/StandardTest/StandardTest.c @@ -335,7 +335,6 @@ StslCloseAllFiles ( IN STANDARD_TEST_PRIVATE_DATA *Private ) { - EFI_STATUS Status; EFI_TEST_OUTPUT_LIBRARY_PROTOCOL *Output; EFI_LIB_CONFIG_FILE_HANDLE *FileConf; =20 @@ -346,10 +345,10 @@ StslCloseAllFiles ( // FileConf =3D &Private->SystemLogFile; if (FileConf->FileHandle !=3D NULL) { - Status =3D Output->Close ( - Output, - FileConf->FileHandle - ); + Output->Close ( + Output, + FileConf->FileHandle + ); FileConf->FileHandle =3D NULL; } =20 @@ -358,10 +357,10 @@ StslCloseAllFiles ( // FileConf =3D &Private->SystemKeyFile; if (FileConf->FileHandle !=3D NULL) { - Status =3D Output->Close ( - Output, - FileConf->FileHandle - ); + Output->Close ( + Output, + FileConf->FileHandle + ); FileConf->FileHandle =3D NULL; } =20 @@ -370,10 +369,10 @@ StslCloseAllFiles ( // FileConf =3D &Private->CaseLogFile; if (FileConf->FileHandle !=3D NULL) { - Status =3D Output->Close ( - Output, - FileConf->FileHandle - ); + Output->Close ( + Output, + FileConf->FileHandle + ); FileConf->FileHandle =3D NULL; } =20 @@ -382,10 +381,10 @@ StslCloseAllFiles ( // FileConf =3D &Private->CaseKeyFile; if (FileConf->FileHandle !=3D NULL) { - Status =3D Output->Close ( - Output, - FileConf->FileHandle - ); + Output->Close ( + Output, + FileConf->FileHandle + ); FileConf->FileHandle =3D NULL; } =20 @@ -1712,4 +1711,3 @@ Returns: =20 return Status; } - diff --git a/TestFrameworkPkg/Support/TestLogging/TestLogging.c b/TestFrame= workPkg/Support/TestLogging/TestLogging.c index 703aae9..16f12c7 100644 --- a/TestFrameworkPkg/Support/TestLogging/TestLogging.c +++ b/TestFrameworkPkg/Support/TestLogging/TestLogging.c @@ -89,7 +89,6 @@ TllCloseAllFiles ( TEST_LOGGING_PRIVATE_DATA *Private ) { - EFI_STATUS Status; EFI_TEST_OUTPUT_LIBRARY_PROTOCOL *Output; EFI_LIB_CONFIG_FILE_HANDLE *FileConf; =20 @@ -100,10 +99,10 @@ TllCloseAllFiles ( // FileConf =3D &Private->SystemLogFile; if (FileConf->FileHandle !=3D NULL) { - Status =3D Output->Close ( - Output, - FileConf->FileHandle - ); + Output->Close ( + Output, + FileConf->FileHandle + ); FileConf->FileHandle =3D NULL; } =20 @@ -112,10 +111,10 @@ TllCloseAllFiles ( // FileConf =3D &Private->CaseLogFile; if (FileConf->FileHandle !=3D NULL) { - Status =3D Output->Close ( - Output, - FileConf->FileHandle - ); + Output->Close ( + Output, + FileConf->FileHandle + ); FileConf->FileHandle =3D NULL; } =20 diff --git a/TestFrameworkPkg/Support/TestProfile/TestProfile.c b/TestFrame= workPkg/Support/TestProfile/TestProfile.c index ca405d3..f02e9df 100644 --- a/TestFrameworkPkg/Support/TestProfile/TestProfile.c +++ b/TestFrameworkPkg/Support/TestProfile/TestProfile.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -93,326 +94,52 @@ CHAR16 *gAtslDescription =3D L"EFI Test Profile Librar= y"; // // Internal functions // -#define toupper(c) (((c <=3D 'z') && (c >=3D 'a')) ? (c + 'A' - 'a') : c) -#define tolower(c) (((c <=3D 'Z') && (c >=3D 'A')) ? (c - 'A' + 'a') : c) - -VOID * -TestProfile_memset( - VOID *b, - INTN c, - UINTN len - ) -{ - volatile CHAR8 *p; - UINTN i; - - p =3D b; - for (i =3D 0; i < len; i++) { - p[i] =3D (CHAR8)c; - } - return ((VOID *)p); -} - -VOID* -malloc ( - UINTN size - ) -{ - VOID *pMem; - - if (gBS->AllocatePool (EfiBootServicesData, size, &pMem) !=3D EFI_SUCCES= S) { - return NULL; - } - return pMem; -} - -VOID * -calloc( - UINTN NMemb, - UINTN MembSize - ) -{ - UINTN NewSize; - VOID *NewMem; - - NewSize =3D NMemb * MembSize; - NewMem =3D malloc (NewSize); - if (NewMem) { - TestProfile_memset (NewMem, 0, NewSize); - } - - return NewMem; -} - -VOID -free ( - VOID *addr - ) -{ - gBS->FreePool (addr); -} - -INTN -memcmp( - VOID *s1, - VOID *s2, - UINTN n - ) -{ - CHAR8 *p1, *p2; - - p1 =3D s1; - p2 =3D s2; - if (n !=3D 0) { - do { - if (*p1++ !=3D *p2++) - return (*--p1 - *--p2); - } while (--n !=3D 0); - } - return (0); -} - -VOID * -memcpy( - VOID *dst, - VOID *src, - UINTN len - ) -{ - CHAR8 *d, *s; - - d =3D dst; - s =3D src; - while (len--) { - *(d++) =3D *(s++); - } - return dst; -} - -CHAR8 * -strchr( - CHAR8 *p, - INTN ch - ) -{ - for (; ; ++p) { - if (*p =3D=3D ch) - return((CHAR8 *)p); - if (!*p) - return((CHAR8 *)NULL); - } - /* NOTREACHED */ -} - -INTN -strcmp( - CHAR8 *s1, - CHAR8 *s2 - ) -{ - while (*s1 =3D=3D *s2++) { - if (*s1++ =3D=3D 0) - return 0; - } - return (*s1 - *s2 - 1); -} - -INTN -stricmp( - CHAR8 *s1, - CHAR8 *s2 - ) -{ - while (toupper(*s1) =3D=3D toupper(*s2)) { - s2++; - if (*s1++ =3D=3D 0) - return (0); - } - return (*s1 - *s2); -} - -CHAR8 * -strcpy( - CHAR8 *to, - CHAR8 *from - ) -{ - CHAR8 *save; - - save =3D to; - for (; (*to =3D *from) !=3D 0 ; ++from, ++to) - ; - return(save); -} - -CHAR8 * -strncpy( - CHAR8 *dst, - CHAR8 *src, - UINTN n - ) -{ - volatile CHAR8 *d; - CHAR8 *s; - - d =3D dst; - s =3D src; - if (n !=3D 0) { - do { - if ((*d++ =3D *s++) =3D=3D 0) { - /* NUL pad the remaining n-1 bytes */ - while (--n !=3D 0) - *d++ =3D 0; - break; - } - } while (--n !=3D 0); - } - return (dst); -} - -UINTN -strlen( - CHAR8 *str - ) -{ - CHAR8 *s; - - for (s =3D str; *s; ++s) - ; - return (UINTN)(s - str); -} - CHAR8 * -strdup( - CHAR8 *str +AsciiDuplicateString ( + CHAR8 *str ) { - CHAR8 *copy; - - if (str !=3D NULL) { - copy =3D malloc(strlen(str) + 1); - if (copy !=3D NULL) - return strcpy(copy, str); - } - return NULL; -} - -CHAR8 * -strcat( - CHAR8 *s, - CHAR8 *append -) -{ - CHAR8 *save; - - save =3D s; - for (; *s; ++s) - ; - while ( (*s++ =3D *append++) !=3D 0) - ; - return(save); -} - -UINTN -wcslen( - CHAR16 *str - ) -{ - CHAR16 *s; - - for (s =3D str; *s; ++s) - ; - return (UINTN)(s - str); -} - -CHAR16 * -wcscpy( - CHAR16 *to, - CHAR16 *from - ) -{ - CHAR16 *save; - - save =3D to; - for (; (*to =3D *from) !=3D 0; ++from, ++to) - ; - return(save); + return (str =3D=3D NULL) ? NULL : AllocateCopyPool (AsciiStrSize (str), = str); } =20 CHAR16 * -wcsdup ( +UnicodeDuplicateString ( CHAR16 *str ) { - CHAR16 *copy; - - if (str !=3D NULL) { - copy =3D calloc(wcslen(str) + 1, sizeof(CHAR16)); - if (copy !=3D NULL) - return wcscpy(copy, str); - } - return NULL; -} - -CHAR16 * -wcschr( - CHAR16 *p, - INTN ch - ) -{ - for (;; ++p) { - if (*p =3D=3D ch) - return((CHAR16 *)p); - if (!*p) - return((CHAR16 *)NULL); - } - /* NOTREACHED */ + return (str =3D=3D NULL) ? NULL : AllocateCopyPool (StrSize (str), str); } =20 -UINTN -wcstombs( +INTN +TestProfile_wcstombs( CHAR8 *s, CHAR16 *pwcs, UINTN n ) { - UINTN cnt; - - cnt =3D 0; - if (!pwcs || !s) - return (UINTN)-1; + EFI_STATUS Status; =20 - while (n-- > 0) { - *s =3D (CHAR8) (*pwcs++ & 0x00ff); - if (*s++ =3D=3D 0) { - break; - } - ++cnt; + Status =3D UnicodeStrToAsciiStrS(pwcs, s, n); + if (EFI_ERROR (Status)) { + return -1; } - return (cnt); + return AsciiStrnLenS (s, n); } =20 -UINTN -mbstowcs( +INTN +TestProfile_mbstowcs( CHAR16 *pwcs, CHAR8 *s, UINTN n ) { - UINTN cnt; - - cnt =3D 0; - if (!pwcs || !s) - return (UINTN)-1; + EFI_STATUS Status; =20 - while (n-- > 0) { - *pwcs =3D (CHAR16)(*s++ & 0x00ff); - if (*pwcs++ =3D=3D 0) { - break; - } - ++cnt; + Status =3D AsciiStrToUnicodeStrS(s, pwcs, n); + if (EFI_ERROR (Status)) { + return -1; } - return (cnt); + return StrnLenS (pwcs, n); } =20 VOID @@ -435,15 +162,15 @@ Routine Description: ptrCur =3D IniFile->Head; =20 while (ptrCur !=3D NULL) { - free (ptrCur->ptrSection); - free (ptrCur->ptrEntry); - free (ptrCur->ptrValue); + FreePool (ptrCur->ptrSection); + FreePool (ptrCur->ptrEntry); + FreePool (ptrCur->ptrValue); ptrCur =3D ptrCur->ptrNext; } =20 while (IniFile->Head !=3D NULL) { ptrTmp =3D IniFile->Head->ptrNext; - free (IniFile->Head); + FreePool (IniFile->Head); IniFile->Head =3D ptrTmp; } IniFile->Tail =3D NULL; @@ -451,13 +178,13 @@ Routine Description: ptrCommentCur =3D IniFile->CommentLineHead; =20 while (ptrCommentCur !=3D NULL) { - free (ptrCommentCur->ptrComment); + FreePool (ptrCommentCur->ptrComment); ptrCommentCur =3D ptrCommentCur->ptrNext; } =20 while (IniFile->CommentLineHead !=3D NULL) { ptrCommentTmp =3D IniFile->CommentLineHead->ptrNext; - free (IniFile->CommentLineHead); + FreePool (IniFile->CommentLineHead); IniFile->CommentLineHead =3D ptrCommentTmp; } } @@ -484,7 +211,7 @@ Routine Description: // // skip '\n' & '\r' at end of comment line // - Length =3D (UINT32) strlen (ptrStr); + Length =3D (UINT32) AsciiStrLen (ptrStr); for (Index =3D Length; Index > 0; Index --) { if (ptrStr[Index - 1] !=3D '\n' && ptrStr[Index - 1] !=3D '\r') { break; @@ -492,11 +219,11 @@ Routine Description: } ptrStr[Index] =3D '\0'; =20 - ptrCommentLineNew =3D (COMMENTLINE *) malloc (sizeof(COMMENTLINE)); - ptrCommentLineNew->ptrComment =3D (CHAR8 *) calloc (strlen(ptrStr) + 1, = sizeof(CHAR8)); + ptrCommentLineNew =3D (COMMENTLINE *) AllocatePool (sizeof(COMMENTLINE)); + ptrCommentLineNew->ptrComment =3D (CHAR8 *) AllocateZeroPool (AsciiStrLe= n(ptrStr) + 1); =20 ptrCommentLineNew->commentNo =3D *commentNo; - strcpy (ptrCommentLineNew->ptrComment, ptrStr); + AsciiStrCpy (ptrCommentLineNew->ptrComment, ptrStr); =20 if (IniFile->CommentLineHead =3D=3D NULL) { IniFile->CommentLineHead =3D ptrCommentLineNew; @@ -534,7 +261,7 @@ Routine Description: // // skip '\n' & ' ' & '\r' at end of string // - Length =3D (UINT32) strlen (tmp); + Length =3D (UINT32) AsciiStrLen (tmp); for (Index =3D Length; Index > 0; Index --) { if (tmp[Index - 1] !=3D '\n' && tmp[Index - 1] !=3D ' ' && tmp[Index -= 1] !=3D '\r') { break; @@ -542,7 +269,7 @@ Routine Description: } =20 tmp[Index] =3D '\0'; - strcpy (ptrStr, tmp); + AsciiStrCpy (ptrStr, tmp); =20 return ptrStr; } @@ -590,34 +317,34 @@ Routine Description: CHAR8 *p, *q; INI *ptrItem; =20 - p =3D strchr (ptrStr, '['); - q =3D strchr (ptrStr, ']'); + p =3D AsciiStrStr (ptrStr, "["); + q =3D AsciiStrStr (ptrStr, "]"); =20 *q =3D '\0' ; =20 _alltrim (++p); =20 - if (strlen (p) <=3D MAX_STRING_LEN) { + if (AsciiStrLen (p) <=3D MAX_STRING_LEN) { if (*p =3D=3D '\0') { - strcpy (ptrSection, "UNKNOWN"); + AsciiStrCpy (ptrSection, "UNKNOWN"); } else { - strcpy (ptrSection, p); + AsciiStrCpy (ptrSection, p); } } else { - strncpy (ptrSection, p, MAX_STRING_LEN); + AsciiStrnCpy (ptrSection, p, MAX_STRING_LEN); ptrSection[MAX_STRING_LEN] =3D '\0'; } =20 - ptrItem =3D (INI *)malloc (sizeof(INI)); + ptrItem =3D (INI *)AllocatePool (sizeof(INI)); =20 - ptrItem->ptrSection =3D (CHAR8 *) calloc (strlen(ptrSection) + 1, sizeof= (CHAR8)); - ptrItem->ptrEntry =3D (CHAR8 *) calloc (1, sizeof(CHAR8)); - ptrItem->ptrValue =3D (CHAR8 *) calloc (1, sizeof(CHAR8)); + ptrItem->ptrSection =3D (CHAR8 *) AllocateZeroPool (AsciiStrLen(ptrSecti= on) + 1); + ptrItem->ptrEntry =3D (CHAR8 *) AllocateZeroPool (1); + ptrItem->ptrValue =3D (CHAR8 *) AllocateZeroPool (1); =20 ptrItem->commentNo =3D *commentNo; - strcpy (ptrItem->ptrSection, ptrSection); - strcpy (ptrItem->ptrEntry, ""); - strcpy (ptrItem->ptrValue, ""); + AsciiStrCpy (ptrItem->ptrSection, ptrSection); + AsciiStrCpy (ptrItem->ptrEntry, ""); + AsciiStrCpy (ptrItem->ptrValue, ""); =20 (*commentNo) ++; =20 @@ -639,38 +366,35 @@ Routine Description: --*/ { CHAR8 *p, *p2; - UINTN Len; =20 - p =3D strchr (ptrStr, '=3D'); + p =3D AsciiStrStr (ptrStr, "=3D"); =20 *p =3D '\0'; =20 _alltrim (ptrStr); =20 - if (strlen (ptrStr) <=3D MAX_STRING_LEN) { + if (AsciiStrLen (ptrStr) <=3D MAX_STRING_LEN) { if (*ptrStr =3D=3D '\0') { - strcpy (ptrEntry, "UNKNOWN"); + AsciiStrCpy (ptrEntry, "UNKNOWN"); } else { - strcpy (ptrEntry, ptrStr); + AsciiStrCpy (ptrEntry, ptrStr); } } else { - strncpy (ptrEntry, ptrStr, MAX_STRING_LEN); + AsciiStrnCpy (ptrEntry, ptrStr, MAX_STRING_LEN); ptrEntry[MAX_STRING_LEN] =3D '\0'; } =20 _alltrim (++ p); - p2 =3D strchr (p, '#'); + p2 =3D AsciiStrStr (p, "#"); if (p2 !=3D NULL) { *p2 =3D '\0'; _alltrim (p); } =20 - Len =3D strlen (p); - - if (strlen (p) <=3D MAX_STRING_LEN) { - strcpy (ptrValue, p); + if (AsciiStrLen (p) <=3D MAX_STRING_LEN) { + AsciiStrCpy (ptrValue, p); } else { - strncpy (ptrValue, p, MAX_STRING_LEN); + AsciiStrnCpy (ptrValue, p, MAX_STRING_LEN); ptrValue[MAX_STRING_LEN] =3D '\0'; } } @@ -695,28 +419,28 @@ Routine Description: CHAR8 ptrValue[MAX_STRING_LEN + 1]; INI *ptrItem; =20 - strcpy (ptrLine, _alltrim (ptrLine)); + AsciiStrCpy (ptrLine, _alltrim (ptrLine)); =20 if (*ptrLine =3D=3D '#') { // it's a comment line _getcomment (IniFile, ptrLine, commentNo); - } else if ((*ptrLine =3D=3D '[') && (strchr (ptrLine, ']') !=3D NULL)) { + } else if ((*ptrLine =3D=3D '[') && (AsciiStrStr (ptrLine, "]") !=3D NUL= L)) { // it's a section head _getsection (IniFile, ptrLine, ptrSection, commentNo); *isSectionGot =3D TRUE; - } else if (strchr (ptrLine, '=3D') !=3D NULL) { + } else if (AsciiStrStr (ptrLine, "=3D") !=3D NULL) { _getentry (ptrLine, ptrEntry, ptrValue); =20 if (*isSectionGot =3D=3D TRUE) { - ptrItem =3D (INI *)malloc (sizeof(INI)); - ptrItem->ptrSection =3D (CHAR8 *) calloc (strlen(ptrSection) + 1, si= zeof(CHAR8)); - ptrItem->ptrEntry =3D (CHAR8 *) calloc (strlen(ptrEntry) + 1, size= of(CHAR8)); - ptrItem->ptrValue =3D (CHAR8 *) calloc (strlen(ptrValue) + 1, size= of(CHAR8)); + ptrItem =3D (INI *)AllocatePool (sizeof(INI)); + ptrItem->ptrSection =3D (CHAR8 *) AllocateZeroPool (AsciiStrLen(ptrS= ection) + 1); + ptrItem->ptrEntry =3D (CHAR8 *) AllocateZeroPool (AsciiStrLen(ptrE= ntry) + 1); + ptrItem->ptrValue =3D (CHAR8 *) AllocateZeroPool (AsciiStrLen(ptrV= alue) + 1); =20 ptrItem->commentNo =3D *commentNo; - strcpy (ptrItem->ptrSection, ptrSection); - strcpy (ptrItem->ptrEntry, ptrEntry); - strcpy (ptrItem->ptrValue, ptrValue); + AsciiStrCpy (ptrItem->ptrSection, ptrSection); + AsciiStrCpy (ptrItem->ptrEntry, ptrEntry); + AsciiStrCpy (ptrItem->ptrValue, ptrValue); =20 (*commentNo) ++; =20 @@ -770,7 +494,7 @@ Routine Description: CurOrder =3D 0; ptrCur =3D Head; while (ptrCur !=3D NULL) { - if (stricmp (Section, ptrCur->ptrSection) =3D=3D 0) { + if (AsciiStriCmp (Section, ptrCur->ptrSection) =3D=3D 0) { if (CurOrder =3D=3D Order) { break; } @@ -796,18 +520,18 @@ Routine Description: --*/ { if (ptrItem->ptrSection !=3D NULL) { - free (ptrItem->ptrSection); + FreePool (ptrItem->ptrSection); ptrItem->ptrSection =3D NULL; } if (ptrItem->ptrEntry !=3D NULL) { - free (ptrItem->ptrEntry); + FreePool (ptrItem->ptrEntry); ptrItem->ptrEntry =3D NULL; } if (ptrItem->ptrValue !=3D NULL) { - free (ptrItem->ptrValue); + FreePool (ptrItem->ptrValue); ptrItem->ptrValue =3D NULL; } - free (ptrItem); + FreePool (ptrItem); } =20 VOID @@ -825,8 +549,8 @@ _rmComment ( while (ptrCmtCur !=3D NULL) { if (ptrCmtCur->commentNo =3D=3D ptrItem->commentNo) { ptrCmtNext =3D ptrCmtCur->ptrNext; - free (ptrCmtCur->ptrComment); - free (ptrCmtCur); + FreePool (ptrCmtCur->ptrComment); + FreePool (ptrCmtCur); if (ptrCmtPrev =3D=3D NULL) { *CmtHead =3D ptrCmtNext; } else { @@ -919,27 +643,27 @@ Returns: return EFI_INVALID_PARAMETER; } =20 - wcscpy (String, L""); + StrCpy (String, L""); =20 - if (wcslen (Section) > MAX_STRING_LEN || wcslen(Entry) > MAX_STRING_LEN)= { + if (StrLen (Section) > MAX_STRING_LEN || StrLen(Entry) > MAX_STRING_LEN)= { return EFI_INVALID_PARAMETER; } =20 - if (wcstombs (ptrSection, Section, MAX_STRING_LEN + 1) =3D=3D -1) { + if (TestProfile_wcstombs (ptrSection, Section, MAX_STRING_LEN + 1) =3D= =3D -1) { return EFI_INVALID_PARAMETER; } =20 - if (wcstombs (ptrEntry, Entry, MAX_STRING_LEN + 1) =3D=3D -1) { + if (TestProfile_wcstombs (ptrEntry, Entry, MAX_STRING_LEN + 1) =3D=3D -1= ) { return EFI_INVALID_PARAMETER; } =20 - strcpy (tmpSection, ptrSection); + AsciiStrCpy (tmpSection, ptrSection); _alltrim (tmpSection); =20 - strcpy (tmpEntry, ptrEntry); + AsciiStrCpy (tmpEntry, ptrEntry); _alltrim (tmpEntry); =20 - if (strlen (tmpSection) =3D=3D 0 || strlen (tmpEntry) =3D=3D 0) { + if (AsciiStrLen (tmpSection) =3D=3D 0 || AsciiStrLen (tmpEntry) =3D=3D 0= ) { return EFI_INVALID_PARAMETER; } =20 @@ -956,17 +680,17 @@ Returns: // // the same, so find the field // - if ((stricmp (tmpSection, ptrCur->ptrSection) =3D=3D 0) && - (stricmp (tmpEntry, ptrCur->ptrEntry) =3D=3D 0)) { - if (strlen (ptrCur->ptrValue) < *maxLength) { - strcpy (ptrString, ptrCur->ptrValue); - mbstowcs (String, ptrString, strlen(ptrString) + 1); + if ((AsciiStriCmp (tmpSection, ptrCur->ptrSection) =3D=3D 0) && + (AsciiStriCmp (tmpEntry, ptrCur->ptrEntry) =3D=3D 0)) { + if (AsciiStrLen (ptrCur->ptrValue) < *maxLength) { + AsciiStrCpy (ptrString, ptrCur->ptrValue); + TestProfile_mbstowcs (String, ptrString, AsciiStrLen(ptrString) + = 1); return EFI_SUCCESS; } else { - strncpy (ptrString, ptrCur->ptrValue, *maxLength - 1); + AsciiStrnCpy (ptrString, ptrCur->ptrValue, *maxLength - 1); ptrString[*maxLength-1] =3D '\0'; - mbstowcs (String, ptrString, strlen(ptrString) + 1); - *maxLength =3D (UINT32) (strlen (ptrCur->ptrValue) + 1); + TestProfile_mbstowcs (String, ptrString, AsciiStrLen(ptrString) + = 1); + *maxLength =3D (UINT32) (AsciiStrLen (ptrCur->ptrValue) + 1); return EFI_BUFFER_TOO_SMALL; } } @@ -1030,35 +754,35 @@ Returns: return EFI_INVALID_PARAMETER; } =20 - if (wcslen (Section) > MAX_STRING_LEN || - wcslen (Entry) > MAX_STRING_LEN || - wcslen (String) > MAX_STRING_LEN) { + if (StrLen (Section) > MAX_STRING_LEN || + StrLen (Entry) > MAX_STRING_LEN || + StrLen (String) > MAX_STRING_LEN) { return EFI_INVALID_PARAMETER; } =20 - if (wcstombs (ptrSection, Section, MAX_STRING_LEN + 1) =3D=3D -1) { + if (TestProfile_wcstombs (ptrSection, Section, MAX_STRING_LEN + 1) =3D= =3D -1) { return EFI_INVALID_PARAMETER; } =20 - if (wcstombs (ptrEntry, Entry, MAX_STRING_LEN + 1) =3D=3D -1) { + if (TestProfile_wcstombs (ptrEntry, Entry, MAX_STRING_LEN + 1) =3D=3D -1= ) { return EFI_INVALID_PARAMETER; } =20 - strcpy (tmpSection, ptrSection); + AsciiStrCpy (tmpSection, ptrSection); _alltrim (tmpSection); =20 - strcpy (tmpEntry, ptrEntry); + AsciiStrCpy (tmpEntry, ptrEntry); _alltrim (tmpEntry); =20 - if (strlen (tmpSection) =3D=3D 0 || strlen (tmpEntry) =3D=3D 0) { + if (AsciiStrLen (tmpSection) =3D=3D 0 || AsciiStrLen (tmpEntry) =3D=3D 0= ) { return EFI_INVALID_PARAMETER; } =20 - if (wcstombs (ptrString, String, MAX_STRING_LEN + 1) =3D=3D -1) { + if (TestProfile_wcstombs (ptrString, String, MAX_STRING_LEN + 1) =3D=3D = -1) { return EFI_INVALID_PARAMETER; } =20 - strcpy (tmpString, ptrString); + AsciiStrCpy (tmpString, ptrString); _alltrim (tmpString); =20 // @@ -1067,14 +791,14 @@ Returns: ptrCur =3D Private->Head; ptrPrev =3D NULL; while (ptrCur !=3D NULL) { - if (stricmp (tmpSection, ptrCur->ptrSection) =3D=3D 0) { - if (stricmp (tmpEntry, ptrCur->ptrEntry) =3D=3D 0) { - if (stricmp (tmpString, ptrCur->ptrValue) !=3D 0) { - tmpPtr =3D strdup (tmpString); + if (AsciiStriCmp (tmpSection, ptrCur->ptrSection) =3D=3D 0) { + if (AsciiStriCmp (tmpEntry, ptrCur->ptrEntry) =3D=3D 0) { + if (AsciiStriCmp (tmpString, ptrCur->ptrValue) !=3D 0) { + tmpPtr =3D AsciiDuplicateString (tmpString); if (tmpPtr =3D=3D NULL) { return EFI_OUT_OF_RESOURCES; } - free (ptrCur->ptrValue); + FreePool (ptrCur->ptrValue); ptrCur->ptrValue =3D tmpPtr; Private->Modified =3D TRUE; } @@ -1088,22 +812,21 @@ Returns: // // if not, should add a new item // - ptrNew =3D (INI *) malloc (sizeof(INI)); - TestProfile_memset (ptrNew, 0, sizeof(INI)); + ptrNew =3D (INI *) AllocateZeroPool (sizeof(INI)); if (ptrNew =3D=3D NULL) { return EFI_OUT_OF_RESOURCES; } - ptrNew->ptrSection =3D strdup (tmpSection); + ptrNew->ptrSection =3D AsciiDuplicateString (tmpSection); if (ptrNew->ptrSection =3D=3D NULL) { _freeItem (ptrNew); return EFI_OUT_OF_RESOURCES; } - ptrNew->ptrEntry =3D strdup (tmpEntry); + ptrNew->ptrEntry =3D AsciiDuplicateString (tmpEntry); if (ptrNew->ptrEntry =3D=3D NULL) { _freeItem (ptrNew); return EFI_OUT_OF_RESOURCES; } - ptrNew->ptrValue =3D strdup (tmpString); + ptrNew->ptrValue =3D AsciiDuplicateString (tmpString); if (ptrNew->ptrValue =3D=3D NULL) { _freeItem (ptrNew) ; return EFI_OUT_OF_RESOURCES; @@ -1128,24 +851,23 @@ Returns: // ptrCur =3D ptrNew; =20 - ptrNew =3D (INI *) malloc (sizeof(INI)); - TestProfile_memset (ptrNew, 0, sizeof(INI)); + ptrNew =3D (INI *) AllocateZeroPool (sizeof(INI)); if (ptrNew =3D=3D NULL) { return EFI_OUT_OF_RESOURCES; } - ptrNew->ptrSection =3D strdup (tmpSection); + ptrNew->ptrSection =3D AsciiDuplicateString (tmpSection); if (ptrNew->ptrSection =3D=3D NULL) { _freeItem (ptrNew); _freeItem (ptrCur); return EFI_OUT_OF_RESOURCES; } - ptrNew->ptrEntry =3D strdup (""); + ptrNew->ptrEntry =3D AsciiDuplicateString (""); if (ptrNew->ptrEntry =3D=3D NULL) { _freeItem (ptrNew); _freeItem (ptrCur); return EFI_OUT_OF_RESOURCES; } - ptrNew->ptrValue =3D strdup (""); + ptrNew->ptrValue =3D AsciiDuplicateString (""); if (ptrNew->ptrValue =3D=3D NULL) { _freeItem (ptrNew); _freeItem (ptrCur); @@ -1205,16 +927,16 @@ Returns: return EFI_INVALID_PARAMETER; } =20 - if (wcstombs (ptrSection, Section, MAX_STRING_LEN + 1) =3D=3D -1) { + if (TestProfile_wcstombs (ptrSection, Section, MAX_STRING_LEN + 1) =3D= =3D -1) { return EFI_INVALID_PARAMETER; } - strcpy (tmpSection, ptrSection); + AsciiStrCpy (tmpSection, ptrSection); _alltrim (tmpSection); =20 ptrCur =3D Private->Head; ptrPrev =3D NULL; while (ptrCur !=3D NULL) { - if (stricmp (tmpSection, ptrCur->ptrSection) =3D=3D 0) { + if (AsciiStriCmp (tmpSection, ptrCur->ptrSection) =3D=3D 0) { Private->Modified =3D TRUE; _rmComment (&(Private->CommentLineHead), ptrCur); ptrNext =3D ptrCur->ptrNext; @@ -1296,27 +1018,27 @@ Returns: return EFI_INVALID_PARAMETER; } =20 - wcscpy (String, L""); + StrCpy (String, L""); =20 - if (wcslen (Section) > MAX_STRING_LEN || wcslen (Entry) > MAX_STRING_LEN= ) { + if (StrLen (Section) > MAX_STRING_LEN || StrLen (Entry) > MAX_STRING_LEN= ) { return EFI_INVALID_PARAMETER; } =20 - if (wcstombs (ptrSection, Section, MAX_STRING_LEN + 1) =3D=3D -1) { + if (TestProfile_wcstombs (ptrSection, Section, MAX_STRING_LEN + 1) =3D= =3D -1) { return EFI_INVALID_PARAMETER; } =20 - if (wcstombs (ptrEntry, Entry, MAX_STRING_LEN + 1) =3D=3D -1) { + if (TestProfile_wcstombs (ptrEntry, Entry, MAX_STRING_LEN + 1) =3D=3D -1= ) { return EFI_INVALID_PARAMETER; } =20 - strcpy (tmpSection, ptrSection); + AsciiStrCpy (tmpSection, ptrSection); _alltrim (tmpSection); =20 - strcpy (tmpEntry, ptrEntry); + AsciiStrCpy (tmpEntry, ptrEntry); _alltrim (tmpEntry); =20 - if (strlen (tmpSection) =3D=3D 0 || strlen (tmpEntry) =3D=3D 0) { + if (AsciiStrLen (tmpSection) =3D=3D 0 || AsciiStrLen (tmpEntry) =3D=3D 0= ) { return EFI_INVALID_PARAMETER; } =20 @@ -1341,17 +1063,17 @@ Returns: // break; } - if ((stricmp (tmpSection, ptrCur->ptrSection) =3D=3D 0) && - (stricmp (tmpEntry, ptrCur->ptrEntry) =3D=3D 0)) { - if (strlen (ptrCur->ptrValue) < *maxLength) { - strcpy (ptrString, ptrCur->ptrValue); - mbstowcs (String, ptrString, strlen(ptrString) + 1); + if ((AsciiStriCmp (tmpSection, ptrCur->ptrSection) =3D=3D 0) && + (AsciiStriCmp (tmpEntry, ptrCur->ptrEntry) =3D=3D 0)) { + if (AsciiStrLen (ptrCur->ptrValue) < *maxLength) { + AsciiStrCpy (ptrString, ptrCur->ptrValue); + TestProfile_mbstowcs (String, ptrString, AsciiStrLen(ptrString) + = 1); return EFI_SUCCESS; } else { - strncpy (ptrString, ptrCur->ptrValue, *maxLength - 1); + AsciiStrnCpy (ptrString, ptrCur->ptrValue, *maxLength - 1); ptrString[*maxLength-1] =3D '\0'; - mbstowcs (String, ptrString, strlen(ptrString) + 1 ); - *maxLength =3D (UINT32) (strlen (ptrCur->ptrValue) + 1); + TestProfile_mbstowcs (String, ptrString, AsciiStrLen(ptrString) + = 1 ); + *maxLength =3D (UINT32) (AsciiStrLen (ptrCur->ptrValue) + 1); return EFI_BUFFER_TOO_SMALL; } } @@ -1417,35 +1139,35 @@ Returns: return EFI_INVALID_PARAMETER; } =20 - if (wcslen (Section) > MAX_STRING_LEN || - wcslen (Entry) > MAX_STRING_LEN || - wcslen (String) > MAX_STRING_LEN) { + if (StrLen (Section) > MAX_STRING_LEN || + StrLen (Entry) > MAX_STRING_LEN || + StrLen (String) > MAX_STRING_LEN) { return EFI_INVALID_PARAMETER; } =20 - if (wcstombs (ptrSection, Section, MAX_STRING_LEN + 1) =3D=3D -1) { + if (TestProfile_wcstombs (ptrSection, Section, MAX_STRING_LEN + 1) =3D= =3D -1) { return EFI_INVALID_PARAMETER; } =20 - if (wcstombs (ptrEntry, Entry, MAX_STRING_LEN + 1) =3D=3D -1) { + if (TestProfile_wcstombs (ptrEntry, Entry, MAX_STRING_LEN + 1) =3D=3D -1= ) { return EFI_INVALID_PARAMETER; } =20 - strcpy (tmpSection, ptrSection); + AsciiStrCpy (tmpSection, ptrSection); _alltrim (tmpSection); =20 - strcpy (tmpEntry, ptrEntry); + AsciiStrCpy (tmpEntry, ptrEntry); _alltrim (tmpEntry); =20 - if (strlen (tmpSection) =3D=3D 0 || strlen (tmpEntry) =3D=3D 0) { + if (AsciiStrLen (tmpSection) =3D=3D 0 || AsciiStrLen (tmpEntry) =3D=3D 0= ) { return EFI_INVALID_PARAMETER; } =20 - if (wcstombs (ptrString, String, MAX_STRING_LEN + 1) =3D=3D -1) { + if (TestProfile_wcstombs (ptrString, String, MAX_STRING_LEN + 1) =3D=3D = -1) { return EFI_INVALID_PARAMETER; } =20 - strcpy (tmpString, ptrString); + AsciiStrCpy (tmpString, ptrString); _alltrim (tmpString); =20 // @@ -1463,14 +1185,14 @@ Returns: // break; } - if ((stricmp (tmpSection, ptrCur->ptrSection ) =3D=3D 0) && - (stricmp (tmpEntry, ptrCur->ptrEntry ) =3D=3D 0)) { - if (stricmp( tmpString, ptrCur->ptrValue) !=3D 0) { - tmpPtr =3D strdup (tmpString); + if ((AsciiStriCmp (tmpSection, ptrCur->ptrSection ) =3D=3D 0) && + (AsciiStriCmp (tmpEntry, ptrCur->ptrEntry ) =3D=3D 0)) { + if (AsciiStriCmp( tmpString, ptrCur->ptrValue) !=3D 0) { + tmpPtr =3D AsciiDuplicateString (tmpString); if (tmpPtr =3D=3D NULL) { return EFI_OUT_OF_RESOURCES; } - free (ptrCur->ptrValue); + FreePool (ptrCur->ptrValue); ptrCur->ptrValue =3D tmpPtr; Private->Modified =3D TRUE; } @@ -1483,22 +1205,21 @@ Returns: // // if not, should add a new item // - ptrNew =3D (INI *) malloc(sizeof(INI)); - TestProfile_memset (ptrNew, 0, sizeof(INI)); + ptrNew =3D (INI *) AllocateZeroPool (sizeof(INI)); if (ptrNew =3D=3D NULL) { return EFI_OUT_OF_RESOURCES; } - ptrNew->ptrSection =3D strdup (tmpSection); + ptrNew->ptrSection =3D AsciiDuplicateString (tmpSection); if (ptrNew->ptrSection =3D=3D NULL) { _freeItem (ptrNew); return EFI_OUT_OF_RESOURCES; } - ptrNew->ptrEntry =3D strdup (tmpEntry); + ptrNew->ptrEntry =3D AsciiDuplicateString (tmpEntry); if (ptrNew->ptrEntry =3D=3D NULL) { _freeItem (ptrNew); return EFI_OUT_OF_RESOURCES; } - ptrNew->ptrValue =3D strdup (tmpString); + ptrNew->ptrValue =3D AsciiDuplicateString (tmpString); if (ptrNew->ptrValue =3D=3D NULL) { _freeItem (ptrNew); return EFI_OUT_OF_RESOURCES; @@ -1523,24 +1244,23 @@ Returns: // ptrCur =3D ptrNew; =20 - ptrNew =3D (INI *)malloc (sizeof(INI)); - TestProfile_memset (ptrNew, 0, sizeof(INI)); + ptrNew =3D (INI *) AllocateZeroPool (sizeof(INI)); if (ptrNew =3D=3D NULL) { return EFI_OUT_OF_RESOURCES; } - ptrNew->ptrSection =3D strdup (tmpSection); + ptrNew->ptrSection =3D AsciiDuplicateString (tmpSection); if ( ptrNew->ptrSection =3D=3D NULL ) { _freeItem (ptrNew); _freeItem (ptrCur); return EFI_OUT_OF_RESOURCES; } - ptrNew->ptrEntry =3D strdup (""); + ptrNew->ptrEntry =3D AsciiDuplicateString (""); if ( ptrNew->ptrEntry =3D=3D NULL ) { _freeItem (ptrNew); _freeItem (ptrCur); return EFI_OUT_OF_RESOURCES; } - ptrNew->ptrValue =3D strdup (""); + ptrNew->ptrValue =3D AsciiDuplicateString (""); if ( ptrNew->ptrValue =3D=3D NULL ) { _freeItem (ptrNew); _freeItem (ptrCur); @@ -1603,10 +1323,10 @@ Returns: return EFI_INVALID_PARAMETER; } =20 - if (wcstombs (ptrSection, Section, MAX_STRING_LEN + 1) =3D=3D -1) { + if (TestProfile_wcstombs (ptrSection, Section, MAX_STRING_LEN + 1) =3D= =3D -1) { return EFI_INVALID_PARAMETER; } - strcpy (tmpSection, ptrSection); + AsciiStrCpy (tmpSection, ptrSection); _alltrim (tmpSection); =20 ptrSect =3D _searchSection (Private->Head, Order, tmpSection); @@ -1692,17 +1412,17 @@ Returns: return EFI_INVALID_PARAMETER; } =20 - if (wcstombs (ptrSection, Section, MAX_STRING_LEN + 1) =3D=3D -1) { + if (TestProfile_wcstombs (ptrSection, Section, MAX_STRING_LEN + 1) =3D= =3D -1) { return EFI_INVALID_PARAMETER; } =20 - strcpy (tmpSection, ptrSection); + AsciiStrCpy (tmpSection, ptrSection); _alltrim (tmpSection); =20 *OrderNum =3D 0; ptrCur =3D Private->Head; while (ptrCur !=3D NULL) { - if (stricmp (tmpSection, ptrCur->ptrSection) =3D=3D 0) { + if (AsciiStriCmp (tmpSection, ptrCur->ptrSection) =3D=3D 0) { ++ (*OrderNum); } =20 @@ -1835,7 +1555,7 @@ Returns: } =20 ptrCur =3D Private->Head ; - strcpy (ptrCurSection, ""); + AsciiStrCpy (ptrCurSection, ""); first =3D TRUE; =20 // @@ -1865,10 +1585,10 @@ Returns: if (first) { first =3D FALSE; } else { - strcpy (Buffer, "\r\n"); - BufSize =3D strlen (Buffer); + AsciiStrCpy (Buffer, "\r\n"); + BufSize =3D AsciiStrLen (Buffer); if (Private->isUnicode) { - mbstowcs ((CHAR16 *)Line, Buffer, BufSize + 1); + TestProfile_mbstowcs ((CHAR16 *)Line, Buffer, BufSize + 1); BufSize *=3D 2; Status =3D Handle->Write (Handle, &BufSize, Line); } else { @@ -1889,11 +1609,11 @@ Returns: while (ptrCmtCur !=3D NULL) { if (ptrCmtCur->commentNo =3D=3D ptrCur->commentNo) { commentNo =3D ptrCmtCur->commentNo; - strcpy (Buffer, ptrCmtCur->ptrComment); - strcat (Buffer, "\r\n"); - BufSize =3D strlen (Buffer); + AsciiStrCpy (Buffer, ptrCmtCur->ptrComment); + AsciiStrCat (Buffer, "\r\n"); + BufSize =3D AsciiStrLen (Buffer); if (Private->isUnicode) { - mbstowcs ((CHAR16 *)Line, Buffer, BufSize + 1); + TestProfile_mbstowcs ((CHAR16 *)Line, Buffer, BufSize + 1); BufSize *=3D 2; Status =3D Handle->Write (Handle, &BufSize, Line); } else { @@ -1912,13 +1632,13 @@ Returns: // // new section, write the section head // - strcpy (ptrCurSection, ptrCur->ptrSection); - strcpy (Buffer, "["); - strcat (Buffer, ptrCurSection); - strcat (Buffer, "]\r\n"); - BufSize =3D strlen (Buffer); + AsciiStrCpy (ptrCurSection, ptrCur->ptrSection); + AsciiStrCpy (Buffer, "["); + AsciiStrCat (Buffer, ptrCurSection); + AsciiStrCat (Buffer, "]\r\n"); + BufSize =3D AsciiStrLen (Buffer); if (Private->isUnicode) { - mbstowcs ((CHAR16 *)Line, Buffer, BufSize + 1); + TestProfile_mbstowcs ((CHAR16 *)Line, Buffer, BufSize + 1); BufSize *=3D 2; Status =3D Handle->Write (Handle, &BufSize, Line); } else { @@ -1933,13 +1653,13 @@ Returns: // // write the entry and value line // - strcpy (Buffer, ptrCur->ptrEntry); - strcat (Buffer, "=3D"); - strcat (Buffer, ptrCur->ptrValue); - strcat (Buffer, "\r\n"); - BufSize =3D strlen (Buffer); + AsciiStrCpy (Buffer, ptrCur->ptrEntry); + AsciiStrCat (Buffer, "=3D"); + AsciiStrCat (Buffer, ptrCur->ptrValue); + AsciiStrCat (Buffer, "\r\n"); + BufSize =3D AsciiStrLen (Buffer); if (Private->isUnicode) { - mbstowcs ((CHAR16 *)Line, Buffer, BufSize + 1); + TestProfile_mbstowcs ((CHAR16 *)Line, Buffer, BufSize + 1); BufSize *=3D 2; Status =3D Handle->Write (Handle, &BufSize, Line); } else { @@ -1962,11 +1682,11 @@ Returns: commentNo ++; while (ptrCmtCur !=3D NULL) { if (ptrCmtCur->commentNo >=3D commentNo) { - strcpy (Buffer, ptrCmtCur->ptrComment); - strcat (Buffer, "\r\n"); - BufSize =3D strlen (Buffer); + AsciiStrCpy (Buffer, ptrCmtCur->ptrComment); + AsciiStrCat (Buffer, "\r\n"); + BufSize =3D AsciiStrLen (Buffer); if (Private->isUnicode) { - mbstowcs ((CHAR16 *)Line, Buffer, BufSize + 1); + TestProfile_mbstowcs ((CHAR16 *)Line, Buffer, BufSize + 1); BufSize *=3D 2; Status =3D Handle->Write (Handle, &BufSize, Line); } else { @@ -2041,15 +1761,15 @@ Routine Description: IniFile->Handle.GetOrderNum =3D NULL; IniFile->Handle.Flush =3D NULL; if (IniFile->FileName !=3D NULL) { - free (IniFile->FileName); + FreePool (IniFile->FileName); IniFile->FileName =3D NULL; } if (IniFile->DevPath !=3D NULL) { - free (IniFile->DevPath); + FreePool (IniFile->DevPath); IniFile->DevPath =3D NULL; } _freePointer(IniFile); - free (IniFile); + FreePool (IniFile); } =20 EFI_STATUS @@ -2104,20 +1824,20 @@ Returns: return EFI_INVALID_PARAMETER; } =20 - if (wcslen (FileName) > MAX_STRING_LEN) { + if (StrLen (FileName) > MAX_STRING_LEN) { return EFI_INVALID_PARAMETER; } =20 // // New and initialize a ini file // - NewIniFile =3D malloc (sizeof(EFI_INI_FILE_PRIVATE_DATA)); + NewIniFile =3D AllocatePool (sizeof(EFI_INI_FILE_PRIVATE_DATA)); if (NewIniFile =3D=3D NULL) { return EFI_OUT_OF_RESOURCES; } _initFile (NewIniFile); =20 - NewIniFile->FileName =3D wcsdup (FileName); + NewIniFile->FileName =3D UnicodeDuplicateString (FileName); if ( NewIniFile->FileName =3D=3D NULL ) { _freeIniFile (NewIniFile); return EFI_OUT_OF_RESOURCES; @@ -2324,20 +2044,20 @@ Returns: return EFI_INVALID_PARAMETER; } =20 - if (wcslen (FileName) > MAX_STRING_LEN) { + if (StrLen (FileName) > MAX_STRING_LEN) { return EFI_INVALID_PARAMETER; } =20 // // New and initialize a ini file // - NewIniFile =3D malloc (sizeof(EFI_INI_FILE_PRIVATE_DATA)); + NewIniFile =3D AllocatePool (sizeof(EFI_INI_FILE_PRIVATE_DATA)); if (NewIniFile =3D=3D NULL) { return EFI_OUT_OF_RESOURCES; } _initFile (NewIniFile); =20 - NewIniFile->FileName =3D wcsdup (FileName); + NewIniFile->FileName =3D UnicodeDuplicateString (FileName); if ( NewIniFile->FileName =3D=3D NULL ) { _freeIniFile (NewIniFile); return EFI_OUT_OF_RESOURCES; @@ -2735,6 +2455,7 @@ Returns: } =20 EFI_STATUS +EFIAPI TslInitUnload ( IN EFI_HANDLE ImageHandle ) @@ -2881,4 +2602,3 @@ Returns: =20 return Status; } - diff --git a/TestFrameworkPkg/Support/TestProfile/TestProfile.inf b/TestFra= meworkPkg/Support/TestProfile/TestProfile.inf index c8fc148..bb6c3f8 100644 --- a/TestFrameworkPkg/Support/TestProfile/TestProfile.inf +++ b/TestFrameworkPkg/Support/TestProfile/TestProfile.inf @@ -34,6 +34,7 @@ UefiBootServicesTableLib BaseLib BaseMemoryLib + MemoryAllocationLib DevicePathLib DebugLib =20 --=20 2.6.3.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel