From: Liming Gao Date: Wed, 27 Jun 2018 13:13:38 +0000 (+0800) Subject: ShellPkg: Clean up source files X-Git-Tag: edk2-stable201903~1496 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=ba0014b9f8ae1a593f03e744f26008214c2b06a8 ShellPkg: Clean up source files 1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao Reviewed-by: Ruiyu Ni --- diff --git a/ShellPkg/Application/Shell/ConsoleLogger.c b/ShellPkg/Application/Shell/ConsoleLogger.c index 074e0cf046..07e52f4231 100644 --- a/ShellPkg/Application/Shell/ConsoleLogger.c +++ b/ShellPkg/Application/Shell/ConsoleLogger.c @@ -990,7 +990,7 @@ ConsoleLoggerSetMode ( ConsoleInfo->CurrentStartRow = 0; ConsoleInfo->OurConOut.ClearScreen (&ConsoleInfo->OurConOut); } - + return Status; } diff --git a/ShellPkg/Application/Shell/ConsoleWrappers.c b/ShellPkg/Application/Shell/ConsoleWrappers.c index e1846ec9cb..a0861e6a1d 100644 --- a/ShellPkg/Application/Shell/ConsoleWrappers.c +++ b/ShellPkg/Application/Shell/ConsoleWrappers.c @@ -2,7 +2,7 @@ Function definitions for shell simple text in and out on top of file handles. (C) Copyright 2013 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -105,7 +105,7 @@ FileBasedSimpleTextInReadKeyStroke( CharSize = sizeof(CHAR16); } else { CharSize = sizeof(CHAR8); - } + } // // Decrement the amount of free space by Size or set to zero (for odd length files) // @@ -123,7 +123,7 @@ FileBasedSimpleTextInReadKeyStroke( } /** - Function to create a EFI_SIMPLE_TEXT_INPUT_PROTOCOL on top of a + Function to create a EFI_SIMPLE_TEXT_INPUT_PROTOCOL on top of a SHELL_FILE_HANDLE to support redirecting input from a file. @param[in] FileHandleToUse The pointer to the SHELL_FILE_HANDLE to use. @@ -162,7 +162,7 @@ CreateSimpleTextInOnFile( ProtocolToReturn->FileHandle = FileHandleToUse; ProtocolToReturn->SimpleTextIn.Reset = FileBasedSimpleTextInReset; ProtocolToReturn->SimpleTextIn.ReadKeyStroke = FileBasedSimpleTextInReadKeyStroke; - + Status = gBS->CreateEvent ( EVT_NOTIFY_WAIT, TPL_NOTIFY, @@ -177,9 +177,9 @@ CreateSimpleTextInOnFile( } ///@todo possibly also install SimpleTextInputEx on the handle at this point. Status = gBS->InstallProtocolInterface( - &(ProtocolToReturn->TheHandle), - &gEfiSimpleTextInProtocolGuid, - EFI_NATIVE_INTERFACE, + &(ProtocolToReturn->TheHandle), + &gEfiSimpleTextInProtocolGuid, + EFI_NATIVE_INTERFACE, &(ProtocolToReturn->SimpleTextIn)); if (!EFI_ERROR(Status)) { *HandleLocation = ProtocolToReturn->TheHandle; @@ -191,7 +191,7 @@ CreateSimpleTextInOnFile( } /** - Function to close a EFI_SIMPLE_TEXT_INPUT_PROTOCOL on top of a + Function to close a EFI_SIMPLE_TEXT_INPUT_PROTOCOL on top of a SHELL_FILE_HANDLE to support redirecting input from a file. @param[in] SimpleTextIn The pointer to the SimpleTextIn to close. @@ -213,8 +213,8 @@ CloseSimpleTextInOnFile( Status = gBS->CloseEvent(((SHELL_EFI_SIMPLE_TEXT_INPUT_PROTOCOL *)SimpleTextIn)->SimpleTextIn.WaitForKey); Status1 = gBS->UninstallProtocolInterface( - ((SHELL_EFI_SIMPLE_TEXT_INPUT_PROTOCOL*)SimpleTextIn)->TheHandle, - &gEfiSimpleTextInProtocolGuid, + ((SHELL_EFI_SIMPLE_TEXT_INPUT_PROTOCOL*)SimpleTextIn)->TheHandle, + &gEfiSimpleTextInProtocolGuid, &(((SHELL_EFI_SIMPLE_TEXT_INPUT_PROTOCOL*)SimpleTextIn)->SimpleTextIn)); FreePool(SimpleTextIn); @@ -283,9 +283,9 @@ FileBasedSimpleTextOutQueryMode ( ) { EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *PassThruProtocol; - + PassThruProtocol = ((SHELL_EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *)This)->OriginalSimpleTextOut; - + // Pass the QueryMode call thru to the original SimpleTextOutProtocol return (PassThruProtocol->QueryMode( PassThruProtocol, @@ -421,7 +421,7 @@ FileBasedSimpleTextOutOutputString ( } /** - Function to create a EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL on top of a + Function to create a EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL on top of a SHELL_FILE_HANDLE to support redirecting output from a file. @param[in] FileHandleToUse The pointer to the SHELL_FILE_HANDLE to use. @@ -473,9 +473,9 @@ CreateSimpleTextOutOnFile( ProtocolToReturn->SimpleTextOut.Mode->CursorVisible = OriginalProtocol->Mode->CursorVisible; Status = gBS->InstallProtocolInterface( - &(ProtocolToReturn->TheHandle), - &gEfiSimpleTextOutProtocolGuid, - EFI_NATIVE_INTERFACE, + &(ProtocolToReturn->TheHandle), + &gEfiSimpleTextOutProtocolGuid, + EFI_NATIVE_INTERFACE, &(ProtocolToReturn->SimpleTextOut)); if (!EFI_ERROR(Status)) { *HandleLocation = ProtocolToReturn->TheHandle; @@ -488,7 +488,7 @@ CreateSimpleTextOutOnFile( } /** - Function to close a EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL on top of a + Function to close a EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL on top of a SHELL_FILE_HANDLE to support redirecting output from a file. @param[in] SimpleTextOut The pointer to the SimpleTextOUT to close. @@ -505,8 +505,8 @@ CloseSimpleTextOutOnFile( return (EFI_INVALID_PARAMETER); } Status = gBS->UninstallProtocolInterface( - ((SHELL_EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL*)SimpleTextOut)->TheHandle, - &gEfiSimpleTextOutProtocolGuid, + ((SHELL_EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL*)SimpleTextOut)->TheHandle, + &gEfiSimpleTextOutProtocolGuid, &(((SHELL_EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL*)SimpleTextOut)->SimpleTextOut)); FreePool(SimpleTextOut->Mode); FreePool(SimpleTextOut); diff --git a/ShellPkg/Application/Shell/ConsoleWrappers.h b/ShellPkg/Application/Shell/ConsoleWrappers.h index 35f3a717f5..e1860b4112 100644 --- a/ShellPkg/Application/Shell/ConsoleWrappers.h +++ b/ShellPkg/Application/Shell/ConsoleWrappers.h @@ -2,7 +2,7 @@ Function definitions for shell simple text in and out on top of file handles. (C) Copyright 2013 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -17,7 +17,7 @@ #define _SHELL_CONSOLE_WRAPPERS_HEADER_ /** - Function to create a EFI_SIMPLE_TEXT_INPUT_PROTOCOL on top of a + Function to create a EFI_SIMPLE_TEXT_INPUT_PROTOCOL on top of a SHELL_FILE_HANDLE to support redirecting input from a file. @param[in] FileHandleToUse The pointer to the SHELL_FILE_HANDLE to use. @@ -33,7 +33,7 @@ CreateSimpleTextInOnFile( ); /** - Function to close a EFI_SIMPLE_TEXT_INPUT_PROTOCOL on top of a + Function to close a EFI_SIMPLE_TEXT_INPUT_PROTOCOL on top of a SHELL_FILE_HANDLE to support redirecting input from a file. @param[in] SimpleTextIn The pointer to the SimpleTextIn to close. @@ -46,7 +46,7 @@ CloseSimpleTextInOnFile( ); /** - Function to create a EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL on top of a + Function to create a EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL on top of a SHELL_FILE_HANDLE to support redirecting output from a file. @param[in] FileHandleToUse The pointer to the SHELL_FILE_HANDLE to use. @@ -64,7 +64,7 @@ CreateSimpleTextOutOnFile( ); /** - Function to close a EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL on top of a + Function to close a EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL on top of a SHELL_FILE_HANDLE to support redirecting output from a file. @param[in] SimpleTextOut The pointer to the SimpleTextOUT to close. diff --git a/ShellPkg/Application/Shell/FileHandleWrappers.c b/ShellPkg/Application/Shell/FileHandleWrappers.c index 63aad69fe8..8c62eb5862 100644 --- a/ShellPkg/Application/Shell/FileHandleWrappers.c +++ b/ShellPkg/Application/Shell/FileHandleWrappers.c @@ -21,14 +21,14 @@ #define MEM_WRITE_REALLOC_OVERHEAD 1024 /** - File style interface for console (Open). - + File style interface for console (Open). + @param[in] This Ignored. @param[out] NewHandle Ignored. @param[in] FileName Ignored. @param[in] OpenMode Ignored. @param[in] Attributes Ignored. - + @retval EFI_NOT_FOUND **/ EFI_STATUS @@ -46,9 +46,9 @@ FileInterfaceOpenNotFound( /** File style interface for console (Close, Delete, & Flush) - + @param[in] This Ignored. - + @retval EFI_SUCCESS **/ EFI_STATUS @@ -65,7 +65,7 @@ FileInterfaceNopGeneric( @param[in] This Ignored. @param[out] Position Ignored. - + @retval EFI_UNSUPPORTED **/ EFI_STATUS @@ -80,10 +80,10 @@ FileInterfaceNopGetPosition( /** File style interface for console (SetPosition). - + @param[in] This Ignored. @param[in] Position Ignored. - + @retval EFI_UNSUPPORTED **/ EFI_STATUS @@ -98,12 +98,12 @@ FileInterfaceNopSetPosition( /** File style interface for console (GetInfo). - + @param[in] This Ignored. @param[in] InformationType Ignored. @param[in, out] BufferSize Ignored. @param[out] Buffer Ignored. - + @retval EFI_UNSUPPORTED **/ EFI_STATUS @@ -120,12 +120,12 @@ FileInterfaceNopGetInfo( /** File style interface for console (SetInfo). - + @param[in] This Ignored. @param[in] InformationType Ignored. @param[in] BufferSize Ignored. @param[in] Buffer Ignored. - + @retval EFI_UNSUPPORTED **/ EFI_STATUS @@ -144,11 +144,11 @@ FileInterfaceNopSetInfo( File style interface for StdOut (Write). Writes data to the screen. - + @param[in] This The pointer to the EFI_FILE_PROTOCOL object. @param[in, out] BufferSize Size in bytes of Buffer. @param[in] Buffer The pointer to the buffer to write. - + @retval EFI_UNSUPPORTED No output console is supported. @return A return value from gST->ConOut->OutputString. **/ @@ -171,11 +171,11 @@ FileInterfaceStdOutWrite( /** File style interface for StdIn (Write). - + @param[in] This Ignored. @param[in, out] BufferSize Ignored. @param[in] Buffer Ignored. - + @retval EFI_UNSUPPORTED **/ EFI_STATUS @@ -193,11 +193,11 @@ FileInterfaceStdInWrite( File style interface for console StdErr (Write). Writes error to the error output. - + @param[in] This The pointer to the EFI_FILE_PROTOCOL object. @param[in, out] BufferSize Size in bytes of Buffer. @param[in] Buffer The pointer to the buffer to write. - + @return A return value from gST->StdErr->OutputString. **/ EFI_STATUS @@ -213,11 +213,11 @@ FileInterfaceStdErrWrite( /** File style interface for console StdOut (Read). - + @param[in] This Ignored. @param[in, out] BufferSize Ignored. @param[out] Buffer Ignored. - + @retval EFI_UNSUPPORTED **/ EFI_STATUS @@ -233,11 +233,11 @@ FileInterfaceStdOutRead( /** File style interface for console StdErr (Read). - + @param[in] This Ignored. @param[in, out] BufferSize Ignored. @param[out] Buffer Ignored. - + @retval EFI_UNSUPPORTED Always. **/ EFI_STATUS @@ -253,11 +253,11 @@ FileInterfaceStdErrRead( /** File style interface for NUL file (Read). - + @param[in] This Ignored. @param[in, out] BufferSize Poiner to 0 upon return. @param[out] Buffer Ignored. - + @retval EFI_SUCCESS Always. **/ EFI_STATUS @@ -274,11 +274,11 @@ FileInterfaceNulRead( /** File style interface for NUL file (Write). - + @param[in] This Ignored. @param[in, out] BufferSize Ignored. @param[in] Buffer Ignored. - + @retval EFI_SUCCESS **/ EFI_STATUS @@ -304,7 +304,7 @@ FileInterfaceNulWrite( EFI_STATUS CreateTabCompletionList ( IN CONST CHAR16 *InputString, - IN CONST UINTN StringLen, + IN CONST UINTN StringLen, IN CONST UINTN BufferSize, IN OUT EFI_SHELL_FILE_INFO **TabCompletionList, IN OUT UINTN *TabUpdatePos @@ -1025,9 +1025,9 @@ typedef struct { File style interface for Environment Variable (Close). Frees the memory for this object. - + @param[in] This The pointer to the EFI_FILE_PROTOCOL object. - + @retval EFI_SUCCESS **/ EFI_STATUS @@ -1043,8 +1043,8 @@ FileInterfaceEnvClose( UINTN TotalSize; // - // Most if not all UEFI commands will have an '\r\n' at the end of any output. - // Since the output was redirected to a variable, it does not make sense to + // Most if not all UEFI commands will have an '\r\n' at the end of any output. + // Since the output was redirected to a variable, it does not make sense to // keep this. So, before closing, strip the trailing '\r\n' from the variable // if it exists. // @@ -1063,12 +1063,12 @@ FileInterfaceEnvClose( NewBuffer = AllocateZeroPool (TotalSize); if (NewBuffer == NULL) { return EFI_OUT_OF_RESOURCES; - } + } Status = SHELL_GET_ENVIRONMENT_VARIABLE(((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name, &NewSize, NewBuffer); } - + if (!EFI_ERROR(Status) && NewBuffer != NULL) { - + if (TotalSize / sizeof (CHAR16) >= 3) { if ( (((CHAR16*)NewBuffer)[TotalSize / sizeof (CHAR16) - 2] == CHAR_LINEFEED) && (((CHAR16*)NewBuffer)[TotalSize / sizeof (CHAR16) - 3] == CHAR_CARRIAGE_RETURN) @@ -1112,8 +1112,8 @@ FileInterfaceEnvClose( } } } - } - + } + SHELL_FREE_NON_NULL(NewBuffer); FreePool((EFI_FILE_PROTOCOL_ENVIRONMENT*)This); return (Status); @@ -1121,9 +1121,9 @@ FileInterfaceEnvClose( /** File style interface for Environment Variable (Delete). - + @param[in] This The pointer to the EFI_FILE_PROTOCOL object. - + @retval The return value from FileInterfaceEnvClose(). **/ EFI_STATUS @@ -1138,11 +1138,11 @@ FileInterfaceEnvDelete( /** File style interface for Environment Variable (Read). - + @param[in] This The pointer to the EFI_FILE_PROTOCOL object. @param[in, out] BufferSize Size in bytes of Buffer. @param[out] Buffer The pointer to the buffer to fill. - + @retval EFI_SUCCESS The data was read. **/ EFI_STATUS @@ -1162,11 +1162,11 @@ FileInterfaceEnvRead( /** File style interface for Volatile Environment Variable (Write). This function also caches the environment variable into gShellEnvVarList. - + @param[in] This The pointer to the EFI_FILE_PROTOCOL object. @param[in, out] BufferSize Size in bytes of Buffer. @param[in] Buffer The pointer to the buffer to write. - + @retval EFI_SUCCESS The data was successfully write to variable. @retval SHELL_OUT_OF_RESOURCES A memory allocation failed. **/ @@ -1239,11 +1239,11 @@ FileInterfaceEnvVolWrite( /** File style interface for Non Volatile Environment Variable (Write). This function also caches the environment variable into gShellEnvVarList. - + @param[in] This The pointer to the EFI_FILE_PROTOCOL object. @param[in, out] BufferSize Size in bytes of Buffer. @param[in] Buffer The pointer to the buffer to write. - + @retval EFI_SUCCESS The data was successfully write to variable. @retval SHELL_OUT_OF_RESOURCES A memory allocation failed. **/ @@ -1362,7 +1362,7 @@ CreateFileInterfaceEnv( EnvFileInterface->Flush = FileInterfaceNopGeneric; EnvFileInterface->Delete = FileInterfaceEnvDelete; EnvFileInterface->Read = FileInterfaceEnvRead; - + CopyMem(EnvFileInterface->Name, EnvName, EnvNameSize); // @@ -1513,10 +1513,10 @@ typedef struct { /** File style interface for Mem (SetPosition). - + @param[in] This The pointer to the EFI_FILE_PROTOCOL object. @param[out] Position The position to set. - + @retval EFI_SUCCESS The position was successfully changed. @retval EFI_INVALID_PARAMETER The Position was invalid. **/ @@ -1537,12 +1537,12 @@ FileInterfaceMemSetPosition( /** File style interface for Mem (GetPosition). - + @param[in] This The pointer to the EFI_FILE_PROTOCOL object. @param[out] Position The pointer to the position. - + @retval EFI_SUCCESS The position was retrieved. -**/ +**/ EFI_STATUS EFIAPI FileInterfaceMemGetPosition( @@ -1604,11 +1604,11 @@ FileInterfaceMemGetInfo( /** File style interface for Mem (Write). - + @param[in] This The pointer to the EFI_FILE_PROTOCOL object. @param[in, out] BufferSize Size in bytes of Buffer. @param[in] Buffer The pointer to the buffer to write. - + @retval EFI_OUT_OF_RESOURCES The operation failed due to lack of resources. @retval EFI_SUCCESS The data was written. **/ @@ -1659,11 +1659,11 @@ FileInterfaceMemWrite( /** File style interface for Mem (Read). - + @param[in] This The pointer to the EFI_FILE_PROTOCOL object. @param[in, out] BufferSize Size in bytes of Buffer. @param[in] Buffer The pointer to the buffer to fill. - + @retval EFI_SUCCESS The data was read. **/ EFI_STATUS @@ -1689,11 +1689,11 @@ FileInterfaceMemRead( File style interface for Mem (Close). Frees all memory associated with this object. - + @param[in] This The pointer to the EFI_FILE_PROTOCOL object. - + @retval EFI_SUCCESS The 'file' was closed. -**/ +**/ EFI_STATUS EFIAPI FileInterfaceMemClose( @@ -1784,7 +1784,7 @@ typedef struct { @param This Protocol instance pointer. @param Position Byte position from the start of the file. - + @retval EFI_SUCCESS Data was written. @retval EFI_UNSUPPORTED Seek request for non-zero is not valid on open. @@ -1804,7 +1804,7 @@ FileInterfaceFileSetPosition( @param This Protocol instance pointer. @param Position Byte position from the start of the file. - + @retval EFI_SUCCESS Data was written. @retval EFI_UNSUPPORTED Seek request for non-zero is not valid on open.. @@ -1999,7 +1999,7 @@ FileInterfaceFileOpen ( Close and delete the file handle. @param This Protocol instance pointer. - + @retval EFI_SUCCESS The device was opened. @retval EFI_WARN_DELETE_FAILURE The handle was closed but the file was not deleted. @@ -2018,9 +2018,9 @@ FileInterfaceFileDelete( /** File style interface for File (Close). - + @param[in] This The pointer to the EFI_FILE_PROTOCOL object. - + @retval EFI_SUCCESS The file was closed. **/ EFI_STATUS @@ -2038,13 +2038,13 @@ FileInterfaceFileClose( /** File style interface for File (Write). - If the file was opened with ASCII mode the data will be processed through + If the file was opened with ASCII mode the data will be processed through AsciiSPrint before writing. - + @param[in] This The pointer to the EFI_FILE_PROTOCOL object. @param[in, out] BufferSize Size in bytes of Buffer. @param[in] Buffer The pointer to the buffer to write. - + @retval EFI_SUCCESS The data was written. **/ EFI_STATUS @@ -2081,10 +2081,10 @@ FileInterfaceFileWrite( This will create a new EFI_FILE_PROTOCOL identical to the Templace except that the new one has Unicode and Ascii knowledge. - + @param[in] Template A pointer to the EFI_FILE_PROTOCOL object. @param[in] Unicode TRUE for UCS-2, FALSE for ASCII. - + @return a new EFI_FILE_PROTOCOL object to be used instead of the template. **/ EFI_FILE_PROTOCOL* diff --git a/ShellPkg/Application/Shell/Shell.c b/ShellPkg/Application/Shell/Shell.c index 577e17311b..47ae3c373c 100644 --- a/ShellPkg/Application/Shell/Shell.c +++ b/ShellPkg/Application/Shell/Shell.c @@ -1,7 +1,7 @@ /** @file This is THE shell (application) - Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
(C) Copyright 2013-2014 Hewlett-Packard Development Company, L.P.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -104,7 +104,7 @@ TrimSpaces( } /** - Parse for the next instance of one string within another string. Can optionally make sure that + Parse for the next instance of one string within another string. Can optionally make sure that the string was not escaped (^ character) per the shell specification. @param[in] SourceString The string to search within @@ -160,13 +160,13 @@ IsValidEnvironmentVariableName( ) { CONST CHAR16 *Walker; - + Walker = NULL; ASSERT (BeginPercent != NULL); ASSERT (EndPercent != NULL); ASSERT (BeginPercent < EndPercent); - + if ((BeginPercent + 1) == EndPercent) { return FALSE; } @@ -212,9 +212,9 @@ ContainsSplit( SecondQuote = NULL; TempSpot = FindFirstCharacter(CmdLine, L"|", L'^'); - if (FirstQuote == NULL || - TempSpot == NULL || - TempSpot == CHAR_NULL || + if (FirstQuote == NULL || + TempSpot == NULL || + TempSpot == CHAR_NULL || FirstQuote > TempSpot ) { return (BOOLEAN) ((TempSpot != NULL) && (*TempSpot != CHAR_NULL)); @@ -223,7 +223,7 @@ ContainsSplit( while ((TempSpot != NULL) && (*TempSpot != CHAR_NULL)) { if (FirstQuote == NULL || FirstQuote > TempSpot) { break; - } + } SecondQuote = FindNextInstance (FirstQuote + 1, L"\"", TRUE); if (SecondQuote == NULL) { break; @@ -235,14 +235,14 @@ ContainsSplit( FirstQuote = FindNextInstance (SecondQuote + 1, L"\"", TRUE); TempSpot = FindFirstCharacter(TempSpot + 1, L"|", L'^'); continue; - } + } } - + return (BOOLEAN) ((TempSpot != NULL) && (*TempSpot != CHAR_NULL)); } /** - Function to start monitoring for CTRL-S using SimpleTextInputEx. This + Function to start monitoring for CTRL-S using SimpleTextInputEx. This feature's enabled state was not known when the shell initially launched. @retval EFI_SUCCESS The feature is enabled. @@ -266,8 +266,8 @@ InternalEfiShellStartCtrlSMonitor( EFI_OPEN_PROTOCOL_GET_PROTOCOL); if (EFI_ERROR(Status)) { ShellPrintHiiEx( - -1, - -1, + -1, + -1, NULL, STRING_TOKEN (STR_SHELL_NO_IN_EX), ShellInfoObject.HiiHandle); @@ -284,7 +284,7 @@ InternalEfiShellStartCtrlSMonitor( &KeyData, NotificationFunction, &ShellInfoObject.CtrlSNotifyHandle1); - + KeyData.KeyState.KeyShiftState = EFI_SHIFT_STATE_VALID|EFI_RIGHT_CONTROL_PRESSED; if (!EFI_ERROR(Status)) { Status = SimpleEx->RegisterKeyNotify( @@ -302,7 +302,7 @@ InternalEfiShellStartCtrlSMonitor( &KeyData, NotificationFunction, &ShellInfoObject.CtrlSNotifyHandle3); - } + } KeyData.KeyState.KeyShiftState = EFI_SHIFT_STATE_VALID|EFI_RIGHT_CONTROL_PRESSED; if (!EFI_ERROR(Status)) { Status = SimpleEx->RegisterKeyNotify( @@ -1129,7 +1129,7 @@ ProcessCommandLine( /** Function try to find location of the Startup.nsh file. - + The buffer is callee allocated and should be freed by the caller. @param ImageDevicePath The path to the image for shell. first place to look for the startup script @@ -1156,7 +1156,7 @@ LocateStartupScript ( // Try to find 'Startup.nsh' in the directory where the shell itself was launched. // MapName = ShellInfoObject.NewEfiShellProtocol->GetMapFromDevicePath (&ImageDevicePath); - if (MapName != NULL) { + if (MapName != NULL) { StartupScriptPath = StrnCatGrow (&StartupScriptPath, &Size, MapName, 0); if (StartupScriptPath == NULL) { // @@ -1387,7 +1387,7 @@ AddBufferToFreeList ( /** - Create a new buffer list and stores the old one to OldBufferList + Create a new buffer list and stores the old one to OldBufferList @param OldBufferList The temporary list head used to store the nodes in BufferToFreeList. **/ @@ -1432,7 +1432,7 @@ AddLineToCommandHistory( Count = 0; MaxHistoryCmdCount = PcdGet16(PcdShellMaxHistoryCommandCount); - + if (MaxHistoryCmdCount == 0) { return ; } @@ -1546,7 +1546,7 @@ StripUnreplacedEnvironmentVariables( } continue; } - + if (FirstQuote == NULL || SecondPercent < FirstQuote) { if (IsValidEnvironmentVariableName(FirstPercent, SecondPercent)) { // @@ -1662,16 +1662,16 @@ ShellConvertVariables ( ; MasterEnvList != NULL && *MasterEnvList != CHAR_NULL ; MasterEnvList += StrLen(MasterEnvList) + 1 ){ - StrCpyS( ItemTemp, - ((ItemSize+(2*sizeof(CHAR16)))/sizeof(CHAR16)), + StrCpyS( ItemTemp, + ((ItemSize+(2*sizeof(CHAR16)))/sizeof(CHAR16)), L"%" ); - StrCatS( ItemTemp, - ((ItemSize+(2*sizeof(CHAR16)))/sizeof(CHAR16)), + StrCatS( ItemTemp, + ((ItemSize+(2*sizeof(CHAR16)))/sizeof(CHAR16)), MasterEnvList ); - StrCatS( ItemTemp, - ((ItemSize+(2*sizeof(CHAR16)))/sizeof(CHAR16)), + StrCatS( ItemTemp, + ((ItemSize+(2*sizeof(CHAR16)))/sizeof(CHAR16)), L"%" ); ShellCopySearchAndReplace(NewCommandLine1, NewCommandLine2, NewSize, ItemTemp, EfiShellGetEnv(MasterEnvList), TRUE, FALSE); @@ -1697,7 +1697,7 @@ ShellConvertVariables ( // ShellCopySearchAndReplace(NewCommandLine1, NewCommandLine2, NewSize, L"^%", L"%", TRUE, FALSE); StrCpyS(NewCommandLine1, NewSize/sizeof(CHAR16), NewCommandLine2); - + FreePool(NewCommandLine2); FreePool(ItemTemp); @@ -1823,7 +1823,7 @@ RunSplitCommand( } /** - Take the original command line, substitute any variables, free + Take the original command line, substitute any variables, free the original string, return the modified copy. @param[in] CmdLine pointer to the command line to update. @@ -1847,7 +1847,7 @@ ShellSubstituteVariables( } /** - Take the original command line, substitute any alias in the first group of space delimited characters, free + Take the original command line, substitute any alias in the first group of space delimited characters, free the original string, return the modified copy. @param[in] CmdLine pointer to the command line to update. @@ -1906,7 +1906,7 @@ ShellSubstituteAliases( SHELL_FREE_NON_NULL(*CmdLine); SHELL_FREE_NON_NULL(CommandName); - + // // re-assign the passed in double pointer to point to our newly allocated buffer // @@ -1919,7 +1919,7 @@ ShellSubstituteAliases( Takes the Argv[0] part of the command line and determine the meaning of it. @param[in] CmdName pointer to the command line to update. - + @retval Internal_Command The name is an internal command. @retval File_Sys_Change the name is a file system change. @retval Script_File_Name the name is a NSH script file. @@ -1947,7 +1947,7 @@ GetOperationType( // Test for file system change request. anything ending with first : and cant have spaces. // if (CmdName[(StrLen(CmdName)-1)] == L':') { - if ( StrStr(CmdName, L" ") != NULL + if ( StrStr(CmdName, L" ") != NULL || StrLen(StrStr(CmdName, L":")) > 1 ) { return (Unknown_Invalid); @@ -1977,7 +1977,7 @@ GetOperationType( SHELL_FREE_NON_NULL(FileWithPath); return (Efi_Application); } - + SHELL_FREE_NON_NULL(FileWithPath); // // No clue what this is... return invalid flag... @@ -1994,7 +1994,7 @@ GetOperationType( @retval EFI_OUT_OF_RESOURCES A memory allocation failed. @retval EFI_NOT_FOUND The operation type is unknown or invalid. **/ -EFI_STATUS +EFI_STATUS IsValidSplit( IN CONST CHAR16 *CmdLine ) @@ -2079,13 +2079,13 @@ VerifySplit( // recurse to verify the next item // TempSpot = FindFirstCharacter(CmdLine, L"|", L'^') + 1; - if (*TempSpot == L'a' && + if (*TempSpot == L'a' && (*(TempSpot + 1) == L' ' || *(TempSpot + 1) == CHAR_NULL) ) { // If it's an ASCII pipe '|a' TempSpot += 1; } - + return (VerifySplit(TempSpot)); } @@ -2149,7 +2149,7 @@ ChangeMappedDrive( // make sure we are the right operation // ASSERT(CmdLine[(StrLen(CmdLine)-1)] == L':' && StrStr(CmdLine, L" ") == NULL); - + // // Call the protocol API to do the work // @@ -2294,7 +2294,7 @@ ProcessCommandLineToFinal( Run an internal shell command. This API will update the shell's environment since these commands are libraries. - + @param[in] CmdLine the command line to run. @param[in] FirstParameter the first parameter on the command line @param[in] ParamProtocol the shell parameters protocol pointer @@ -2317,7 +2317,7 @@ RunInternalCommand( SHELL_STATUS CommandReturnedStatus; BOOLEAN LastError; CHAR16 *Walker; - CHAR16 *NewCmdLine; + CHAR16 *NewCmdLine; NewCmdLine = AllocateCopyPool (StrSize (CmdLine), CmdLine); if (NewCmdLine == NULL) { @@ -2597,7 +2597,7 @@ SetupAndRunCommandOrFile( /** Function will process and run a command line. - This will determine if the command line represents an internal shell + This will determine if the command line represents an internal shell command or dispatch an external application. @param[in] CmdLine The command line to parse. @@ -2673,7 +2673,7 @@ RunShellCommand( Status = ProcessNewSplitCommandLine(CleanOriginal); SHELL_FREE_NON_NULL(CleanOriginal); return (Status); - } + } // // We need the first parameter information so we can determine the operation type @@ -2734,7 +2734,7 @@ RunShellCommand( /** Function will process and run a command line. - This will determine if the command line represents an internal shell + This will determine if the command line represents an internal shell command or dispatch an external application. @param[in] CmdLine The command line to parse. @@ -2907,8 +2907,8 @@ RunScriptFileHandle ( ; // conditional increment in the body of the loop ){ ASSERT(CommandLine2 != NULL); - StrnCpyS( CommandLine2, - PrintBuffSize/sizeof(CHAR16), + StrnCpyS( CommandLine2, + PrintBuffSize/sizeof(CHAR16), NewScriptFile->CurrentCommand->Cl, PrintBuffSize/sizeof(CHAR16) - 1 ); @@ -2934,8 +2934,8 @@ RunScriptFileHandle ( // // Due to variability in starting the find and replace action we need to have both buffers the same. // - StrnCpyS( CommandLine, - PrintBuffSize/sizeof(CHAR16), + StrnCpyS( CommandLine, + PrintBuffSize/sizeof(CHAR16), CommandLine2, PrintBuffSize/sizeof(CHAR16) - 1 ); @@ -2990,8 +2990,8 @@ RunScriptFileHandle ( Status = ShellCopySearchAndReplace(CommandLine, CommandLine2, PrintBuffSize, L"%8", L"\"\"", FALSE, FALSE); Status = ShellCopySearchAndReplace(CommandLine2, CommandLine, PrintBuffSize, L"%9", L"\"\"", FALSE, FALSE); - StrnCpyS( CommandLine2, - PrintBuffSize/sizeof(CHAR16), + StrnCpyS( CommandLine2, + PrintBuffSize/sizeof(CHAR16), CommandLine, PrintBuffSize/sizeof(CHAR16) - 1 ); diff --git a/ShellPkg/Application/Shell/Shell.h b/ShellPkg/Application/Shell/Shell.h index ff08494468..69b19c6a2d 100644 --- a/ShellPkg/Application/Shell/Shell.h +++ b/ShellPkg/Application/Shell/Shell.h @@ -2,7 +2,7 @@ function definitions for internal to shell functions. (C) Copyright 2014 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -294,7 +294,7 @@ RunCommand( /** Function will process and run a command line. - This will determine if the command line represents an internal shell + This will determine if the command line represents an internal shell command or dispatch an external application. @param[in] CmdLine The command line to parse. @@ -383,8 +383,8 @@ TrimSpaces( ); /** - - Create a new buffer list and stores the old one to OldBufferList + + Create a new buffer list and stores the old one to OldBufferList @param OldBufferList The temporary list head used to store the nodes in BufferToFreeList. **/ diff --git a/ShellPkg/Application/Shell/ShellEnvVar.c b/ShellPkg/Application/Shell/ShellEnvVar.c index 4c49c1ca98..6632764542 100644 --- a/ShellPkg/Application/Shell/ShellEnvVar.c +++ b/ShellPkg/Application/Shell/ShellEnvVar.c @@ -1,7 +1,7 @@ /** @file function declarations for shell environment functions. - Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -143,9 +143,9 @@ GetEnvironmentVariableList( if (ListHead == NULL) { return (EFI_INVALID_PARAMETER); } - + Status = EFI_SUCCESS; - + ValBufferSize = INIT_DATA_BUFFER_SIZE; NameBufferSize = INIT_NAME_BUFFER_SIZE; VariableName = AllocateZeroPool(NameBufferSize); @@ -171,7 +171,7 @@ GetEnvironmentVariableList( NameSize = NameBufferSize; Status = gRT->GetNextVariableName(&NameSize, VariableName, &Guid); } - + if (!EFI_ERROR(Status) && CompareGuid(&Guid, &gShellVariableGuid)){ VarList = AllocateZeroPool(sizeof(ENV_VAR_LIST)); if (VarList == NULL) { @@ -200,7 +200,7 @@ GetEnvironmentVariableList( Status = EFI_OUT_OF_RESOURCES; break; } - + ValSize = ValBufferSize; Status = SHELL_GET_ENVIRONMENT_VARIABLE_AND_ATTRIBUTES(VariableName, &VarList->Atts, &ValSize, VarList->Val); } @@ -348,8 +348,8 @@ SetEnvironmentVariables( // // Copy the string into the Key, leaving the last character allocated as NULL to terminate // - StrnCpyS( Node->Key, - StrStr(CurrentString, L"=") - CurrentString + 1, + StrnCpyS( Node->Key, + StrStr(CurrentString, L"=") - CurrentString + 1, CurrentString, StrStr(CurrentString, L"=") - CurrentString ); @@ -413,7 +413,7 @@ ShellFindEnvVarInList ( ) { ENV_VAR_LIST *Node; - + if (Key == NULL || Value == NULL || ValueSize == NULL) { return SHELL_INVALID_PARAMETER; } @@ -459,7 +459,7 @@ ShellAddEnvVarToList ( ENV_VAR_LIST *Node; CHAR16 *LocalKey; CHAR16 *LocalValue; - + if (Key == NULL || Value == NULL || ValueSize == 0) { return EFI_INVALID_PARAMETER; } @@ -511,7 +511,7 @@ ShellAddEnvVarToList ( Remove a specified environment variable in gShellEnvVarList. @param Key The name of the environment variable. - + @retval EFI_SUCCESS The command executed successfully. @retval EFI_NOT_FOUND The environment variable is not found in gShellEnvVarList. @@ -546,7 +546,7 @@ ShellRemvoeEnvVarFromList ( /** Initialize the gShellEnvVarList and cache all Shell-Guid-based environment variables. - + **/ EFI_STATUS ShellInitEnvVarList ( diff --git a/ShellPkg/Application/Shell/ShellEnvVar.h b/ShellPkg/Application/Shell/ShellEnvVar.h index b9efed042b..0684516a5c 100644 --- a/ShellPkg/Application/Shell/ShellEnvVar.h +++ b/ShellPkg/Application/Shell/ShellEnvVar.h @@ -6,7 +6,7 @@ //#include - Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -266,9 +266,9 @@ ShellRemvoeEnvVarFromList ( ); /** - Initialize the gShellEnvVarList and cache all Shell-Guid-based environment + Initialize the gShellEnvVarList and cache all Shell-Guid-based environment variables. - + **/ EFI_STATUS ShellInitEnvVarList ( diff --git a/ShellPkg/Application/Shell/ShellManParser.c b/ShellPkg/Application/Shell/ShellManParser.c index 975f3c22da..b180c6c8f7 100644 --- a/ShellPkg/Application/Shell/ShellManParser.c +++ b/ShellPkg/Application/Shell/ShellManParser.c @@ -146,14 +146,14 @@ GetManFileName( } else { Buffer = AllocateZeroPool(StrSize(ManFileName) + 4*sizeof(CHAR16)); if (Buffer != NULL) { - StrnCpyS( Buffer, - (StrSize(ManFileName) + 4*sizeof(CHAR16))/sizeof(CHAR16), - ManFileName, + StrnCpyS( Buffer, + (StrSize(ManFileName) + 4*sizeof(CHAR16))/sizeof(CHAR16), + ManFileName, StrLen(ManFileName) ); - StrnCatS( Buffer, + StrnCatS( Buffer, (StrSize(ManFileName) + 4*sizeof(CHAR16))/sizeof(CHAR16), - L".man", + L".man", 4 ); } diff --git a/ShellPkg/Application/Shell/ShellParametersProtocol.c b/ShellPkg/Application/Shell/ShellParametersProtocol.c index 8d76fb4be7..90889a3725 100644 --- a/ShellPkg/Application/Shell/ShellParametersProtocol.c +++ b/ShellPkg/Application/Shell/ShellParametersProtocol.c @@ -5,7 +5,7 @@ (C) Copyright 2016 Hewlett Packard Enterprise Development LP
Copyright (C) 2014, Red Hat, Inc. (C) Copyright 2013 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -147,8 +147,8 @@ DEBUG_CODE_END(); // Remove any non-escaped quotes in the string // Remove any remaining escape characters in the string // - for (NextDelim = FindFirstCharacter(*TempParameter, L"\"^", CHAR_NULL) - ; *NextDelim != CHAR_NULL + for (NextDelim = FindFirstCharacter(*TempParameter, L"\"^", CHAR_NULL) + ; *NextDelim != CHAR_NULL ; NextDelim = FindFirstCharacter(NextDelim, L"\"^", CHAR_NULL) ) { if (*NextDelim == L'^') { @@ -165,9 +165,9 @@ DEBUG_CODE_END(); // if (StripQuotation) { CopyMem ((CHAR16*)NextDelim, NextDelim + 1, StrSize (NextDelim + 1)); - } else{ + } else{ NextDelim++; - } + } } } @@ -181,7 +181,7 @@ DEBUG_CODE_END(); parameters for inclusion in EFI_SHELL_PARAMETERS_PROTOCOL. this supports space delimited and quote surrounded parameter definition. - All special character processing (alias, environment variable, redirection, + All special character processing (alias, environment variable, redirection, etc... must be complete before calling this API. @param[in] CommandLine String of command line to parse @@ -269,7 +269,7 @@ ParseCommandLineToArgs( } ASSERT(Count >= (*Argc)); Status = EFI_SUCCESS; - + Done: SHELL_FREE_NON_NULL(TempParameter); SHELL_FREE_NON_NULL(NewCommandLine); @@ -503,7 +503,7 @@ IsUnicodeFile( } gEfiShellProtocol->SetFilePosition(Handle, OriginalFilePosition); gEfiShellProtocol->CloseFile(Handle); - return (Status); + return (Status); } /** @@ -580,7 +580,7 @@ FixFileName ( Copy = FileName+1; if ((TempLocation = StrStr(Copy , L"\"")) != NULL) { TempLocation[0] = CHAR_NULL; - } + } } else { Copy = FileName; while(Copy[0] == L' ') { @@ -588,7 +588,7 @@ FixFileName ( } if ((TempLocation = StrStr(Copy , L" ")) != NULL) { TempLocation[0] = CHAR_NULL; - } + } } if (Copy[0] == CHAR_NULL) { @@ -620,7 +620,7 @@ FixVarName ( Copy = FileName+1; if ((TempLocation = StrStr(Copy , L"%")) != NULL) { TempLocation[0] = CHAR_NULL; - } + } } return (FixFileName(Copy)); @@ -629,9 +629,9 @@ FixVarName ( /** Remove the unicode file tag from the begining of the file buffer since that will not be used by StdIn. - + @param[in] Handle Pointer to the handle of the file to be processed. - + @retval EFI_SUCCESS The unicode file tag has been moved successfully. **/ EFI_STATUS @@ -837,7 +837,7 @@ UpdateStdInStdOutStdErr( if (StrStr(CommandLineWalker, L" 1>> ") != NULL) { Status = EFI_NOT_FOUND; } - } + } if (!EFI_ERROR(Status) && (CommandLineWalker = StrStr(CommandLineCopy, L" >> ")) != NULL) { FirstLocation = MIN(CommandLineWalker, FirstLocation); SetMem16(CommandLineWalker, 8, L' '); @@ -864,7 +864,7 @@ UpdateStdInStdOutStdErr( if (StrStr(CommandLineWalker, L" >>a ") != NULL) { Status = EFI_NOT_FOUND; } - } + } if (!EFI_ERROR(Status) && (CommandLineWalker = StrStr(CommandLineCopy, L" 1>a ")) != NULL) { FirstLocation = MIN(CommandLineWalker, FirstLocation); SetMem16(CommandLineWalker, 10, L' '); @@ -878,7 +878,7 @@ UpdateStdInStdOutStdErr( if (StrStr(CommandLineWalker, L" 1>a ") != NULL) { Status = EFI_NOT_FOUND; } - } + } if (!EFI_ERROR(Status) && (CommandLineWalker = StrStr(CommandLineCopy, L" >a ")) != NULL) { FirstLocation = MIN(CommandLineWalker, FirstLocation); SetMem16(CommandLineWalker, 8, L' '); @@ -1107,7 +1107,7 @@ UpdateStdInStdOutStdErr( // // Cant redirect during a reconnect operation. // - ||(StrStr(NewCommandLine, L"connect -r") != NULL + ||(StrStr(NewCommandLine, L"connect -r") != NULL && (StdOutVarName != NULL || StdOutFileName != NULL || StdErrFileName != NULL || StdErrVarName != NULL)) // // Check that filetypes (Unicode/Ascii) do not change during an append @@ -1307,7 +1307,7 @@ RestoreStdInStdOutStdErr ( { SPLIT_LIST *Split; - if (ShellParameters == NULL + if (ShellParameters == NULL ||OldStdIn == NULL ||OldStdOut == NULL ||OldStdErr == NULL @@ -1382,7 +1382,7 @@ UpdateArgcArgv( ) { BOOLEAN StripParamQuotation; - + ASSERT(ShellParameters != NULL); StripParamQuotation = TRUE; @@ -1396,10 +1396,10 @@ UpdateArgcArgv( if (Type == Script_File_Name) { StripParamQuotation = FALSE; } - - return ParseCommandLineToArgs( NewCommandLine, - StripParamQuotation, - &(ShellParameters->Argv), + + return ParseCommandLineToArgs( NewCommandLine, + StripParamQuotation, + &(ShellParameters->Argv), &(ShellParameters->Argc) ); } diff --git a/ShellPkg/Application/Shell/ShellProtocol.c b/ShellPkg/Application/Shell/ShellProtocol.c index d8b1e065e0..f2ca2029e3 100644 --- a/ShellPkg/Application/Shell/ShellProtocol.c +++ b/ShellPkg/Application/Shell/ShellProtocol.c @@ -4,7 +4,7 @@ (C) Copyright 2014 Hewlett-Packard Development Company, L.P.
(C) Copyright 2016 Hewlett Packard Enterprise Development LP
- Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -1422,7 +1422,7 @@ EfiShellEnablePageBreak ( variables with the format 'x=y', where x is the environment variable name and y is the value. If this is NULL, then the current shell environment is used. - + @param[out] StartImageStatus Returned status from gBS->StartImage. @retval EFI_SUCCESS The command executed successfully. The status code @@ -1460,7 +1460,7 @@ InternalShellExecuteDevicePath( ZeroMem(&ShellParamsProtocol, sizeof(EFI_SHELL_PARAMETERS_PROTOCOL)); NewHandle = NULL; - + NewCmdLine = AllocateCopyPool (StrSize (CommandLine), CommandLine); if (NewCmdLine == NULL) { return EFI_OUT_OF_RESOURCES; @@ -1505,8 +1505,8 @@ InternalShellExecuteDevicePath( // if (LoadedImage->ImageCodeType != EfiLoaderCode){ ShellPrintHiiEx( - -1, - -1, + -1, + -1, NULL, STRING_TOKEN (STR_SHELL_IMAGE_NOT_APP), ShellInfoObject.HiiHandle @@ -1630,7 +1630,7 @@ FreeAlloc: variables with the format 'x=y', where x is the environment variable name and y is the value. If this is NULL, then the current shell environment is used. - + @param[out] StartImageStatus Returned status from the command line. @retval EFI_SUCCESS The command executed successfully. The status code @@ -2210,7 +2210,7 @@ EfiShellGetGuidFromName( if (Guid == NULL || GuidName == NULL) { return (EFI_INVALID_PARAMETER); } - + Status = GetGuidFromStringName(GuidName, NULL, &NewGuid); if (!EFI_ERROR(Status)) { @@ -2762,8 +2762,8 @@ EfiShellGetEnvEx( ; Node = (ENV_VAR_LIST*)GetNextNode(&gShellEnvVarList.Link, &Node->Link) ){ ASSERT(Node->Key != NULL); - StrCpyS( CurrentWriteLocation, - (Size)/sizeof(CHAR16) - (CurrentWriteLocation - ((CHAR16*)Buffer)), + StrCpyS( CurrentWriteLocation, + (Size)/sizeof(CHAR16) - (CurrentWriteLocation - ((CHAR16*)Buffer)), Node->Key ); CurrentWriteLocation += StrLen(CurrentWriteLocation) + 1; @@ -3233,9 +3233,9 @@ EfiShellGetHelpText( return EFI_OUT_OF_RESOURCES; } - StrnCpyS( FixCommand, - (StrSize(Command) - 4 * sizeof (CHAR16))/sizeof(CHAR16), - Command, + StrnCpyS( FixCommand, + (StrSize(Command) - 4 * sizeof (CHAR16))/sizeof(CHAR16), + Command, StrLen(Command)-4 ); Status = ProcessManFile(FixCommand, FixCommand, Sections, NULL, HelpText); @@ -3295,7 +3295,7 @@ InternalEfiShellGetListAlias( VOID ) { - + EFI_STATUS Status; EFI_GUID Guid; CHAR16 *VariableName; @@ -3330,17 +3330,17 @@ InternalEfiShellGetListAlias( RetVal = NULL; break; } - + NameSize = NameBufferSize; Status = gRT->GetNextVariableName(&NameSize, VariableName, &Guid); } - + if (EFI_ERROR (Status)) { SHELL_FREE_NON_NULL(RetVal); RetVal = NULL; break; } - + if (CompareGuid(&Guid, &gShellAliasGuid)){ ASSERT((RetVal == NULL && RetSize == 0) || (RetVal != NULL)); RetVal = StrnCatGrow(&RetVal, &RetSize, VariableName, 0); @@ -3355,10 +3355,10 @@ InternalEfiShellGetListAlias( /** Convert a null-terminated unicode string, in-place, to all lowercase. Then return it. - + @param Str The null-terminated string to be converted to all lowercase. - - @return The null-terminated string converted into all lowercase. + + @return The null-terminated string converted into all lowercase. **/ CHAR16 * ToLower ( @@ -3385,7 +3385,7 @@ ToLower ( @param[out] Volatile upon return of a single command if TRUE indicates this is stored in a volatile fashion. FALSE otherwise. - @return If Alias is not NULL, it will return a pointer to + @return If Alias is not NULL, it will return a pointer to the NULL-terminated command for that alias. If Alias is NULL, ReturnedData points to a ';' delimited list of alias (e.g. @@ -3801,7 +3801,7 @@ CleanUpShellEnvironment ( { EFI_STATUS Status; EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *SimpleEx; - + CleanUpShellProtocol (NewShell); Status = gBS->CloseEvent(NewShell->ExecutionBreak); @@ -3844,21 +3844,21 @@ NotificationFunction( if ( ((KeyData->Key.UnicodeChar == L'c') && (KeyData->KeyState.KeyShiftState == (EFI_SHIFT_STATE_VALID|EFI_LEFT_CONTROL_PRESSED) || KeyData->KeyState.KeyShiftState == (EFI_SHIFT_STATE_VALID|EFI_RIGHT_CONTROL_PRESSED))) || (KeyData->Key.UnicodeChar == 3) - ){ + ){ if (ShellInfoObject.NewEfiShellProtocol->ExecutionBreak == NULL) { return (EFI_UNSUPPORTED); } return (gBS->SignalEvent(ShellInfoObject.NewEfiShellProtocol->ExecutionBreak)); } else if ((KeyData->Key.UnicodeChar == L's') && (KeyData->KeyState.KeyShiftState == (EFI_SHIFT_STATE_VALID|EFI_LEFT_CONTROL_PRESSED) || KeyData->KeyState.KeyShiftState == (EFI_SHIFT_STATE_VALID|EFI_RIGHT_CONTROL_PRESSED)) - ){ + ){ ShellInfoObject.HaltOutput = TRUE; } return (EFI_SUCCESS); } /** - Function to start monitoring for CTRL-C using SimpleTextInputEx. This + Function to start monitoring for CTRL-C using SimpleTextInputEx. This feature's enabled state was not known when the shell initially launched. @retval EFI_SUCCESS The feature is enabled. @@ -3882,8 +3882,8 @@ InernalEfiShellStartMonitor( EFI_OPEN_PROTOCOL_GET_PROTOCOL); if (EFI_ERROR(Status)) { ShellPrintHiiEx( - -1, - -1, + -1, + -1, NULL, STRING_TOKEN (STR_SHELL_NO_IN_EX), ShellInfoObject.HiiHandle); @@ -3904,7 +3904,7 @@ InernalEfiShellStartMonitor( &KeyData, NotificationFunction, &ShellInfoObject.CtrlCNotifyHandle1); - + KeyData.KeyState.KeyShiftState = EFI_SHIFT_STATE_VALID|EFI_RIGHT_CONTROL_PRESSED; if (!EFI_ERROR(Status)) { Status = SimpleEx->RegisterKeyNotify( diff --git a/ShellPkg/Application/Shell/ShellProtocol.h b/ShellPkg/Application/Shell/ShellProtocol.h index 755a402c98..2cb7b0337c 100644 --- a/ShellPkg/Application/Shell/ShellProtocol.h +++ b/ShellPkg/Application/Shell/ShellProtocol.h @@ -3,7 +3,7 @@ manipulation, and initialization of EFI_SHELL_PROTOCOL. (C) Copyright 2014 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -36,7 +36,7 @@ typedef struct { This must be removed via calling CleanUpShellProtocol(). - @param[in, out] NewShell The pointer to the pointer to the structure + @param[in, out] NewShell The pointer to the pointer to the structure to install. @retval EFI_SUCCESS The operation was successful. @@ -819,7 +819,7 @@ EfiShellIsRootShell( aliases will be returned in ReturnedData. @param[out] Volatile upon return of a single command if TRUE indicates this is stored in a volatile fashion. FALSE otherwise. - @return If Alias is not NULL, it will return a pointer to + @return If Alias is not NULL, it will return a pointer to the NULL-terminated command for that alias. If Alias is NULL, ReturnedData points to a ';' delimited list of alias (e.g. @@ -917,7 +917,7 @@ InternalEfiShellSetEnv( ); /** - Function to start monitoring for CTRL-C using SimpleTextInputEx. This + Function to start monitoring for CTRL-C using SimpleTextInputEx. This feature's enabled state was not known when the shell initially launched. @retval EFI_SUCCESS The feature is enabled. diff --git a/ShellPkg/Application/ShellCTestApp/README.txt b/ShellPkg/Application/ShellCTestApp/README.txt index 7814bb8386..02594e0d12 100644 --- a/ShellPkg/Application/ShellCTestApp/README.txt +++ b/ShellPkg/Application/ShellCTestApp/README.txt @@ -2,4 +2,4 @@ TestArgv.nsh is a very simple shell script to test how the interpreter parses the parameters. It uses ShellCTestApp.efi to dump the parameters passed from the intepreter. -TestArgv.log is the desired output created using "TestArgv.nsh > TestArgv.log". \ No newline at end of file +TestArgv.log is the desired output created using "TestArgv.nsh > TestArgv.log". diff --git a/ShellPkg/Application/ShellCTestApp/ShellCTestApp.inf b/ShellPkg/Application/ShellCTestApp/ShellCTestApp.inf index 4839b9fd97..3f266bd9a0 100644 --- a/ShellPkg/Application/ShellCTestApp/ShellCTestApp.inf +++ b/ShellPkg/Application/ShellCTestApp/ShellCTestApp.inf @@ -1,7 +1,7 @@ ## @file # This is the shell application # -# Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.
+# Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -36,4 +36,4 @@ [LibraryClasses] ShellCEntryLib - UefiLib \ No newline at end of file + UefiLib diff --git a/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c b/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c index 925341303a..a906808ab3 100644 --- a/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c +++ b/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c @@ -12,14 +12,14 @@ and start and end time values. Dp uses this information to group records in different ways. It also uses timer information to calculate elapsed time for each measurement. - + Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved. (C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be 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 IMPLIED. **/ @@ -741,10 +741,10 @@ InitSummaryData ( /** Dump performance data. - + @param[in] ImageHandle The image handle. @param[in] SystemTable The system table. - + @retval SHELL_SUCCESS Command completed successfully. @retval SHELL_INVALID_PARAMETER Command usage error. @retval SHELL_ABORTED The user aborts the operation. @@ -952,7 +952,7 @@ RunDp ( **** Cooked (Default) ****************************************************************************/ GatherStatistics (CustomCumulativeData); - if (CumulativeMode) { + if (CumulativeMode) { ProcessCumulative (CustomCumulativeData); } else if (AllMode) { Status = DumpAllTrace( Number2Display, ExcludeMode); diff --git a/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.uni b/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.uni index ced8a48742..e66d9ac6bc 100644 --- a/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.uni +++ b/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.uni @@ -7,7 +7,7 @@ // are licensed and made available under the terms and conditions of the BSD License // which accompanies this distribution. The full text of the license may be 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 IMPLIED. // @@ -108,7 +108,7 @@ " -t VALUE - Sets display threshold to VALUE microseconds\r\n" " -n COUNT - Limits display to COUNT lines in All and Raw modes\r\n" " -i - Displays identifier\r\n" -" -c TOKEN - Display pre-defined and custom cumulative data\r\n" +" -c TOKEN - Display pre-defined and custom cumulative data\r\n" " Pre-defined cumulative token are:\r\n" " 1. LoadImage:\r\n" " 2. StartImage:\r\n" diff --git a/ShellPkg/DynamicCommand/DpDynamicCommand/DpInternal.h b/ShellPkg/DynamicCommand/DpDynamicCommand/DpInternal.h index d8bc7453d2..d5eb4229c7 100644 --- a/ShellPkg/DynamicCommand/DpDynamicCommand/DpInternal.h +++ b/ShellPkg/DynamicCommand/DpDynamicCommand/DpInternal.h @@ -44,24 +44,24 @@ extern UINT32 const NumCum; ///@} -/** +/** Calculate an event's duration in timer ticks. - + Given the count direction and the event's start and end timer values, calculate the duration of the event in timer ticks. Information for the current measurement is pointed to by the parameter. - + If the measurement's start time is 1, it indicates that the developer is indicating that the measurement began at the release of reset. The start time is adjusted to the timer's starting count before performing the elapsed time calculation. - + The calculated duration, in ticks, is the absolute difference between the measurement's ending and starting counts. - + @param Measurement Pointer to a MEASUREMENT_RECORD structure containing data for the current measurement. - + @return The 64-bit duration of the event. **/ UINT64 @@ -69,14 +69,14 @@ GetDuration ( IN OUT MEASUREMENT_RECORD *Measurement ); -/** +/** Determine whether the Measurement record is for an EFI Phase. - + The Token and Module members of the measurement record are checked. Module must be empty and Token must be one of SEC, PEI, DXE, BDS, or SHELL. - + @param[in] Measurement A pointer to the Measurement record to test. - + @retval TRUE The measurement record is for an EFI Phase. @retval FALSE The measurement record is NOT for an EFI Phase. **/ @@ -99,17 +99,17 @@ IsCorePerf( IN MEASUREMENT_RECORD *Measurement ); -/** +/** Get the file name portion of the Pdb File Name. - + The portion of the Pdb File Name between the last backslash and either a following period or the end of the string is converted to Unicode and copied into UnicodeBuffer. The name is truncated, if necessary, to ensure that UnicodeBuffer is not overrun. - + @param[in] PdbFileName Pdb file name. @param[out] UnicodeBuffer The resultant Unicode File Name. - + **/ VOID DpGetShortPdbFileName ( @@ -117,7 +117,7 @@ DpGetShortPdbFileName ( OUT CHAR16 *UnicodeBuffer ); -/** +/** Get a human readable name for an image handle. The following methods will be tried orderly: 1. Image PDB @@ -126,29 +126,29 @@ DpGetShortPdbFileName ( 4. Image GUID 5. Image DevicePath 6. Unknown Driver Name - + @param[in] Handle - + @post The resulting Unicode name string is stored in the mGaugeString global array. - + **/ VOID DpGetNameFromHandle ( IN EFI_HANDLE Handle ); -/** +/** Calculate the Duration in microseconds. - + Duration is multiplied by 1000, instead of Frequency being divided by 1000 or multiplying the result by 1000, in order to maintain precision. Since Duration is a 64-bit value, multiplying it by 1000 is unlikely to produce an overflow. - + The time is calculated as (Duration * 1000) / Timer_Frequency. - + @param[in] Duration The event duration in timer ticks. - + @return A 64-bit value which is the Elapsed time in microseconds. **/ UINT64 @@ -156,16 +156,16 @@ DurationInMicroSeconds ( IN UINT64 Duration ); -/** +/** Get index of Measurement Record's match in the CumData array. - + If the Measurement's Token value matches a Token in one of the CumData records, the index of the matching record is returned. The returned index is a signed value so that negative values can indicate that the Measurement didn't match any entry in the CumData array. - + @param[in] Measurement A pointer to a Measurement Record to match against the CumData array. - + @retval <0 Token is not in the CumData array. @retval >=0 Return value is the index into CumData where Token is found. **/ @@ -174,17 +174,17 @@ GetCumulativeItem( IN MEASUREMENT_RECORD *Measurement ); -/** +/** Collect verbose statistics about the logged performance measurements. - + General Summary information for all Trace measurements is gathered and stored within the SummaryData structure. This information is both used internally by subsequent reporting functions, and displayed at the end of verbose reports. - + @pre The SummaryData and CumData structures must be initialized prior to calling this function. - + @post The SummaryData and CumData structures contain statistics for the current performance logs. @@ -196,23 +196,23 @@ GatherStatistics( IN OUT PERF_CUM_DATA *CustomCumulativeData OPTIONAL ); -/** +/** Gather and print ALL Trace Records. - + Displays all "interesting" Trace measurements in order.
The number of records displayed is controlled by: - records with a duration less than mInterestThreshold microseconds are not displayed. - No more than Limit records are displayed. A Limit of zero will not limit the output. - If the ExcludeFlag is TRUE, records matching entries in the CumData array are not displayed. - + @pre The mInterestThreshold global variable is set to the shortest duration to be printed. The mGaugeString and mUnicodeToken global arrays are used for temporary string storage. They must not be in use by a calling function. - + @param[in] Limit The number of records to print. Zero is ALL. @param[in] ExcludeFlag TRUE to exclude individual Cumulative items from display. - + @retval EFI_SUCCESS The operation was successful. @retval EFI_ABORTED The user aborts the operation. @return Others from a call to gBS->LocateHandleBuffer(). @@ -223,20 +223,20 @@ DumpAllTrace( IN BOOLEAN ExcludeFlag ); -/** +/** Gather and print Raw Trace Records. - + All Trace measurements with a duration greater than or equal to mInterestThreshold are printed without interpretation. - + The number of records displayed is controlled by: - records with a duration less than mInterestThreshold microseconds are not displayed. - No more than Limit records are displayed. A Limit of zero will not limit the output. - If the ExcludeFlag is TRUE, records matching entries in the CumData array are not displayed. - + @pre The mInterestThreshold global variable is set to the shortest duration to be printed. - + @param[in] Limit The number of records to print. Zero is ALL. @param[in] ExcludeFlag TRUE to exclude individual Cumulative items from display. @retval EFI_SUCCESS The operation was successful. @@ -248,9 +248,9 @@ DumpRawTrace( IN BOOLEAN ExcludeFlag ); -/** +/** Gather and print Major Phase metrics. - + **/ VOID ProcessPhases( @@ -258,11 +258,11 @@ ProcessPhases( ); -/** +/** Gather and print Handle data. - + @param[in] ExcludeFlag TRUE to exclude individual Cumulative items from display. - + @retval EFI_SUCCESS The operation was successful. @retval EFI_ABORTED The user aborts the operation. @return Others from a call to gBS->LocateHandleBuffer(). @@ -273,11 +273,11 @@ ProcessHandles( ); -/** +/** Gather and print PEIM data. - + Only prints complete PEIM records - + @retval EFI_SUCCESS The operation was successful. @retval EFI_ABORTED The user aborts the operation. **/ @@ -286,14 +286,14 @@ ProcessPeims( VOID ); -/** +/** Gather and print global data. - + Strips out incomplete or "Execution Phase" records Only prints records where Handle is NULL Increment TIndex for every record, even skipped ones, so that we have an indication of every measurement record taken. - + @retval EFI_SUCCESS The operation was successful. @retval EFI_ABORTED The user aborts the operation. **/ @@ -302,16 +302,16 @@ ProcessGlobal( VOID ); -/** +/** Gather and print cumulative data. - + Traverse the measurement records and:
For each record with a Token listed in the CumData array:
- Update the instance count and the total, minimum, and maximum durations. Finally, print the gathered cumulative statistics. @param[in] CustomCumulativeData The pointer to the custom cumulative data. - + **/ VOID ProcessCumulative( diff --git a/ShellPkg/DynamicCommand/DpDynamicCommand/DpUtilities.c b/ShellPkg/DynamicCommand/DpDynamicCommand/DpUtilities.c index 5c6ab209d5..25311860ef 100644 --- a/ShellPkg/DynamicCommand/DpDynamicCommand/DpUtilities.c +++ b/ShellPkg/DynamicCommand/DpDynamicCommand/DpUtilities.c @@ -39,24 +39,24 @@ #include "Literals.h" #include "DpInternal.h" -/** +/** Calculate an event's duration in timer ticks. - + Given the count direction and the event's start and end timer values, calculate the duration of the event in timer ticks. Information for the current measurement is pointed to by the parameter. - + If the measurement's start time is 1, it indicates that the developer is indicating that the measurement began at the release of reset. The start time is adjusted to the timer's starting count before performing the elapsed time calculation. - + The calculated duration, in ticks, is the absolute difference between the measurement's ending and starting counts. - + @param Measurement Pointer to a MEASUREMENT_RECORD structure containing data for the current measurement. - + @return The 64-bit duration of the event. **/ UINT64 @@ -81,14 +81,14 @@ GetDuration ( return Duration; } -/** +/** Determine whether the Measurement record is for an EFI Phase. - + The Token and Module members of the measurement record are checked. Module must be empty and Token must be one of SEC, PEI, DXE, BDS, or SHELL. - + @param[in] Measurement A pointer to the Measurement record to test. - + @retval TRUE The measurement record is for an EFI Phase. @retval FALSE The measurement record is NOT for an EFI Phase. **/ @@ -139,17 +139,17 @@ IsCorePerf( return RetVal; } -/** +/** Get the file name portion of the Pdb File Name. - + The portion of the Pdb File Name between the last backslash and either a following period or the end of the string is converted to Unicode and copied into UnicodeBuffer. The name is truncated, if necessary, to ensure that UnicodeBuffer is not overrun. - + @param[in] PdbFileName Pdb file name. @param[out] UnicodeBuffer The resultant Unicode File Name. - + **/ VOID DpGetShortPdbFileName ( @@ -192,7 +192,7 @@ DpGetShortPdbFileName ( } } -/** +/** Get a human readable name for an image handle. The following methods will be tried orderly: 1. Image PDB @@ -377,17 +377,17 @@ DpGetNameFromHandle ( FreePool (StringPtr); } -/** +/** Calculate the Duration in microseconds. - + Duration is multiplied by 1000, instead of Frequency being divided by 1000 or multiplying the result by 1000, in order to maintain precision. Since Duration is a 64-bit value, multiplying it by 1000 is unlikely to produce an overflow. - + The time is calculated as (Duration * 1000) / Timer_Frequency. - + @param[in] Duration The event duration in timer ticks. - + @return A 64-bit value which is the Elapsed time in microseconds. **/ UINT64 @@ -398,16 +398,16 @@ DurationInMicroSeconds ( return DivU64x32 (Duration, 1000); } -/** +/** Get index of Measurement Record's match in the CumData array. - + If the Measurement's Token value matches a Token in one of the CumData records, the index of the matching record is returned. The returned index is a signed value so that negative values can indicate that the Measurement didn't match any entry in the CumData array. - + @param[in] Measurement A pointer to a Measurement Record to match against the CumData array. - + @retval <0 Token is not in the CumData array. @retval >=0 Return value is the index into CumData where Token is found. **/ diff --git a/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c b/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c index 8569c966dd..e2491cd54c 100644 --- a/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c +++ b/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c @@ -2,7 +2,7 @@ The implementation for the 'tftp' Shell command. Copyright (c) 2015, ARM Ltd. All rights reserved.
- Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.
+ Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.
(C) Copyright 2015 Hewlett Packard Enterprise Development LP
This program and the accompanying materials @@ -50,8 +50,8 @@ STATIC CONST CHAR16 mTftpProgressDelete[] = L"\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b @return TRUE The value was returned. @return FALSE A parsing error occured. **/ -STATIC -BOOLEAN +STATIC +BOOLEAN StringToUint16 ( IN CONST CHAR16 *ValueStr, OUT UINT16 *Value @@ -64,7 +64,7 @@ StringToUint16 ( @param[in] NicNumber The network physical device number. @param[out] NicName Address where to store the NIC name. The memory area has to be at least - IP4_CONFIG2_INTERFACE_INFO_NAME_LENGTH + IP4_CONFIG2_INTERFACE_INFO_NAME_LENGTH double byte wide. @return EFI_SUCCESS The name of the NIC was returned. @@ -75,8 +75,8 @@ StringToUint16 ( Managed Network Protocol could not be read. **/ -STATIC -EFI_STATUS +STATIC +EFI_STATUS GetNicName ( IN EFI_HANDLE ControllerHandle, IN UINTN NicNumber, @@ -102,8 +102,8 @@ GetNicName ( @return Others Either the creation of the child or the opening of the protocol failed. **/ -STATIC -EFI_STATUS +STATIC +EFI_STATUS CreateServiceChildAndOpenProtocol ( IN EFI_HANDLE ControllerHandle, IN EFI_GUID *ServiceBindingProtocolGuid, @@ -124,8 +124,8 @@ CreateServiceChildAndOpenProtocol ( @param[in] ChildHandle Handle of the child to be destroyed. **/ -STATIC -VOID +STATIC +VOID CloseProtocolAndDestroyServiceChild ( IN EFI_HANDLE ControllerHandle, IN EFI_GUID *ServiceBindingProtocolGuid, @@ -148,8 +148,8 @@ CloseProtocolAndDestroyServiceChild ( (see EFI_MTFTP4_PROTOCOL.GetInfo() status codes) or error when parsing the response of the server. **/ -STATIC -EFI_STATUS +STATIC +EFI_STATUS GetFileSize ( IN EFI_MTFTP4_PROTOCOL *Mtftp4, IN CONST CHAR8 *FilePath, @@ -175,8 +175,8 @@ GetFileSize ( (see EFI_MTFTP4_PROTOCOL.ReadFile() status codes). **/ -STATIC -EFI_STATUS +STATIC +EFI_STATUS DownloadFile ( IN EFI_MTFTP4_PROTOCOL *Mtftp4, IN CONST CHAR16 *FilePath, @@ -198,8 +198,8 @@ DownloadFile ( @retval EFI_SUCCESS All packets are accepted. **/ -STATIC -EFI_STATUS +STATIC +EFI_STATUS EFIAPI CheckPacket ( IN EFI_MTFTP4_PROTOCOL *This, @@ -623,7 +623,7 @@ StringToUint16 ( @param[in] NicNumber The network physical device number. @param[out] NicName Address where to store the NIC name. The memory area has to be at least - IP4_CONFIG2_INTERFACE_INFO_NAME_LENGTH + IP4_CONFIG2_INTERFACE_INFO_NAME_LENGTH double byte wide. @return EFI_SUCCESS The name of the NIC was returned. diff --git a/ShellPkg/Include/Guid/ShellMapGuid.h b/ShellPkg/Include/Guid/ShellMapGuid.h index 180a41bf53..1d544621b7 100644 --- a/ShellPkg/Include/Guid/ShellMapGuid.h +++ b/ShellPkg/Include/Guid/ShellMapGuid.h @@ -1,7 +1,7 @@ /** @file GUID for Shell Map for Get/Set via runtime services. - Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -22,4 +22,4 @@ extern EFI_GUID gShellMapGuid; -#endif \ No newline at end of file +#endif diff --git a/ShellPkg/Include/Library/HandleParsingLib.h b/ShellPkg/Include/Library/HandleParsingLib.h index 64161281c5..176525245a 100644 --- a/ShellPkg/Include/Library/HandleParsingLib.h +++ b/ShellPkg/Include/Library/HandleParsingLib.h @@ -1,7 +1,7 @@ /** @file Provides interface to advanced shell functionality for parsing both handle and protocol database. - Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -120,9 +120,9 @@ GetStringNameFromHandle( /** Get best support language for this driver. - - First base on the user input language to search, second base on the current - platform used language to search, third get the first language from the + + First base on the user input language to search, second base on the current + platform used language to search, third get the first language from the support language list. The caller need to free the buffer of the best language. @param[in] SupportedLanguages The support languages for this driver. diff --git a/ShellPkg/Include/Library/ShellCommandLib.h b/ShellPkg/Include/Library/ShellCommandLib.h index 616b0d3267..1a7161627b 100644 --- a/ShellPkg/Include/Library/ShellCommandLib.h +++ b/ShellPkg/Include/Library/ShellCommandLib.h @@ -4,7 +4,7 @@ This library is for use ONLY by shell commands linked into the shell application. This library will not function if it is used for UEFI Shell 2.0 Applications. - Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
(C) Copyright 2016 Hewlett Packard Enterprise Development LP
(C) Copyright 2013-2014 Hewlett-Packard Development Company, L.P.
This program and the accompanying materials @@ -507,10 +507,10 @@ ShellCommandConsistMappingUnInitialize ( ); /** - Create a consistent mapped name for the device specified by DevicePath + Create a consistent mapped name for the device specified by DevicePath based on the Table. - This must be called after ShellCommandConsistMappingInitialize() and + This must be called after ShellCommandConsistMappingInitialize() and before ShellCommandConsistMappingUnInitialize() is called. @param[in] DevicePath The pointer to the dev path for the device. diff --git a/ShellPkg/Include/Library/ShellLib.h b/ShellPkg/Include/Library/ShellLib.h index 268a767b70..e360a67ac7 100644 --- a/ShellPkg/Include/Library/ShellLib.h +++ b/ShellPkg/Include/Library/ShellLib.h @@ -1,7 +1,7 @@ /** @file Provides interface to shell functionality for shell commands and applications. - Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
+ Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -1356,9 +1356,9 @@ ShellFileHandleReadLine( /** Function to delete a file by name - + @param[in] FileName Pointer to file name to delete. - + @retval EFI_SUCCESS the file was deleted sucessfully @retval EFI_WARN_DELETE_FAILURE the handle was closed, but the file was not deleted @@ -1388,7 +1388,7 @@ ShellDeleteFileByName( @param[in] CommandToGetHelpOn Pointer to a string containing the command name of help file to be printed. @param[in] SectionToGetHelpOn Pointer to the section specifier(s). - @param[in] PrintCommandText If TRUE, prints the command followed by the help content, otherwise prints + @param[in] PrintCommandText If TRUE, prints the command followed by the help content, otherwise prints the help content only. @retval EFI_DEVICE_ERROR The help data format was incorrect. @retval EFI_NOT_FOUND The help data could not be found. diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h index 68bb00c620..601520cb1e 100644 --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h @@ -1,7 +1,7 @@ /** @file Provides interface to advanced shell functionality for parsing both handle and protocol database. - Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.
+ Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
(C) Copyright 2016 Hewlett Packard Enterprise Development LP
(C) Copyright 2013-2016 Hewlett-Packard Development Company, L.P.
This program and the accompanying materials @@ -163,53 +163,53 @@ /// EFI_FIRMWARE_IMAGE_DESCRIPTOR in UEFI spec < 2.4a /// typedef struct { - /// - /// A unique number identifying the firmware image within the device. The number is + /// + /// A unique number identifying the firmware image within the device. The number is /// between 1 and DescriptorCount. - /// + /// UINT8 ImageIndex; /// - /// A unique number identifying the firmware image type. - /// + /// A unique number identifying the firmware image type. + /// EFI_GUID ImageTypeId; - /// - /// A unique number identifying the firmware image. - /// + /// + /// A unique number identifying the firmware image. + /// UINT64 ImageId; - /// - /// A pointer to a null-terminated string representing the firmware image name. - /// + /// + /// A pointer to a null-terminated string representing the firmware image name. + /// CHAR16 *ImageIdName; - /// - /// Identifies the version of the device firmware. The format is vendor specific and new + /// + /// Identifies the version of the device firmware. The format is vendor specific and new /// version must have a greater value than an old version. - /// + /// UINT32 Version; - /// + /// /// A pointer to a null-terminated string representing the firmware image version name. - /// + /// CHAR16 *VersionName; - /// + /// /// Size of the image in bytes. If size=0, then only ImageIndex and ImageTypeId are valid. - /// + /// UINTN Size; - /// - /// Image attributes that are supported by this device. See 'Image Attribute Definitions' - /// for possible returned values of this parameter. A value of 1 indicates the attribute is - /// supported and the current setting value is indicated in AttributesSetting. A - /// value of 0 indicates the attribute is not supported and the current setting value in + /// + /// Image attributes that are supported by this device. See 'Image Attribute Definitions' + /// for possible returned values of this parameter. A value of 1 indicates the attribute is + /// supported and the current setting value is indicated in AttributesSetting. A + /// value of 0 indicates the attribute is not supported and the current setting value in /// AttributesSetting is meaningless. - /// + /// UINT64 AttributesSupported; - /// - /// Image attributes. See 'Image Attribute Definitions' for possible returned values of + /// + /// Image attributes. See 'Image Attribute Definitions' for possible returned values of /// this parameter. - /// + /// UINT64 AttributesSetting; - /// - /// Image compatibilities. See 'Image Compatibility Definitions' for possible returned + /// + /// Image compatibilities. See 'Image Compatibility Definitions' for possible returned /// values of this parameter. - /// + /// UINT64 Compatibilities; } EFI_FIRMWARE_IMAGE_DESCRIPTOR_V1; @@ -218,53 +218,53 @@ typedef struct { /// EFI_FIRMWARE_IMAGE_DESCRIPTOR in UEFI spec > 2.4a and < 2.5 /// typedef struct { - /// - /// A unique number identifying the firmware image within the device. The number is + /// + /// A unique number identifying the firmware image within the device. The number is /// between 1 and DescriptorCount. - /// + /// UINT8 ImageIndex; /// - /// A unique number identifying the firmware image type. - /// + /// A unique number identifying the firmware image type. + /// EFI_GUID ImageTypeId; - /// - /// A unique number identifying the firmware image. - /// + /// + /// A unique number identifying the firmware image. + /// UINT64 ImageId; - /// - /// A pointer to a null-terminated string representing the firmware image name. - /// + /// + /// A pointer to a null-terminated string representing the firmware image name. + /// CHAR16 *ImageIdName; - /// - /// Identifies the version of the device firmware. The format is vendor specific and new + /// + /// Identifies the version of the device firmware. The format is vendor specific and new /// version must have a greater value than an old version. - /// + /// UINT32 Version; - /// + /// /// A pointer to a null-terminated string representing the firmware image version name. - /// + /// CHAR16 *VersionName; - /// + /// /// Size of the image in bytes. If size=0, then only ImageIndex and ImageTypeId are valid. - /// + /// UINTN Size; - /// - /// Image attributes that are supported by this device. See 'Image Attribute Definitions' - /// for possible returned values of this parameter. A value of 1 indicates the attribute is - /// supported and the current setting value is indicated in AttributesSetting. A - /// value of 0 indicates the attribute is not supported and the current setting value in + /// + /// Image attributes that are supported by this device. See 'Image Attribute Definitions' + /// for possible returned values of this parameter. A value of 1 indicates the attribute is + /// supported and the current setting value is indicated in AttributesSetting. A + /// value of 0 indicates the attribute is not supported and the current setting value in /// AttributesSetting is meaningless. - /// + /// UINT64 AttributesSupported; - /// - /// Image attributes. See 'Image Attribute Definitions' for possible returned values of + /// + /// Image attributes. See 'Image Attribute Definitions' for possible returned values of /// this parameter. - /// + /// UINT64 AttributesSetting; - /// - /// Image compatibilities. See 'Image Compatibility Definitions' for possible returned + /// + /// Image compatibilities. See 'Image Compatibility Definitions' for possible returned /// values of this parameter. - /// + /// UINT64 Compatibilities; /// /// Describes the lowest ImageDescriptor version that the device will accept. Only diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf index 05b9a7b769..95252ee915 100644 --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf @@ -1,6 +1,6 @@ ## @file # Provides interface to advanced shell functionality for parsing both handle and protocol database. -# Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
+# Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
# (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
# (C) Copyright 2015 Hewlett Packard Enterprise Development LP
# @@ -354,4 +354,4 @@ [Pcd.common] gEfiShellPkgTokenSpaceGuid.PcdShellPrintBufferSize ## CONSUMES - gEfiShellPkgTokenSpaceGuid.PcdShellIncludeNtGuids ## CONSUMES \ No newline at end of file + gEfiShellPkgTokenSpaceGuid.PcdShellIncludeNtGuids ## CONSUMES diff --git a/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c b/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c index ee3db63358..079802f652 100644 --- a/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c +++ b/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c @@ -2,7 +2,7 @@ Main file for BCFG command. (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -94,8 +94,8 @@ typedef struct { **/ EFI_STATUS UpdateOptionalData( - UINT16 Index, - UINTN DataSize, + UINT16 Index, + UINTN DataSize, UINT8 *Data, IN CONST BCFG_OPERATION_TARGET Target ) @@ -109,7 +109,7 @@ UpdateOptionalData( UINTN OriginalOptionDataSize; UnicodeSPrint(VariableName, sizeof(VariableName), L"%s%04x", Target == BcfgTargetBootOrder?L"Boot":L"Driver", Index); - + OriginalSize = 0; OriginalData = NULL; NewData = NULL; @@ -157,7 +157,7 @@ UpdateOptionalData( // put the data back under the variable // Status = gRT->SetVariable( - VariableName, + VariableName, (EFI_GUID*)&gEfiGlobalVariableGuid, EFI_VARIABLE_NON_VOLATILE|EFI_VARIABLE_BOOTSERVICE_ACCESS|EFI_VARIABLE_RUNTIME_ACCESS, NewSize, @@ -180,7 +180,7 @@ UpdateOptionalData( **/ EFI_STATUS GetBootOptionCrc( - UINT32 *Crc, + UINT32 *Crc, UINT16 BootIndex ) { @@ -629,7 +629,7 @@ BcfgAdd( (VOID**)&FilePath); } if (EFI_ERROR (Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_HANDLE), gShellBcfgHiiHandle, L"bcfg", HandleNumber); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_HANDLE), gShellBcfgHiiHandle, L"bcfg", HandleNumber); ShellStatus = SHELL_INVALID_PARAMETER; } } else { @@ -660,7 +660,7 @@ BcfgAdd( || ParentControllerHandleCount > 0 || ChildControllerHandleCount > 0 || !EFI_ERROR(Status) ) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", L"Handle Number"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", L"Handle Number"); ShellStatus = SHELL_INVALID_PARAMETER; } else { // @@ -680,18 +680,18 @@ BcfgAdd( // // If filename matched nothing fail // - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellBcfgHiiHandle, L"bcfg", File); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellBcfgHiiHandle, L"bcfg", File); ShellStatus = SHELL_INVALID_PARAMETER; } else if (FileList->Link.ForwardLink != FileList->Link.BackLink) { // // If filename expanded to multiple names, fail // - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_FILE), gShellBcfgHiiHandle, L"bcfg", File); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_FILE), gShellBcfgHiiHandle, L"bcfg", File); ShellStatus = SHELL_INVALID_PARAMETER; } else { Arg = (EFI_SHELL_FILE_INFO*)GetFirstNode(&FileList->Link); if (EFI_ERROR(Arg->Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_FILE_OPEN), gShellBcfgHiiHandle, L"bcfg", File); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_FILE_OPEN), gShellBcfgHiiHandle, L"bcfg", File); ShellStatus = SHELL_INVALID_PARAMETER; } else { // @@ -703,7 +703,7 @@ BcfgAdd( // DevicePath = gEfiShellProtocol->GetDevicePathFromFilePath(Arg->FullName); if (DevicePath == NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_FILE_DP), gShellBcfgHiiHandle, L"bcfg", Arg->FullName); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_FILE_DP), gShellBcfgHiiHandle, L"bcfg", Arg->FullName); ShellStatus = SHELL_UNSUPPORTED; } else { if (UsePath) { @@ -752,7 +752,7 @@ BcfgAdd( } if (TargetLocation == 0xFFFF) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_TARGET_NF), gShellBcfgHiiHandle, L"bcfg"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_TARGET_NF), gShellBcfgHiiHandle, L"bcfg"); } else { ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_TARGET), gShellBcfgHiiHandle, TargetLocation); } @@ -794,7 +794,7 @@ BcfgAdd( } if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_SET_VAR_FAIL), gShellBcfgHiiHandle, L"bcfg", OptionStr); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_SET_VAR_FAIL), gShellBcfgHiiHandle, L"bcfg", OptionStr); } else { NewOrder = AllocateZeroPool ((OrderCount + 1) * sizeof (NewOrder[0])); if (NewOrder != NULL) { @@ -882,7 +882,7 @@ BcfgRemove( 0, NULL); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_WRITE_FAIL), gShellBcfgHiiHandle, L"bcfg", VariableName); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_WRITE_FAIL), gShellBcfgHiiHandle, L"bcfg", VariableName); return (SHELL_INVALID_PARAMETER); } NewOrder = AllocateZeroPool(OrderCount*sizeof(CurrentOrder[0])); @@ -903,7 +903,7 @@ BcfgRemove( Status = EFI_OUT_OF_RESOURCES; } if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_WRITE_FAIL), gShellBcfgHiiHandle, L"bcfg", Target == BcfgTargetBootOrder?(CHAR16*)L"BootOrder":(CHAR16*)L"DriverOrder"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_WRITE_FAIL), gShellBcfgHiiHandle, L"bcfg", Target == BcfgTargetBootOrder?(CHAR16*)L"BootOrder":(CHAR16*)L"DriverOrder"); return (SHELL_INVALID_PARAMETER); } return (SHELL_SUCCESS); @@ -965,7 +965,7 @@ BcfgMove( FreePool(NewOrder); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_WRITE_FAIL), gShellBcfgHiiHandle, L"bcfg", Target == BcfgTargetBootOrder?(CHAR16*)L"BootOrder":(CHAR16*)L"DriverOrder"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_WRITE_FAIL), gShellBcfgHiiHandle, L"bcfg", Target == BcfgTargetBootOrder?(CHAR16*)L"BootOrder":(CHAR16*)L"DriverOrder"); return (SHELL_INVALID_PARAMETER); } return (SHELL_SUCCESS); @@ -1027,7 +1027,7 @@ BcfgAddOpt( // Status = ShellConvertStringToUint64(Walker, &Intermediate, FALSE, TRUE); if (EFI_ERROR(Status) || (((UINT16)Intermediate) != Intermediate) || StrStr(Walker, L" ") == NULL || ((UINT16)Intermediate) > ((UINT16)OrderCount)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", L"Option Index"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", L"Option Index"); ShellStatus = SHELL_INVALID_PARAMETER; return (ShellStatus); } @@ -1042,7 +1042,7 @@ BcfgAddOpt( } // - // determine whether we have file with data, quote delimited information, or a hot-key + // determine whether we have file with data, quote delimited information, or a hot-key // if (Walker[0] == L'\"') { // @@ -1050,12 +1050,12 @@ BcfgAddOpt( // Temp = StrStr(Walker+1, L"\""); if (Temp == NULL || StrLen(Temp) != 1) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", Walker); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", Walker); ShellStatus = SHELL_INVALID_PARAMETER; } else { FileName = StrnCatGrow(&FileName, NULL, Walker+1, 0); if (FileName == NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellBcfgHiiHandle, L"bcfg"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellBcfgHiiHandle, L"bcfg"); ShellStatus = SHELL_OUT_OF_RESOURCES; return (ShellStatus); } @@ -1064,7 +1064,7 @@ BcfgAddOpt( Temp2[0] = CHAR_NULL; Temp2++; if (StrLen(Temp2)>0) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", Walker); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", Walker); ShellStatus = SHELL_INVALID_PARAMETER; } if (EFI_ERROR(ShellFileExists(Walker))) { @@ -1086,14 +1086,14 @@ BcfgAddOpt( // filename // if (EFI_ERROR(ShellFileExists(Walker))) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FIND_FAIL), gShellBcfgHiiHandle, L"bcfg", Walker); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FIND_FAIL), gShellBcfgHiiHandle, L"bcfg", Walker); ShellStatus = SHELL_INVALID_PARAMETER; } else { FileName = StrnCatGrow(&FileName, NULL, Walker, 0); } } else { if (Target != BcfgTargetBootOrder) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_BOOT_ONLY), gShellBcfgHiiHandle, L"bcfg"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_BOOT_ONLY), gShellBcfgHiiHandle, L"bcfg"); ShellStatus = SHELL_INVALID_PARAMETER; } @@ -1103,7 +1103,7 @@ BcfgAddOpt( // Status = ShellConvertStringToUint64(Walker, &Intermediate, FALSE, TRUE); if (EFI_ERROR(Status) || (((UINT32)Intermediate) != Intermediate) || StrStr(Walker, L" ") == NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", Walker); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", Walker); ShellStatus = SHELL_INVALID_PARAMETER; } NewKeyOption.KeyData.PackedValue = (UINT32)Intermediate; @@ -1118,12 +1118,12 @@ BcfgAddOpt( if (ShellStatus == SHELL_SUCCESS) { // - // Now we know how many EFI_INPUT_KEY structs we need to attach to the end of the EFI_KEY_OPTION struct. + // Now we know how many EFI_INPUT_KEY structs we need to attach to the end of the EFI_KEY_OPTION struct. // Re-allocate with the added information. // KeyOptionBuffer = AllocatePool (sizeof(EFI_KEY_OPTION) + (sizeof(EFI_INPUT_KEY) * NewKeyOption.KeyData.Options.InputKeyCount)); if (KeyOptionBuffer == NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_MEM), gShellBcfgHiiHandle, L"bcfg"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_MEM), gShellBcfgHiiHandle, L"bcfg"); ShellStatus = SHELL_OUT_OF_RESOURCES; return ShellStatus; } @@ -1135,7 +1135,7 @@ BcfgAddOpt( // Status = ShellConvertStringToUint64(Walker, &Intermediate, FALSE, TRUE); if (EFI_ERROR(Status) || (((UINT16)Intermediate) != Intermediate) || StrStr(Walker, L" ") == NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", Walker); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", Walker); ShellStatus = SHELL_INVALID_PARAMETER; } ((EFI_INPUT_KEY*)(((UINT8*)KeyOptionBuffer) + sizeof(EFI_KEY_OPTION)))[LoopCounter].ScanCode = (UINT16)Intermediate; @@ -1152,7 +1152,7 @@ BcfgAddOpt( // Status = ShellConvertStringToUint64(Walker, &Intermediate, FALSE, TRUE); if (EFI_ERROR(Status) || (((UINT16)Intermediate) != Intermediate)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", Walker); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", Walker); ShellStatus = SHELL_INVALID_PARAMETER; } ((EFI_INPUT_KEY*)(((UINT8*)KeyOptionBuffer) + sizeof(EFI_KEY_OPTION)))[LoopCounter].UnicodeChar = (UINT16)Intermediate; @@ -1173,9 +1173,9 @@ BcfgAddOpt( KeyOptionBuffer->BootOption = CurrentOrder[OptionIndex]; Status = GetBootOptionCrc(&(KeyOptionBuffer->BootOptionCrc), KeyOptionBuffer->BootOption); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", L"Option Index"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", L"Option Index"); ShellStatus = SHELL_INVALID_PARAMETER; - } + } } if (ShellStatus == SHELL_SUCCESS) { @@ -1197,11 +1197,11 @@ BcfgAddOpt( sizeof(EFI_KEY_OPTION) + (sizeof(EFI_INPUT_KEY) * NewKeyOption.KeyData.Options.InputKeyCount), KeyOptionBuffer); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_SET_VAR_FAIL), gShellBcfgHiiHandle, L"bcfg", VariableName); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_SET_VAR_FAIL), gShellBcfgHiiHandle, L"bcfg", VariableName); ShellStatus = SHELL_INVALID_PARAMETER; - } + } } else { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_VAR_NO_NUM), gShellBcfgHiiHandle, L"bcfg"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_VAR_NO_NUM), gShellBcfgHiiHandle, L"bcfg"); ShellStatus = SHELL_INVALID_PARAMETER; } ASSERT(FileName == NULL && Data == NULL); @@ -1229,7 +1229,7 @@ BcfgAddOpt( } Data = AllocateZeroPool((UINTN)Intermediate); if (Data == NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_MEM), gShellBcfgHiiHandle, L"bcfg"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_MEM), gShellBcfgHiiHandle, L"bcfg"); ShellStatus = SHELL_OUT_OF_RESOURCES; } if (!EFI_ERROR(Status)) { @@ -1242,14 +1242,14 @@ BcfgAddOpt( if (!EFI_ERROR(Status) && ShellStatus == SHELL_SUCCESS && Data != NULL) { Status = UpdateOptionalData(CurrentOrder[OptionIndex], (UINTN)Intermediate, (UINT8*)Data, Target); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_SET_VAR_FAIL), gShellBcfgHiiHandle, L"bcfg", VariableName); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_SET_VAR_FAIL), gShellBcfgHiiHandle, L"bcfg", VariableName); ShellStatus = SHELL_INVALID_PARAMETER; - } + } } if (EFI_ERROR(Status) && ShellStatus == SHELL_SUCCESS) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_SET_VAR_FAIL), gShellBcfgHiiHandle, L"bcfg", VariableName); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_SET_VAR_FAIL), gShellBcfgHiiHandle, L"bcfg", VariableName); ShellStatus = SHELL_INVALID_PARAMETER; - } + } } SHELL_FREE_NON_NULL(Data); @@ -1291,7 +1291,7 @@ BcfgDisplayDump( UINTN OptionalDataOffset; if (OrderCount == 0) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_BCFG_NONE), gShellBcfgHiiHandle, L"bcfg"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_BCFG_NONE), gShellBcfgHiiHandle, L"bcfg"); return (SHELL_SUCCESS); } @@ -1321,7 +1321,7 @@ BcfgDisplayDump( } if (EFI_ERROR(Status) || Buffer == NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_READ_FAIL), gShellBcfgHiiHandle, L"bcfg", VariableName); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_READ_FAIL), gShellBcfgHiiHandle, L"bcfg", VariableName); ++Errors; goto Cleanup; } @@ -1463,7 +1463,7 @@ ShellCommandRunBcfg ( Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellBcfgHiiHandle, L"bcfg", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellBcfgHiiHandle, L"bcfg", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -1476,7 +1476,7 @@ ShellCommandRunBcfg ( if (ShellCommandLineGetFlag(Package, L"-opt")) { CurrentOperation.OptData = ShellCommandLineGetValue(Package, L"-opt"); if (CurrentOperation.OptData == NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellBcfgHiiHandle, L"bcfg", L"-opt"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellBcfgHiiHandle, L"bcfg", L"-opt"); ShellStatus = SHELL_INVALID_PARAMETER; } CurrentOperation.Type = BcfgTypeOpt; @@ -1488,14 +1488,14 @@ ShellCommandRunBcfg ( if ((ShellCommandLineGetCount(Package) < 3 && CurrentOperation.Type != BcfgTypeOpt) || (ShellCommandLineGetCount(Package) < 2 && CurrentOperation.Type == BcfgTypeOpt) ){ - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellBcfgHiiHandle, L"bcfg"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellBcfgHiiHandle, L"bcfg"); ShellStatus = SHELL_INVALID_PARAMETER; } else if (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)ShellCommandLineGetRawValue(Package, 1), L"driver") == 0) { CurrentOperation.Target = BcfgTargetDriverOrder; } else if (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)ShellCommandLineGetRawValue(Package, 1), L"boot") == 0) { CurrentOperation.Target = BcfgTargetBootOrder; } else { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_DRIVER_BOOT), gShellBcfgHiiHandle, L"bcfg"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_DRIVER_BOOT), gShellBcfgHiiHandle, L"bcfg"); ShellStatus = SHELL_INVALID_PARAMETER; } @@ -1541,17 +1541,17 @@ ShellCommandRunBcfg ( ShellStatus = SHELL_INVALID_PARAMETER; } } else if (ShellCommandLineGetFlag(Package, L"-v")) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", L"-v (without dump)"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", L"-v (without dump)"); ShellStatus = SHELL_INVALID_PARAMETER; } else if (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)CurrentParam, L"add") == 0) { if ((ParamNumber + 3) >= ShellCommandLineGetCount(Package)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellBcfgHiiHandle, L"bcfg"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellBcfgHiiHandle, L"bcfg"); ShellStatus = SHELL_INVALID_PARAMETER; } CurrentOperation.Type = BcfgTypeAdd; CurrentParam = ShellCommandLineGetRawValue(Package, ++ParamNumber); if (CurrentParam == NULL || !ShellIsHexOrDecimalNumber(CurrentParam, TRUE, FALSE)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", CurrentParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", CurrentParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE); @@ -1563,13 +1563,13 @@ ShellCommandRunBcfg ( } } else if (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)CurrentParam, L"addp") == 0) { if ((ParamNumber + 3) >= ShellCommandLineGetCount(Package)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellBcfgHiiHandle, L"bcfg"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellBcfgHiiHandle, L"bcfg"); ShellStatus = SHELL_INVALID_PARAMETER; } CurrentOperation.Type = BcfgTypeAddp; CurrentParam = ShellCommandLineGetRawValue(Package, ++ParamNumber); if (CurrentParam == NULL || !ShellIsHexOrDecimalNumber(CurrentParam, TRUE, FALSE)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", CurrentParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", CurrentParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE); @@ -1581,20 +1581,20 @@ ShellCommandRunBcfg ( } } else if (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)CurrentParam, L"addh") == 0) { if ((ParamNumber + 3) >= ShellCommandLineGetCount(Package)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellBcfgHiiHandle, L"bcfg"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellBcfgHiiHandle, L"bcfg"); ShellStatus = SHELL_INVALID_PARAMETER; } CurrentOperation.Type = BcfgTypeAddh; CurrentParam = ShellCommandLineGetRawValue(Package, ++ParamNumber); if (CurrentParam == NULL || !ShellIsHexOrDecimalNumber(CurrentParam, TRUE, FALSE)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", CurrentParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", CurrentParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE); CurrentOperation.Number1 = (UINT16)Intermediate; CurrentParam = ShellCommandLineGetRawValue(Package, ++ParamNumber); if (CurrentParam == NULL || !ShellIsHexOrDecimalNumber(CurrentParam, TRUE, FALSE)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", CurrentParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", CurrentParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE); @@ -1605,42 +1605,42 @@ ShellCommandRunBcfg ( } } else if (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)CurrentParam, L"rm") == 0) { if ((ParamNumber + 1) >= ShellCommandLineGetCount(Package)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellBcfgHiiHandle, L"bcfg"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellBcfgHiiHandle, L"bcfg"); ShellStatus = SHELL_INVALID_PARAMETER; } CurrentOperation.Type = BcfgTypeRm; CurrentParam = ShellCommandLineGetRawValue(Package, ++ParamNumber); if (CurrentParam == NULL || !ShellIsHexOrDecimalNumber(CurrentParam, TRUE, FALSE)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", CurrentParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", CurrentParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE); CurrentOperation.Number1 = (UINT16)Intermediate; if (CurrentOperation.Number1 >= Count){ - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_NUMB_RANGE), gShellBcfgHiiHandle, L"bcfg", Count); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_NUMB_RANGE), gShellBcfgHiiHandle, L"bcfg", Count); ShellStatus = SHELL_INVALID_PARAMETER; } } } else if (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)CurrentParam, L"mv") == 0) { if ((ParamNumber + 2) >= ShellCommandLineGetCount(Package)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellBcfgHiiHandle, L"bcfg"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellBcfgHiiHandle, L"bcfg"); ShellStatus = SHELL_INVALID_PARAMETER; } CurrentOperation.Type = BcfgTypeMv; CurrentParam = ShellCommandLineGetRawValue(Package, ++ParamNumber); if (CurrentParam == NULL || !ShellIsHexOrDecimalNumber(CurrentParam, TRUE, FALSE)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", CurrentParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", CurrentParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE); CurrentOperation.Number1 = (UINT16)Intermediate; if (CurrentOperation.Number1 >= Count){ - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_NUMB_RANGE), gShellBcfgHiiHandle, L"bcfg", Count); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_NUMB_RANGE), gShellBcfgHiiHandle, L"bcfg", Count); ShellStatus = SHELL_INVALID_PARAMETER; } else { CurrentParam = ShellCommandLineGetRawValue(Package, ++ParamNumber); if (CurrentParam == NULL || !ShellIsHexOrDecimalNumber(CurrentParam, TRUE, FALSE)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", CurrentParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", CurrentParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE); @@ -1649,7 +1649,7 @@ ShellCommandRunBcfg ( if (CurrentOperation.Number2 == CurrentOperation.Number1 ||CurrentOperation.Number2 >= Count ){ - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_NUMB_RANGE), gShellBcfgHiiHandle, L"bcfg", Count); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_NUMB_RANGE), gShellBcfgHiiHandle, L"bcfg", Count); ShellStatus = SHELL_INVALID_PARAMETER; } } @@ -1751,7 +1751,7 @@ ShellCommandRunBcfg ( } } } else { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", CurrentParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", CurrentParam); ShellStatus = SHELL_INVALID_PARAMETER; } } diff --git a/ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf b/ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf index 500b1663ca..03f50d0511 100644 --- a/ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf +++ b/ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf @@ -1,7 +1,7 @@ ## @file # Provides interface to shell functionality for shell commands and applications. # -# Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
+# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -40,5 +40,5 @@ [Protocols] gEfiShellParametersProtocolGuid ## CONSUMES gEfiShellInterfaceGuid ## SOMETIMES_CONSUMES - + diff --git a/ShellPkg/Library/UefiShellCommandLib/ConsistMapping.c b/ShellPkg/Library/UefiShellCommandLib/ConsistMapping.c index 3b13e62340..96a944104e 100755 --- a/ShellPkg/Library/UefiShellCommandLib/ConsistMapping.c +++ b/ShellPkg/Library/UefiShellCommandLib/ConsistMapping.c @@ -1,7 +1,7 @@ /** @file Main file for support of shell consist mapping. - Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.
+ Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -56,10 +56,10 @@ typedef struct { @retval EFI_OUT_OF_RESOURCES Out of resources. @retval EFI_SUCCESS The appending was successful. **/ -typedef -EFI_STATUS +typedef +EFI_STATUS (*SERIAL_DECODE_FUNCTION) ( - EFI_DEVICE_PATH_PROTOCOL *DevPath, + EFI_DEVICE_PATH_PROTOCOL *DevPath, DEVICE_CONSIST_MAPPING_INFO *MapInfo, EFI_DEVICE_PATH_PROTOCOL *OrigDevPath ); @@ -640,7 +640,7 @@ DevPathSerialUsb ( UsbIo = NULL; if (!EFI_ERROR(Status)) { Status = gBS->OpenProtocol(TempHandle, &gEfiUsbIoProtocolGuid, (VOID**)&UsbIo, gImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL); - } + } if (!EFI_ERROR(Status)) { ASSERT(UsbIo != NULL); @@ -661,7 +661,7 @@ DevPathSerialUsb ( } } } - } + } } return Status; } @@ -1520,13 +1520,13 @@ ShellCommandConsistMappingInitialize ( continue; } - Status = gBS->HandleProtocol( HandleBuffer[HandleLoop], - &gEfiBlockIoProtocolGuid, + Status = gBS->HandleProtocol( HandleBuffer[HandleLoop], + &gEfiBlockIoProtocolGuid, (VOID **)&BlockIo ); if (EFI_ERROR(Status)) { - Status = gBS->HandleProtocol( HandleBuffer[HandleLoop], - &gEfiSimpleFileSystemProtocolGuid, + Status = gBS->HandleProtocol( HandleBuffer[HandleLoop], + &gEfiSimpleFileSystemProtocolGuid, (VOID **)&SimpleFileSystem ); if (EFI_ERROR(Status)) { diff --git a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c b/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c index 0df252b420..ddc4bb1567 100644 --- a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c +++ b/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c @@ -79,7 +79,7 @@ CommandInit( UINTN Index; EFI_STATUS Status; CHAR8 *PlatformLang; - + GetEfiGlobalVariable2 (EFI_PLATFORM_LANG_VARIABLE_NAME, (VOID**)&PlatformLang, NULL); if (PlatformLang == NULL) { return EFI_UNSUPPORTED; @@ -115,7 +115,7 @@ CommandInit( // // Find the best matching matching language from the supported languages - // of Unicode Collation2 protocol. + // of Unicode Collation2 protocol. // BestLanguage = GetBestLanguage ( Uc->SupportedLanguages, @@ -311,7 +311,7 @@ ShellCommandFindDynamicCommand ( // // not found or out of resources // - return NULL; + return NULL; } for (NextCommand = CommandHandleList; *NextCommand != NULL; NextCommand++) { @@ -328,7 +328,7 @@ ShellCommandFindDynamicCommand ( if (gUnicodeCollation->StriColl( gUnicodeCollation, (CHAR16*)CommandString, - (CHAR16*)DynamicCommand->CommandName) == 0 + (CHAR16*)DynamicCommand->CommandName) == 0 ){ FreePool(CommandHandleList); return (DynamicCommand); @@ -429,7 +429,7 @@ ShellCommandGetDynamicCommandHelp( // // TODO: how to get proper language? // - return DynamicCommand->GetHelp(DynamicCommand, "en"); + return DynamicCommand->GetHelp(DynamicCommand, "en"); } /** @@ -847,7 +847,7 @@ ShellCommandRegisterAlias ( { ALIAS_LIST *Node; ALIAS_LIST *CommandAlias; - ALIAS_LIST *PrevCommandAlias; + ALIAS_LIST *PrevCommandAlias; INTN LexicalMatchValue; // @@ -896,7 +896,7 @@ ShellCommandRegisterAlias ( // // Swap PrevCommandAlias and CommandAlias list entry if PrevCommandAlias list entry // is alphabetically greater than CommandAlias list entry - // + // if (LexicalMatchValue > 0) { CommandAlias = (ALIAS_LIST *) SwapListEntries (&PrevCommandAlias->Link, &CommandAlias->Link); } else if (LexicalMatchValue < 0) { diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Comp.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Comp.c index 7c232d01c7..485b97a07f 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Comp.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Comp.c @@ -154,7 +154,7 @@ ShellCommandRunComp ( Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"comp", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"comp", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -162,22 +162,22 @@ ShellCommandRunComp ( } } else { if (ShellCommandLineGetCount(Package) > 3) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"comp"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"comp"); ShellStatus = SHELL_INVALID_PARAMETER; } else if (ShellCommandLineGetCount(Package) < 3) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"comp"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"comp"); ShellStatus = SHELL_INVALID_PARAMETER; } else { TempParam = ShellCommandLineGetRawValue(Package, 1); ASSERT(TempParam != NULL); FileName1 = ShellFindFilePath(TempParam); if (FileName1 == NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_FIND_FAIL), gShellDebug1HiiHandle, L"comp", TempParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_FIND_FAIL), gShellDebug1HiiHandle, L"comp", TempParam); ShellStatus = SHELL_NOT_FOUND; } else { Status = ShellOpenFileByName(FileName1, &FileHandle1, EFI_FILE_MODE_READ, 0); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"comp", TempParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"comp", TempParam); ShellStatus = SHELL_NOT_FOUND; } } @@ -185,12 +185,12 @@ ShellCommandRunComp ( ASSERT(TempParam != NULL); FileName2 = ShellFindFilePath(TempParam); if (FileName2 == NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_FIND_FAIL), gShellDebug1HiiHandle, L"comp", TempParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_FIND_FAIL), gShellDebug1HiiHandle, L"comp", TempParam); ShellStatus = SHELL_NOT_FOUND; } else { Status = ShellOpenFileByName(FileName2, &FileHandle2, EFI_FILE_MODE_READ, 0); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"comp", TempParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"comp", TempParam); ShellStatus = SHELL_NOT_FOUND; } } diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c index cde2c54f1b..a8233a21f5 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c @@ -7,7 +7,7 @@ This sequence is further divided into Blocks and Huffman codings are applied to each Block. - Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -181,7 +181,7 @@ PutDword ( /** Allocate memory spaces for data structures used in compression process. - + @retval EFI_SUCCESS Memory was allocated successfully. @retval EFI_OUT_OF_RESOURCES A memory allocation failed. **/ @@ -740,7 +740,7 @@ MakeLen ( /** Assign code to each symbol based on the code length array. - + @param[in] LoopVar8 The number of symbols. @param[in] Len The code length array. @param[out] Code The stores codes for each symbol. @@ -764,7 +764,7 @@ MakeCode ( Code[LoopVar1] = Start[Len[LoopVar1]]++; } } - + /** Generates Huffman codes given a frequency distribution of symbols. @@ -1175,7 +1175,7 @@ HufEncodeStart ( /** Outputs an Original Character or a Pointer. - @param[in] LoopVar5 The original character or the 'String Length' element of + @param[in] LoopVar5 The original character or the 'String Length' element of a Pointer. @param[in] LoopVar7 The 'Position' field of a Pointer. **/ diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dblk.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Dblk.c index 3632ca8a7a..24f988cca2 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dblk.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Dblk.c @@ -2,7 +2,7 @@ Main file for Dblk shell Debug1 function. (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.
+ Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -69,11 +69,11 @@ DisplayTheBlocks( Status = BlockIo->ReadBlocks(BlockIo, BlockIo->Media->MediaId, Lba, BufferSize, Buffer); if (!EFI_ERROR(Status) && Buffer != NULL) { ShellPrintHiiEx( - -1, - -1, - NULL, - STRING_TOKEN (STR_DBLK_HEADER), - gShellDebug1HiiHandle, + -1, + -1, + NULL, + STRING_TOKEN (STR_DBLK_HEADER), + gShellDebug1HiiHandle, Lba, BufferSize, BlockIo @@ -81,7 +81,7 @@ DisplayTheBlocks( DumpHex(2,0,BufferSize,Buffer); } else { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_READ_FAIL), gShellDebug1HiiHandle, L"dblk", L"BlockIo"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_READ_FAIL), gShellDebug1HiiHandle, L"dblk", L"BlockIo"); ShellStatus = SHELL_DEVICE_ERROR; } @@ -135,7 +135,7 @@ ShellCommandRunDblk ( Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"dblk", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"dblk", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -143,10 +143,10 @@ ShellCommandRunDblk ( } } else { if (ShellCommandLineGetCount(Package) > 4) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"dblk"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"dblk"); ShellStatus = SHELL_INVALID_PARAMETER; } else if (ShellCommandLineGetCount(Package) < 2) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"dblk"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"dblk"); ShellStatus = SHELL_INVALID_PARAMETER; } else { // @@ -160,7 +160,7 @@ ShellCommandRunDblk ( Lba = 0; } else { if (!ShellIsHexOrDecimalNumber(LbaString, TRUE, FALSE)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dblk", LbaString); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dblk", LbaString); ShellStatus = SHELL_INVALID_PARAMETER; } ShellConvertStringToUint64(LbaString, &Lba, TRUE, FALSE); @@ -170,29 +170,29 @@ ShellCommandRunDblk ( BlockCount = 1; } else { if (!ShellIsHexOrDecimalNumber(BlockCountString, TRUE, FALSE)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dblk", BlockCountString); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dblk", BlockCountString); ShellStatus = SHELL_INVALID_PARAMETER; } ShellConvertStringToUint64(BlockCountString, &BlockCount, TRUE, FALSE); if (BlockCount > 0x10) { BlockCount = 0x10; } else if (BlockCount == 0) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dblk", BlockCountString); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dblk", BlockCountString); ShellStatus = SHELL_INVALID_PARAMETER; } } - + if (ShellStatus == SHELL_SUCCESS) { // // do the work if we have a valid block identifier // if (gEfiShellProtocol->GetDevicePathFromMap(BlockName) == NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dblk", BlockName); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dblk", BlockName); ShellStatus = SHELL_INVALID_PARAMETER; } else { DevPath = (EFI_DEVICE_PATH_PROTOCOL*)gEfiShellProtocol->GetDevicePathFromMap(BlockName); if (gBS->LocateDevicePath(&gEfiBlockIoProtocolGuid, &DevPath, NULL) == EFI_NOT_FOUND) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_MAP_PROTOCOL), gShellDebug1HiiHandle, L"dblk", BlockName, L"BlockIo"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_MAP_PROTOCOL), gShellDebug1HiiHandle, L"dblk", BlockName, L"BlockIo"); ShellStatus = SHELL_INVALID_PARAMETER; } else { ShellStatus = DisplayTheBlocks(gEfiShellProtocol->GetDevicePathFromMap(BlockName), Lba, (UINT8)BlockCount); diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c index 42efb4c7d5..f38593a9e9 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c @@ -1,9 +1,9 @@ /** @file Main file for Dmem shell Debug1 function. - Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
- (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
- (C) Copyright 2015 Hewlett Packard Enterprise Development LP
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
+ (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
+ (C) Copyright 2015 Hewlett Packard Enterprise Development LP
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -62,7 +62,7 @@ DisplayMmioMemory( Status = gBS->LocateProtocol(&gEfiPciRootBridgeIoProtocolGuid, NULL, (VOID**)&PciRbIo); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PCIRBIO_NF), gShellDebug1HiiHandle, L"dmem"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PCIRBIO_NF), gShellDebug1HiiHandle, L"dmem"); return (SHELL_NOT_FOUND); } Buffer = AllocateZeroPool(Size); @@ -72,7 +72,7 @@ DisplayMmioMemory( Status = PciRbIo->Mem.Read(PciRbIo, EfiPciWidthUint8, (UINT64)(UINTN)Address, Size, Buffer); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PCIRBIO_ER), gShellDebug1HiiHandle, L"dmem"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PCIRBIO_ER), gShellDebug1HiiHandle, L"dmem"); ShellStatus = SHELL_NOT_FOUND; } else { ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMEM_MMIO_HEADER_ROW), gShellDebug1HiiHandle, (UINT64)(UINTN)Address, Size); @@ -135,7 +135,7 @@ ShellCommandRunDmem ( Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"dmem", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"dmem", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -143,7 +143,7 @@ ShellCommandRunDmem ( } } else { if (ShellCommandLineGetCount(Package) > 3) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"dmem"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"dmem"); ShellStatus = SHELL_INVALID_PARAMETER; } else { Temp1 = ShellCommandLineGetRawValue(Package, 1); @@ -152,15 +152,15 @@ ShellCommandRunDmem ( Size = 512; } else { if (!ShellIsHexOrDecimalNumber(Temp1, TRUE, FALSE) || EFI_ERROR(ShellConvertStringToUint64(Temp1, (UINT64*)&Address, TRUE, FALSE))) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dmem", Temp1); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dmem", Temp1); ShellStatus = SHELL_INVALID_PARAMETER; - } + } Temp1 = ShellCommandLineGetRawValue(Package, 2); if (Temp1 == NULL) { Size = 512; } else { if (!ShellIsHexOrDecimalNumber(Temp1, FALSE, FALSE) || EFI_ERROR(ShellConvertStringToUint64(Temp1, &Size, TRUE, FALSE))) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dmem", Temp1); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dmem", Temp1); ShellStatus = SHELL_INVALID_PARAMETER; } } @@ -204,7 +204,7 @@ ShellCommandRunDmem ( } } - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMEM_SYSTEM_TABLE), gShellDebug1HiiHandle, + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMEM_SYSTEM_TABLE), gShellDebug1HiiHandle, (UINT64)(UINTN)Address, gST->Hdr.HeaderSize, gST->Hdr.Revision, diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c index 5791da9acc..e656e18677 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c @@ -1,8 +1,8 @@ /** @file Main file for DmpStore shell Debug1 function. - + (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.
+ Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -51,7 +51,7 @@ GetAttrType ( BufLen = 0; RetString = NULL; - + if ((Atts & EFI_VARIABLE_NON_VOLATILE) != 0) { StrnCatGrow (&RetString, &BufLen, L"+NV", 0); } @@ -157,11 +157,11 @@ LoadVariablesFromFile ( if (EFI_ERROR (Status)) { return SHELL_DEVICE_ERROR; } - + ShellStatus = SHELL_SUCCESS; - + InitializeListHead (&List); - + Position = 0; while (Position < FileSize) { // @@ -220,7 +220,7 @@ LoadVariablesFromFile ( } Position += BufferSize + sizeof (Crc32); - + Variable = AllocateZeroPool (sizeof (*Variable) + NameSize + DataSize); if (Variable == NULL) { FreePool (Buffer); @@ -239,20 +239,20 @@ LoadVariablesFromFile ( InsertTailList (&List, &Variable->Link); FreePool (Buffer); } - + if ((Position != FileSize) || (ShellStatus != SHELL_SUCCESS)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_LOAD_BAD_FILE), gShellDebug1HiiHandle, L"dmpstore"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_LOAD_BAD_FILE), gShellDebug1HiiHandle, L"dmpstore"); if (Position != FileSize) { ShellStatus = SHELL_VOLUME_CORRUPTED; } } - + for ( Link = GetFirstNode (&List) ; !IsNull (&List, Link) && (ShellStatus == SHELL_SUCCESS) ; Link = GetNextNode (&List, Link) ) { Variable = CR (Link, DMP_STORE_VARIABLE, Link, DMP_STORE_VARIABLE_SIGNATURE); - + if (((Name == NULL) || gUnicodeCollation->MetaiMatch (gUnicodeCollation, Variable->Name, (CHAR16 *) Name)) && ((Guid == NULL) || CompareGuid (&Variable->Guid, Guid)) ) { @@ -272,7 +272,7 @@ LoadVariablesFromFile ( Variable->Data ); if (EFI_ERROR (Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_LOAD_GEN_FAIL), gShellDebug1HiiHandle, L"dmpstore", Variable->Name, Status); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_LOAD_GEN_FAIL), gShellDebug1HiiHandle, L"dmpstore", Variable->Name, Status); } } } @@ -369,19 +369,19 @@ AppendSingleVariableToFile ( Status = ShellWriteFile (FileHandle, &BufferSize, Buffer); FreePool (Buffer); - if (!EFI_ERROR (Status) && + if (!EFI_ERROR (Status) && (BufferSize != sizeof (NameSize) + sizeof (DataSize) + sizeof (*Guid) + sizeof (Attributes) + NameSize + DataSize + sizeof (UINT32)) ) { Status = EFI_DEVICE_ERROR; } - + return Status; } /** Recursive function to display or delete variables. - This function will call itself to create a stack-based list of allt he variables to process, + This function will call itself to create a stack-based list of allt he variables to process, then fromt he last to the first, they will do either printing or deleting. This is necessary since once a delete happens GetNextVariableName() will work. @@ -480,9 +480,9 @@ CascadeProcessVariables ( // No matter what happened we process our own variable // Only continue if Guid and VariableName are each either NULL or a match // - if ( ( Name == NULL + if ( ( Name == NULL || gUnicodeCollation->MetaiMatch(gUnicodeCollation, FoundVarName, (CHAR16*) Name) ) - && ( Guid == NULL + && ( Guid == NULL || CompareGuid(&FoundVarGuid, Guid) ) ) { DataSize = 0; @@ -634,16 +634,16 @@ ProcessVariables ( if (!Found) { if (ShellStatus == SHELL_OUT_OF_RESOURCES) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellDebug1HiiHandle, L"dmpstore"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellDebug1HiiHandle, L"dmpstore"); return (ShellStatus); } else if (Name != NULL && Guid == NULL) { if (StandardFormatOutput) { ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_NO_VAR_FOUND_N_SFO), gShellDebug1HiiHandle, Name); } else { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_NO_VAR_FOUND_N), gShellDebug1HiiHandle, L"dmpstore", Name); + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_NO_VAR_FOUND_N), gShellDebug1HiiHandle, L"dmpstore", Name); } } else if (Name != NULL && Guid != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_NO_VAR_FOUND_GN), gShellDebug1HiiHandle, L"dmpstore", Guid, Name); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_NO_VAR_FOUND_GN), gShellDebug1HiiHandle, L"dmpstore", Guid, Name); } else if (Name == NULL && Guid == NULL) { if (StandardFormatOutput) { ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_NO_VAR_FOUND_SFO), gShellDebug1HiiHandle); @@ -656,7 +656,7 @@ ProcessVariables ( } else { ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_NO_VAR_FOUND_G), gShellDebug1HiiHandle, L"dmpstore", Guid); } - } + } return (SHELL_NOT_FOUND); } return (ShellStatus); @@ -710,7 +710,7 @@ ShellCommandRunDmpStore ( Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"dmpstore", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"dmpstore", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -718,19 +718,19 @@ ShellCommandRunDmpStore ( } } else { if (ShellCommandLineGetCount(Package) > 2) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"dmpstore"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"dmpstore"); ShellStatus = SHELL_INVALID_PARAMETER; } else if (ShellCommandLineGetFlag(Package, L"-all") && ShellCommandLineGetFlag(Package, L"-guid")) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDebug1HiiHandle, L"dmpstore", L"-all", L"-guid"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDebug1HiiHandle, L"dmpstore", L"-all", L"-guid"); ShellStatus = SHELL_INVALID_PARAMETER; } else if (ShellCommandLineGetFlag(Package, L"-s") && ShellCommandLineGetFlag(Package, L"-l")) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDebug1HiiHandle, L"dmpstore", L"-l", L"-s"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDebug1HiiHandle, L"dmpstore", L"-l", L"-s"); ShellStatus = SHELL_INVALID_PARAMETER; } else if ((ShellCommandLineGetFlag(Package, L"-s") || ShellCommandLineGetFlag(Package, L"-l")) && ShellCommandLineGetFlag(Package, L"-d")) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDebug1HiiHandle, L"dmpstore", L"-l or -s", L"-d"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDebug1HiiHandle, L"dmpstore", L"-l or -s", L"-d"); ShellStatus = SHELL_INVALID_PARAMETER; } else if ((ShellCommandLineGetFlag(Package, L"-s") || ShellCommandLineGetFlag(Package, L"-l")) && ShellCommandLineGetFlag(Package, L"-sfo")) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDebug1HiiHandle, L"dmpstore", L"-l or -s", L"-sfo"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDebug1HiiHandle, L"dmpstore", L"-l or -s", L"-sfo"); ShellStatus = SHELL_INVALID_PARAMETER; } else { // @@ -741,7 +741,7 @@ ShellCommandRunDmpStore ( if (GuidStr != NULL) { RStatus = StrToGuid (GuidStr, &GuidData); if (RETURN_ERROR (RStatus) || (GuidStr[GUID_STRING_LENGTH] != L'\0')) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dmpstore", GuidStr); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dmpstore", GuidStr); ShellStatus = SHELL_INVALID_PARAMETER; } Guid = &GuidData; @@ -762,7 +762,7 @@ ShellCommandRunDmpStore ( Type = DmpStoreSave; File = ShellCommandLineGetValue(Package, L"-s"); if (File == NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"dmpstore", L"-s"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"dmpstore", L"-s"); ShellStatus = SHELL_INVALID_PARAMETER; } else { Status = ShellOpenFileByName (File, &FileHandle, EFI_FILE_MODE_WRITE | EFI_FILE_MODE_READ, 0); @@ -772,16 +772,16 @@ ShellCommandRunDmpStore ( // FileInfo = ShellGetFileInfo (FileHandle); if (FileInfo == NULL) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"dmpstore", File); + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"dmpstore", File); Status = EFI_DEVICE_ERROR; } else { if ((FileInfo->Attribute & EFI_FILE_DIRECTORY) == EFI_FILE_DIRECTORY) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_IS_DIRECTORY), gShellDebug1HiiHandle, L"dmpstore", File); + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_IS_DIRECTORY), gShellDebug1HiiHandle, L"dmpstore", File); Status = EFI_INVALID_PARAMETER; } else { Status = ShellDeleteFile (&FileHandle); if (EFI_ERROR (Status)) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_DELETE_FAIL), gShellDebug1HiiHandle, L"dmpstore", File); + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_DELETE_FAIL), gShellDebug1HiiHandle, L"dmpstore", File); } } FreePool (FileInfo); @@ -795,13 +795,13 @@ ShellCommandRunDmpStore ( // // Otherwise it's bad. // - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"dmpstore", File); + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"dmpstore", File); } if (!EFI_ERROR (Status)) { Status = ShellOpenFileByName (File, &FileHandle, EFI_FILE_MODE_CREATE | EFI_FILE_MODE_WRITE | EFI_FILE_MODE_READ, 0); if (EFI_ERROR (Status)) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"dmpstore", File); + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"dmpstore", File); } } @@ -813,21 +813,21 @@ ShellCommandRunDmpStore ( Type = DmpStoreLoad; File = ShellCommandLineGetValue(Package, L"-l"); if (File == NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"dmpstore", L"-l"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"dmpstore", L"-l"); ShellStatus = SHELL_INVALID_PARAMETER; } else { Status = ShellOpenFileByName (File, &FileHandle, EFI_FILE_MODE_READ, 0); if (EFI_ERROR (Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"dmpstore", File); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"dmpstore", File); ShellStatus = SHELL_INVALID_PARAMETER; } else { FileInfo = ShellGetFileInfo (FileHandle); if (FileInfo == NULL) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"dmpstore", File); + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"dmpstore", File); ShellStatus = SHELL_DEVICE_ERROR; } else { if ((FileInfo->Attribute & EFI_FILE_DIRECTORY) == EFI_FILE_DIRECTORY) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_IS_DIRECTORY), gShellDebug1HiiHandle, L"dmpstore", File); + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_IS_DIRECTORY), gShellDebug1HiiHandle, L"dmpstore", File); ShellStatus = SHELL_INVALID_PARAMETER; } FreePool (FileInfo); diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/Edit.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/Edit.c index 986b7e7b88..6b8d4c17ff 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/Edit.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/Edit.c @@ -2,7 +2,7 @@ Main file for Edit shell Debug1 function. (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -59,7 +59,7 @@ ShellCommandRunEdit ( Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"edit", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"edit", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -67,7 +67,7 @@ ShellCommandRunEdit ( } } else { if (ShellCommandLineGetCount(Package) > 2) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"edit"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"edit"); ShellStatus = SHELL_INVALID_PARAMETER; } else { Cwd = gEfiShellProtocol->GetCurDir(NULL); @@ -86,7 +86,7 @@ ShellCommandRunEdit ( } gEfiShellProtocol->SetCurDir(NULL, Nfs); FreePool(Nfs); - } + } } } @@ -135,7 +135,7 @@ ShellCommandRunEdit ( // if (Status == EFI_SUCCESS) { } else if (Status == EFI_OUT_OF_RESOURCES) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_GEN_OUT_MEM), gShellDebug1HiiHandle, L"edit"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_GEN_OUT_MEM), gShellDebug1HiiHandle, L"edit"); } else { if (Buffer != NULL) { if (StrCmp (Buffer, L"") != 0) { diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c index 9713ccaf50..56ccd399b0 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c @@ -1,7 +1,7 @@ /** @file Implements filebuffer interface functions. - Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -53,7 +53,7 @@ EFI_EDITOR_FILE_BUFFER FileBufferConst = { // // the whole edit area needs to be refreshed // -BOOLEAN FileBufferNeedRefresh; +BOOLEAN FileBufferNeedRefresh; // // only the current line in edit area needs to be refresh @@ -144,7 +144,7 @@ FileBufferBackup ( /** Advance to the next Count lines - + @param[in] Count The line number to advance by. @param[in] CurrentLine The pointer to the current line structure. @param[in] LineList The pointer to the linked list of lines. @@ -183,7 +183,7 @@ InternalEditorMiscLineAdvance ( /** Retreat to the previous Count lines. - + @param[in] Count The line number to retreat by. @param[in] CurrentLine The pointer to the current line structure. @param[in] LineList The pointer to the linked list of lines. @@ -222,7 +222,7 @@ InternalEditorMiscLineRetreat ( /** Advance/Retreat lines - + @param[in] Count line number to advance/retreat >0 : advance <0 : retreat @@ -484,7 +484,7 @@ FileBufferPrintLine ( UINTN Limit; CHAR16 *PrintLine; CHAR16 *PrintLine2; - UINTN BufLen; + UINTN BufLen; // // print start from correct character @@ -710,7 +710,7 @@ FileBufferCreateLine ( Set FileName field in FileBuffer. @param Str The file name to set. - + @retval EFI_SUCCESS The filename was successfully set. @retval EFI_OUT_OF_RESOURCES A memory allocation failed. @retval EFI_INVALID_PARAMETER Str is not a valid filename. @@ -763,10 +763,10 @@ FileBufferFree ( /** Read a file from disk into the FileBuffer. - + @param[in] FileName The filename to read. @param[in] Recover TRUE if is for recover mode, no information printouts. - + @retval EFI_SUCCESS The load was successful. @retval EFI_LOAD_ERROR The load failed. @retval EFI_OUT_OF_RESOURCES A memory allocation failed. @@ -823,7 +823,7 @@ FileBufferRead ( } Info = ShellGetFileInfo(FileHandle); - + if (Info->Attribute & EFI_FILE_DIRECTORY) { StatusBarSetStatusString (L"Directory Can Not Be Edited"); FreePool (Info); @@ -1397,7 +1397,7 @@ UnicodeToAscii ( @param[in] FileName The file name for writing. @retval EFI_SUCCESS Data was written. - @retval EFI_LOAD_ERROR + @retval EFI_LOAD_ERROR @retval EFI_OUT_OF_RESOURCES There were not enough resources to write the file. **/ EFI_STATUS @@ -1472,7 +1472,7 @@ FileBufferSave ( FreePool(Info); return EFI_LOAD_ERROR; } - + if (Info != NULL) { Attribute = Info->Attribute & ~EFI_FILE_READ_ONLY; FreePool(Info); @@ -1550,7 +1550,7 @@ FileBufferSave ( Size = TotalSize - LeftSize; Status = ShellWriteFile (FileHandle, &Size, Cache); if (EFI_ERROR (Status)) { - ShellDeleteFile (&FileHandle); + ShellDeleteFile (&FileHandle); FreePool (Cache); return EFI_LOAD_ERROR; } @@ -1911,7 +1911,7 @@ FileBufferDoReturn ( } /** - Delete current character from current line. This is the effect caused + Delete current character from current line. This is the effect caused by the 'del' key. @retval EFI_SUCCESS @@ -2023,7 +2023,7 @@ FileBufferScrollRight ( /** Insert a char into line - + @param[in] Line The line to insert into. @param[in] Char The char to insert. @param[in] Pos The position to insert the char at ( start from 0 ). @@ -2395,7 +2395,7 @@ FileBufferEnd ( return EFI_SUCCESS; } -/** +/** Dispatch input to different handler @param[in] Key The input key. One of: ASCII KEY @@ -2610,7 +2610,7 @@ RightCurrentScreen ( /** Advance/Retreat lines and set CurrentLine in FileBuffer to it - + @param[in] Count The line number to advance/retreat >0 : advance <0: retreat @@ -2756,7 +2756,7 @@ FileBufferMovePosition ( /** Cut current line out and return a pointer to it. - @param[out] CutLine Upon a successful return pointer to the pointer to + @param[out] CutLine Upon a successful return pointer to the pointer to the allocated cut line. @retval EFI_SUCCESS The cut was successful. @@ -2930,7 +2930,7 @@ FileBufferSearch ( Column = 0; Position = 0; - + // // search if in current line // @@ -2949,7 +2949,7 @@ FileBufferSearch ( if (CharPos != NULL) { Position = CharPos - Current + 1; Found = TRUE; - } + } // // found @@ -2971,8 +2971,8 @@ FileBufferSearch ( if (CharPos != NULL) { Position = CharPos - Line->Buffer + 1; Found = TRUE; - } - + } + if (Found) { // // found diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.h index 6b46e4a173..8f5f4e65c7 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.h +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.h @@ -1,7 +1,7 @@ /** @file Declares filebuffer interface functions. - Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -50,7 +50,7 @@ FileBufferRefresh ( VOID ); -/** +/** Dispatch input to different handler @param[in] Key The input key. One of: ASCII KEY @@ -98,7 +98,7 @@ FileBufferRestorePosition ( Set FileName field in FileBuffer. @param Str The file name to set. - + @retval EFI_SUCCESS The filename was successfully set. @retval EFI_OUT_OF_RESOURCES A memory allocation failed. @retval EFI_INVALID_PARAMETER Str is not a valid filename. @@ -110,10 +110,10 @@ FileBufferSetFileName ( /** Read a file from disk into the FileBuffer. - + @param[in] FileName The filename to read. @param[in] Recover TRUE if is for recover mode, no information printouts. - + @retval EFI_SUCCESS The load was successful. @retval EFI_LOAD_ERROR The load failed. @retval EFI_OUT_OF_RESOURCES A memory allocation failed. @@ -131,7 +131,7 @@ FileBufferRead ( @param[in] FileName The file name for writing. @retval EFI_SUCCESS Data was written. - @retval EFI_LOAD_ERROR + @retval EFI_LOAD_ERROR @retval EFI_OUT_OF_RESOURCES There were not enough resources to write the file. **/ EFI_STATUS @@ -154,7 +154,7 @@ FileBufferMovePosition ( /** Cut current line out and return a pointer to it. - @param[out] CutLine Upon a successful return pointer to the pointer to + @param[out] CutLine Upon a successful return pointer to the pointer to the allocated cut line. @retval EFI_SUCCESS The cut was successful. diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c index 98e1331ac4..a3ba6c1d6f 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c @@ -77,7 +77,7 @@ MainCommandGotoLine ( /** Save current file to disk, you can save to current file name or save to another file name. - + @retval EFI_SUCCESS The file was saved correctly. @retval EFI_OUT_OF_RESOURCES A memory allocation failed. @retval EFI_LOAD_ERROR A file access error occured. @@ -1136,7 +1136,7 @@ MainCommandGotoLine ( /** Save current file to disk, you can save to current file name or save to another file name. - + @retval EFI_SUCCESS The file was saved correctly. @retval EFI_OUT_OF_RESOURCES A memory allocation failed. @retval EFI_LOAD_ERROR A file access error occured. @@ -1150,7 +1150,7 @@ MainCommandSaveFile ( CHAR16 *FileName; BOOLEAN OldFile; CHAR16 *Str; - SHELL_FILE_HANDLE FileHandle; + SHELL_FILE_HANDLE FileHandle; EFI_FILE_INFO *Info; // @@ -1280,15 +1280,15 @@ MainCommandSaveFile ( StatusBarSetStatusString (L"Open Failed"); FreePool (FileName); return EFI_SUCCESS; - } + } Info = ShellGetFileInfo(FileHandle); if (Info == NULL) { StatusBarSetStatusString (L"Access Denied"); FreePool (FileName); return (EFI_SUCCESS); - } - + } + if (Info->Attribute & EFI_FILE_READ_ONLY) { StatusBarSetStatusString (L"Access Denied - Read Only"); FreePool (Info); @@ -1365,13 +1365,13 @@ MainCommandDisplayHelp ( EFI_KEY_DATA KeyData; EFI_STATUS Status; UINTN EventIndex; - + // - // print helpInfo + // print helpInfo // for (CurrentLine = 0; 0 != MainMenuHelpInfo[CurrentLine]; CurrentLine++) { InfoString = HiiGetString(gShellDebug1HiiHandle, MainMenuHelpInfo[CurrentLine], NULL); - ShellPrintEx (0, CurrentLine+1, L"%E%s%N", InfoString); + ShellPrintEx (0, CurrentLine+1, L"%E%s%N", InfoString); } // @@ -1414,7 +1414,7 @@ MainCommandDisplayHelp ( FileBufferRestorePosition (); FileBufferNeedRefresh = TRUE; FileBufferOnlyLineNeedRefresh = FALSE; - FileBufferRefresh (); + FileBufferRefresh (); return EFI_SUCCESS; } @@ -1649,10 +1649,10 @@ MainEditorRefresh ( // // call the components refresh function // - if (EditorFirst - || StrCmp (FileBufferBackupVar.FileName, FileBuffer.FileName) != 0 - || FileBufferBackupVar.FileType != FileBuffer.FileType - || FileBufferBackupVar.FileModified != FileBuffer.FileModified + if (EditorFirst + || StrCmp (FileBufferBackupVar.FileName, FileBuffer.FileName) != 0 + || FileBufferBackupVar.FileType != FileBuffer.FileType + || FileBufferBackupVar.FileModified != FileBuffer.FileModified || FileBufferBackupVar.ReadOnly != FileBuffer.ReadOnly) { MainTitleBarRefresh (MainEditor.FileBuffer->FileName, MainEditor.FileBuffer->FileType, MainEditor.FileBuffer->ReadOnly, MainEditor.FileBuffer->FileModified, MainEditor.ScreenSize.Column, MainEditor.ScreenSize.Row, 0, 0); @@ -1660,8 +1660,8 @@ MainEditorRefresh ( } if (EditorFirst - || FileBufferBackupVar.FilePosition.Row != FileBuffer.FilePosition.Row - || FileBufferBackupVar.FilePosition.Column != FileBuffer.FilePosition.Column + || FileBufferBackupVar.FilePosition.Row != FileBuffer.FilePosition.Row + || FileBufferBackupVar.FilePosition.Column != FileBuffer.FilePosition.Column || FileBufferBackupVar.ModeInsert != FileBuffer.ModeInsert || StatusBarGetRefresh()) { @@ -1906,9 +1906,9 @@ MainEditorKeyInput ( Status = MenuBarDispatchFunctionKey (&KeyData.Key); } else { StatusBarSetStatusString (L"Unknown Command"); - FileBufferMouseNeedRefresh = FALSE; + FileBufferMouseNeedRefresh = FALSE; } - + if (Status != EFI_SUCCESS && Status != EFI_OUT_OF_RESOURCES) { // // not already has some error status @@ -1975,6 +1975,6 @@ MainEditorBackup ( ) { FileBufferBackup (); - + return EFI_SUCCESS; } diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/TextEditStrings.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/TextEditStrings.uni index f799148135..1406107392 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/TextEditStrings.uni +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/TextEditStrings.uni @@ -1,6 +1,6 @@ // /** // -// Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.
+// Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
// This program and the accompanying materials // are licensed and made available under the terms and conditions of the BSD License // which accompanies this distribution. The full text of the license may be found at @@ -20,7 +20,7 @@ #langdef en-US "english" -#string STR_EDIT_LIBEDITOR_TITLEBAR #language en-US "%EMainEditor init failed on TitleBar init\r\n%N" +#string STR_EDIT_LIBEDITOR_TITLEBAR #language en-US "%EMainEditor init failed on TitleBar init\r\n%N" #string STR_EDIT_LIBEDITOR_MAINMENU #language en-US "%EMainEditor init was not successful on MainMenu init\r\n%N" #string STR_EDIT_LIBEDITOR_STATUSBAR #language en-US "%EMainEditor init was not successful on StatusBar init\r\n%N" #string STR_EDIT_LIBEDITOR_INPUTBAR #language en-US "%EMainEditor init was not successful on InputBar init\r\n%N" @@ -28,33 +28,33 @@ #string STR_EDIT_LIBEDITOR_TITLEBAR_CLEANUP #language en-US "TitleBar cleanup was not successful\r\n" #string STR_EDIT_LIBEDITOR_MENUBAR_CLEANUP #language en-US "MenuBar cleanup was not successful\r\n" #string STR_EDIT_LIBEDITOR_STATUSBAR_CLEANUP #language en-US "StatusBar cleanup was not successful\r\n" -#string STR_EDIT_LIBEDITOR_INPUTBAR_CLEANUP #language en-US "InputBar cleanup was not successful\r\n" -#string STR_EDIT_LIBEDITOR_FILEBUFFER_CLEANUP #language en-US "FileBuffer cleanup was not successful\r\n" +#string STR_EDIT_LIBEDITOR_INPUTBAR_CLEANUP #language en-US "InputBar cleanup was not successful\r\n" +#string STR_EDIT_LIBEDITOR_FILEBUFFER_CLEANUP #language en-US "FileBuffer cleanup was not successful\r\n" #string STR_EDIT_LIBEDITOR_MAINEDITOR_INIT #language en-US "%EMainEditor init was not succesful on TitleBar init\r\n%N" #string STR_EDIT_LIBINPUTBAR_MAININPUTBAR #language en-US "%s" -#string STR_EDIT_LIBMENUBAR_OPEN_FILE #language en-US "Open File" -#string STR_EDIT_LIBMENUBAR_SAVE_FILE #language en-US "Save File" +#string STR_EDIT_LIBMENUBAR_OPEN_FILE #language en-US "Open File" +#string STR_EDIT_LIBMENUBAR_SAVE_FILE #language en-US "Save File" #string STR_EDIT_LIBMENUBAR_EXIT #language en-US "Exit" -#string STR_EDIT_LIBMENUBAR_CUT_LINE #language en-US "Cut Line" -#string STR_EDIT_LIBMENUBAR_PASTE_LINE #language en-US "Paste Line" -#string STR_EDIT_LIBMENUBAR_GO_TO_LINE #language en-US "Go To Line" -#string STR_EDIT_LIBMENUBAR_SEARCH #language en-US "Search" -#string STR_EDIT_LIBMENUBAR_SEARCH_REPLACE #language en-US "Search/Replace" -#string STR_EDIT_LIBMENUBAR_FILE_TYPE #language en-US "File Type" -#string STR_EDIT_LIBMENUBAR_F1 #language en-US "F1" -#string STR_EDIT_LIBMENUBAR_F2 #language en-US "F2" -#string STR_EDIT_LIBMENUBAR_F3 #language en-US "F3" -#string STR_EDIT_LIBMENUBAR_F4 #language en-US "F4" -#string STR_EDIT_LIBMENUBAR_F5 #language en-US "F5" -#string STR_EDIT_LIBMENUBAR_F6 #language en-US "F6" -#string STR_EDIT_LIBMENUBAR_F7 #language en-US "F7" -#string STR_EDIT_LIBMENUBAR_F8 #language en-US "F8" -#string STR_EDIT_LIBMENUBAR_F9 #language en-US "F9" -#string STR_EDIT_LIBMENUBAR_F10 #language en-US "F10" -#string STR_EDIT_LIBMENUBAR_F11 #language en-US "F11" -#string STR_EDIT_LIBMENUBAR_F12 #language en-US "F12" -#string STR_EDIT_LIBMENUBAR_CTRL_E #language en-US "Ctrl+E" -#string STR_EDIT_LIBMENUBAR_CTRL_W #language en-US "Ctrl+W" +#string STR_EDIT_LIBMENUBAR_CUT_LINE #language en-US "Cut Line" +#string STR_EDIT_LIBMENUBAR_PASTE_LINE #language en-US "Paste Line" +#string STR_EDIT_LIBMENUBAR_GO_TO_LINE #language en-US "Go To Line" +#string STR_EDIT_LIBMENUBAR_SEARCH #language en-US "Search" +#string STR_EDIT_LIBMENUBAR_SEARCH_REPLACE #language en-US "Search/Replace" +#string STR_EDIT_LIBMENUBAR_FILE_TYPE #language en-US "File Type" +#string STR_EDIT_LIBMENUBAR_F1 #language en-US "F1" +#string STR_EDIT_LIBMENUBAR_F2 #language en-US "F2" +#string STR_EDIT_LIBMENUBAR_F3 #language en-US "F3" +#string STR_EDIT_LIBMENUBAR_F4 #language en-US "F4" +#string STR_EDIT_LIBMENUBAR_F5 #language en-US "F5" +#string STR_EDIT_LIBMENUBAR_F6 #language en-US "F6" +#string STR_EDIT_LIBMENUBAR_F7 #language en-US "F7" +#string STR_EDIT_LIBMENUBAR_F8 #language en-US "F8" +#string STR_EDIT_LIBMENUBAR_F9 #language en-US "F9" +#string STR_EDIT_LIBMENUBAR_F10 #language en-US "F10" +#string STR_EDIT_LIBMENUBAR_F11 #language en-US "F11" +#string STR_EDIT_LIBMENUBAR_F12 #language en-US "F12" +#string STR_EDIT_LIBMENUBAR_CTRL_E #language en-US "Ctrl+E" +#string STR_EDIT_LIBMENUBAR_CTRL_W #language en-US "Ctrl+W" #string STR_EDIT_HELP_TITLE #language en-US "Help \n" #string STR_EDIT_HELP_BLANK #language en-US " \n" #string STR_EDIT_HELP_LIST_TITLE #language en-US "Control Key Function Key Command \n" @@ -69,7 +69,7 @@ #string STR_EDIT_HELP_OPEN_FILE #language en-US "Ctrl-O F8 Open File \n" #string STR_EDIT_HELP_FILE_TYPE #language en-US "Ctrl-T F9 File Type \n" #string STR_EDIT_HELP_EXIT_HELP #language en-US "Use Ctrl-W to exit this help \n" -#string STR_EDIT_MAIN_INVALID_FILE_NAME #language en-US "%Hedit%N: Invalid File Name\r\n" -#string STR_EDIT_MAIN_INIT_FAILED #language en-US "%Hedit%N: Initialization was not successful\r\n" -#string STR_EDIT_MAIN_BUFFER #language en-US "%Hedit%N: %s\r\n" -#string STR_EDIT_MAIN_UNKNOWN_EDITOR_ERR #language en-US "%Hedit%N: Unknown Editor Error\r\n" +#string STR_EDIT_MAIN_INVALID_FILE_NAME #language en-US "%Hedit%N: Invalid File Name\r\n" +#string STR_EDIT_MAIN_INIT_FAILED #language en-US "%Hedit%N: Initialization was not successful\r\n" +#string STR_EDIT_MAIN_BUFFER #language en-US "%Hedit%N: %s\r\n" +#string STR_EDIT_MAIN_UNKNOWN_EDITOR_ERR #language en-US "%Hedit%N: Unknown Editor Error\r\n" diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditInputBar.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditInputBar.c index 6c6fc70bab..2c8df9d4a6 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditInputBar.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditInputBar.c @@ -251,7 +251,7 @@ InputBarRefresh ( } mReturnString[Size] = CHAR_NULL; - + // // restore screen attributes diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.c index 58e90ac5b2..8490b263cb 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.c @@ -47,7 +47,7 @@ MenuBarInit ( CONST EDITOR_MENU_ITEM *ItemsWalker; for (NumItems = 0, ItemsWalker = Items ; ItemsWalker != NULL && ItemsWalker->Function != NULL ; ItemsWalker++,NumItems++); - + MenuItems = AllocateZeroPool((NumItems+1) * sizeof(EDITOR_MENU_ITEM)); if (MenuItems == NULL) { return EFI_OUT_OF_RESOURCES; @@ -69,7 +69,7 @@ ControlHotKeyInit ( ) { ControlBasedMenuFunctions = Items; - return EFI_SUCCESS; + return EFI_SUCCESS; } /** Refresh function for the menu bar. @@ -138,7 +138,7 @@ MenuBarRefresh ( @param[in] Key The pressed key. - @retval EFI_NOT_FOUND The key was not a valid function key + @retval EFI_NOT_FOUND The key was not a valid function key (an error was sent to the status bar). @return The return value from the called dispatch function. **/ @@ -167,7 +167,7 @@ MenuBarDispatchFunctionKey ( @param[in] KeyData The pressed key. - @retval EFI_NOT_FOUND The key was not a valid control-based key + @retval EFI_NOT_FOUND The key was not a valid control-based key (an error was sent to the status bar). @return EFI_SUCCESS. **/ diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.h index a15617edf6..e755499649 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.h +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.h @@ -93,7 +93,7 @@ MenuBarRefresh ( @param[in] Key The pressed key. - @retval EFI_NOT_FOUND The key was not a valid function key + @retval EFI_NOT_FOUND The key was not a valid function key (an error was sent to the status bar). @return The return value from the called dispatch function. **/ @@ -107,7 +107,7 @@ MenuBarDispatchFunctionKey ( @param[in] KeyData The pressed key. - @retval EFI_NOT_FOUND The key was not a valid control-based key + @retval EFI_NOT_FOUND The key was not a valid control-based key (an error was sent to the status bar). @return EFI_SUCCESS. **/ diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditStatusBar.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditStatusBar.c index e7792c17b0..f0110333b7 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditStatusBar.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditStatusBar.c @@ -1,7 +1,7 @@ /** @file Implements statusbar interface functions. - Copyright (c) 2005 - 2014, Intel Corporation. All rights reserved.
+ Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -71,7 +71,7 @@ typedef union { /** Cause the status bar to refresh it's printing on the screen. - @param[in] EditorFirst TRUE to indicate the first launch of the editor. + @param[in] EditorFirst TRUE to indicate the first launch of the editor. FALSE otherwise. @param[in] LastRow LastPrintable row. @param[in] LastCol Last printable column. diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditStatusBar.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditStatusBar.h index 61d19cc624..16b721d311 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditStatusBar.h +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditStatusBar.h @@ -1,7 +1,7 @@ /** @file Declares statusbar interface functions. - Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -38,7 +38,7 @@ StatusBarCleanup ( /** Cause the status bar to refresh it's printing on the screen. - @param[in] EditorFirst TRUE to indicate the first launch of the editor. + @param[in] EditorFirst TRUE to indicate the first launch of the editor. FALSE otherwise. @param[in] LastRow LastPrintable row. @param[in] LastCol Last printable column. diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/EfiCompress.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/EfiCompress.c index d94acf4e4b..33bdb03825 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/EfiCompress.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/EfiCompress.c @@ -2,7 +2,7 @@ Main file for EfiCompress shell Debug1 function. (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -70,7 +70,7 @@ ShellCommandRunEfiCompress ( Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"eficompress", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"eficompress", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -78,10 +78,10 @@ ShellCommandRunEfiCompress ( } } else { if (ShellCommandLineGetCount(Package) > 3) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"eficompress"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"eficompress"); ShellStatus = SHELL_INVALID_PARAMETER; } else if (ShellCommandLineGetCount(Package) < 3) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"eficompress"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"eficompress"); ShellStatus = SHELL_INVALID_PARAMETER; } else { TempParam = ShellCommandLineGetRawValue(Package, 1); @@ -89,26 +89,26 @@ ShellCommandRunEfiCompress ( InFileName = ShellFindFilePath(TempParam); OutFileName = ShellCommandLineGetRawValue(Package, 2); if (InFileName == NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_FIND_FAIL), gShellDebug1HiiHandle, L"eficompress", TempParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_FIND_FAIL), gShellDebug1HiiHandle, L"eficompress", TempParam); ShellStatus = SHELL_NOT_FOUND; } else { if (ShellIsDirectory(InFileName) == EFI_SUCCESS){ - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, L"eficompress", InFileName); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, L"eficompress", InFileName); ShellStatus = SHELL_INVALID_PARAMETER; } if (ShellIsDirectory(OutFileName) == EFI_SUCCESS){ - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, L"eficompress", OutFileName); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, L"eficompress", OutFileName); ShellStatus = SHELL_INVALID_PARAMETER; } if (ShellStatus == SHELL_SUCCESS) { Status = ShellOpenFileByName(InFileName, &InShellFileHandle, EFI_FILE_MODE_READ, 0); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"eficompress", ShellCommandLineGetRawValue(Package, 1)); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"eficompress", ShellCommandLineGetRawValue(Package, 1)); ShellStatus = SHELL_NOT_FOUND; } Status = ShellOpenFileByName(OutFileName, &OutShellFileHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE|EFI_FILE_MODE_CREATE, 0); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"eficompress", ShellCommandLineGetRawValue(Package, 2)); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"eficompress", ShellCommandLineGetRawValue(Package, 2)); ShellStatus = SHELL_NOT_FOUND; } } @@ -140,7 +140,7 @@ ShellCommandRunEfiCompress ( OutSize2 = (UINTN)OutSize; Status = gEfiShellProtocol->WriteFile(OutShellFileHandle, &OutSize2, OutBuffer); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_WRITE_FAIL), gShellDebug1HiiHandle, L"eficompress", OutFileName); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_WRITE_FAIL), gShellDebug1HiiHandle, L"eficompress", OutFileName); ShellStatus = SHELL_DEVICE_ERROR; } } diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/EfiDecompress.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/EfiDecompress.c index 28c37ee769..8e34d64c9d 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/EfiDecompress.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/EfiDecompress.c @@ -2,7 +2,7 @@ Main file for EfiDecompress shell Debug1 function. (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -77,7 +77,7 @@ ShellCommandRunEfiDecompress ( Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"efidecompress", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"efidecompress", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -85,10 +85,10 @@ ShellCommandRunEfiDecompress ( } } else { if (ShellCommandLineGetCount(Package) > 3) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"efidecompress"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"efidecompress"); ShellStatus = SHELL_INVALID_PARAMETER; } else if (ShellCommandLineGetCount(Package) < 3) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"efidecompress"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"efidecompress"); ShellStatus = SHELL_INVALID_PARAMETER; } else { TempParam = ShellCommandLineGetRawValue(Package, 1); @@ -96,21 +96,21 @@ ShellCommandRunEfiDecompress ( InFileName = ShellFindFilePath(TempParam); OutFileName = ShellCommandLineGetRawValue(Package, 2); if (InFileName == NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_FIND_FAIL), gShellDebug1HiiHandle, L"efidecompress", TempParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_FIND_FAIL), gShellDebug1HiiHandle, L"efidecompress", TempParam); ShellStatus = SHELL_NOT_FOUND; } else { if (ShellIsDirectory(InFileName) == EFI_SUCCESS){ - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, L"efidecompress", InFileName); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, L"efidecompress", InFileName); ShellStatus = SHELL_INVALID_PARAMETER; } if (ShellIsDirectory(OutFileName) == EFI_SUCCESS){ - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, L"efidecompress", OutFileName); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, L"efidecompress", OutFileName); ShellStatus = SHELL_INVALID_PARAMETER; } if (ShellStatus == SHELL_SUCCESS) { Status = ShellOpenFileByName(InFileName, &InFileHandle, EFI_FILE_MODE_READ, 0); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"efidecompress", ShellCommandLineGetRawValue(Package, 1)); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"efidecompress", ShellCommandLineGetRawValue(Package, 1)); ShellStatus = SHELL_NOT_FOUND; } } diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.c index 1048ecd415..9b0af6d924 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.c @@ -1,8 +1,8 @@ /** @file Defines HBufferImage - the view of the file that is visible at any point, as well as the event handlers for editing the file - - Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.
+ + Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -138,7 +138,7 @@ HBufferImageInit ( } /** - Backup function for HBufferImage. Only a few fields need to be backup. + Backup function for HBufferImage. Only a few fields need to be backup. This is for making the file buffer refresh as few as possible. @retval EFI_SUCCESS The operation was successful. @@ -190,7 +190,7 @@ HBufferImageBackup ( Lines CurrentLine NumLines - ListHead + ListHead @retval EFI_SUCCESS The operation was successful. **/ @@ -946,7 +946,7 @@ HBufferImageRead ( case FileTypeMemBuffer: Status = HMemImageRead (MemOffset, MemSize, Recover); break; - + default: Status = EFI_NOT_FOUND; break; @@ -1013,7 +1013,7 @@ HBufferImageSave ( case FileTypeMemBuffer: Status = HMemImageSave (MemOffset, MemSize); break; - + default: Status = EFI_NOT_FOUND; break; @@ -1030,7 +1030,7 @@ HBufferImageSave ( Create a new line and append it to the line list. Fields affected: NumLines - Lines + Lines @retval NULL create line failed. @return the line created. @@ -1368,7 +1368,7 @@ HBufferImageDoCharInput ( Check user specified FileRow is above current screen. @param[in] FileRow Row of file position ( start from 1 ). - + @retval TRUE It is above the current screen. @retval FALSE It is not above the current screen. @@ -1880,12 +1880,12 @@ HBufferImageGetTotalSize ( /** Delete character from buffer. - + @param[in] Pos Position, Pos starting from 0. @param[in] Count The Count of characters to delete. @param[out] DeleteBuffer The DeleteBuffer. - @retval EFI_SUCCESS Success + @retval EFI_SUCCESS Success **/ EFI_STATUS HBufferImageDeleteCharacterFromBuffer ( @@ -2014,7 +2014,7 @@ HBufferImageDeleteCharacterFromBuffer ( @param[in] Count Count of characters to add. @param[in] AddBuffer Add buffer. - @retval EFI_SUCCESS Success. + @retval EFI_SUCCESS Success. **/ EFI_STATUS HBufferImageAddCharacterToBuffer ( @@ -2166,7 +2166,7 @@ HBufferImageDoDelete ( /** Change the raw buffer to a list of lines for the UI. - + @param[in] Buffer The pointer to the buffer to fill. @param[in] Bytes The size of the buffer in bytes. @@ -2231,7 +2231,7 @@ HBufferImageBufferToList ( /** Change the list of lines from the UI to a raw buffer. - + @param[in] Buffer The pointer to the buffer to fill. @param[in] Bytes The size of the buffer in bytes. diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.h index 04deada289..2068a8fa06 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.h +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.h @@ -1,8 +1,8 @@ /** @file - Defines BufferImage - the view of the file that is visible at any point, + Defines BufferImage - the view of the file that is visible at any point, as well as the event handlers for editing the file - - Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.
+ + Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -72,7 +72,7 @@ HBufferImageHandleInput ( ); /** - Backup function for HBufferImage. Only a few fields need to be backup. + Backup function for HBufferImage. Only a few fields need to be backup. This is for making the file buffer refresh as few as possible. @retval EFI_SUCCESS The operation was successful. @@ -151,7 +151,7 @@ HBufferImageMovePosition ( Create a new line and append it to the line list. Fields affected: NumLines - Lines + Lines @retval NULL create line failed. @return the line created. @@ -174,12 +174,12 @@ HBufferImageFree ( /** Delete character from buffer. - + @param[in] Pos Position, Pos starting from 0. @param[in] Count The Count of characters to delete. @param[out] DeleteBuffer The DeleteBuffer. - @retval EFI_SUCCESS Success + @retval EFI_SUCCESS Success **/ EFI_STATUS HBufferImageDeleteCharacterFromBuffer ( @@ -195,7 +195,7 @@ HBufferImageDeleteCharacterFromBuffer ( @param[in] Count Count of characters to add. @param[in] AddBuffer Add buffer. - @retval EFI_SUCCESS Success. + @retval EFI_SUCCESS Success. **/ EFI_STATUS HBufferImageAddCharacterToBuffer ( @@ -206,7 +206,7 @@ HBufferImageAddCharacterToBuffer ( /** Change the raw buffer to a list of lines for the UI. - + @param[in] Buffer The pointer to the buffer to fill. @param[in] Bytes The size of the buffer in bytes. @@ -221,7 +221,7 @@ HBufferImageBufferToList ( /** Change the list of lines from the UI to a raw buffer. - + @param[in] Buffer The pointer to the buffer to fill. @param[in] Bytes The size of the buffer in bytes. diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Clipboard.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Clipboard.c index 4d5bfb391f..129fde13da 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Clipboard.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Clipboard.c @@ -1,7 +1,7 @@ /** @file Functions to deal with Clip Board - - Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.
+ + Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Clipboard.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Clipboard.h index 8066c29247..da5457c385 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Clipboard.h +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Clipboard.h @@ -1,8 +1,8 @@ /** @file - Defines DiskImage - the view of the file that is visible at any point, + Defines DiskImage - the view of the file that is visible at any point, as well as the event handlers for editing the file - - Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.
+ + Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/DiskImage.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/DiskImage.c index 8deb643f07..9a76e7a120 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/DiskImage.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/DiskImage.c @@ -39,7 +39,7 @@ HEFI_EDITOR_DISK_IMAGE HDiskImageConst = { /** Initialization function for HDiskImage. - + @retval EFI_SUCCESS The operation was successful. @retval EFI_LOAD_ERROR A load error occured. **/ @@ -59,7 +59,7 @@ HDiskImageInit ( } /** - Backup function for HDiskImage. Only a few fields need to be backup. + Backup function for HDiskImage. Only a few fields need to be backup. This is for making the Disk buffer refresh as few as possible. @retval EFI_SUCCESS The operation was successful. @@ -154,7 +154,7 @@ HDiskImageSetDiskNameOffsetSize ( @retval EFI_SUCCESS The operation was successful. @retval EFI_OUT_OF_RESOURCES A memory allocation failed. @retval EFI_LOAD_ERROR A load error occured. - @retval EFI_INVALID_PARAMETER A parameter was invalid. + @retval EFI_INVALID_PARAMETER A parameter was invalid. **/ EFI_STATUS HDiskImageRead ( @@ -326,7 +326,7 @@ HDiskImageRead ( @retval EFI_SUCCESS The operation was successful. @retval EFI_OUT_OF_RESOURCES A memory allocation failed. @retval EFI_LOAD_ERROR A load error occured. - @retval EFI_INVALID_PARAMETER A parameter was invalid. + @retval EFI_INVALID_PARAMETER A parameter was invalid. **/ EFI_STATUS HDiskImageSave ( diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/DiskImage.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/DiskImage.h index 06fb53020a..fbe0483769 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/DiskImage.h +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/DiskImage.h @@ -1,8 +1,8 @@ /** @file - Defines DiskImage - the view of the file that is visible at any point, + Defines DiskImage - the view of the file that is visible at any point, as well as the event handlers for editing the file - - Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.
+ + Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -20,7 +20,7 @@ /** Initialization function for HDiskImage. - + @retval EFI_SUCCESS The operation was successful. @retval EFI_LOAD_ERROR A load error occured. **/ @@ -40,7 +40,7 @@ HDiskImageCleanup ( ); /** - Backup function for HDiskImage. Only a few fields need to be backup. + Backup function for HDiskImage. Only a few fields need to be backup. This is for making the Disk buffer refresh as few as possible. @retval EFI_SUCCESS The operation was successful. @@ -62,7 +62,7 @@ HDiskImageBackup ( @retval EFI_SUCCESS The operation was successful. @retval EFI_OUT_OF_RESOURCES A memory allocation failed. @retval EFI_LOAD_ERROR A load error occured. - @retval EFI_INVALID_PARAMETER A parameter was invalid. + @retval EFI_INVALID_PARAMETER A parameter was invalid. **/ EFI_STATUS HDiskImageRead ( @@ -83,7 +83,7 @@ HDiskImageRead ( @retval EFI_SUCCESS The operation was successful. @retval EFI_OUT_OF_RESOURCES A memory allocation failed. @retval EFI_LOAD_ERROR A load error occured. - @retval EFI_INVALID_PARAMETER A parameter was invalid. + @retval EFI_INVALID_PARAMETER A parameter was invalid. **/ EFI_STATUS HDiskImageSave ( diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c index d9fd72cdd2..9f9e54c598 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c @@ -37,7 +37,7 @@ HEFI_EDITOR_BUFFER_IMAGE HFileImageConst = { /** Initialization function for HFileImage - + @retval EFI_SUCCESS The operation was successful. **/ EFI_STATUS @@ -60,7 +60,7 @@ HFileImageInit ( } /** - Backup function for HFileImage. Only a few fields need to be backup. + Backup function for HFileImage. Only a few fields need to be backup. This is for making the file buffer refresh as few as possible. @retval EFI_SUCCESS The operation was successful. diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.h index ed27ad03ae..5f5b2cfe77 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.h +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.h @@ -1,8 +1,8 @@ /** @file - Defines FileImage - the view of the file that is visible at any point, + Defines FileImage - the view of the file that is visible at any point, as well as the event handlers for editing the file - - Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.
+ + Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -20,7 +20,7 @@ /** Initialization function for HFileImage - + @retval EFI_SUCCESS The operation was successful. **/ EFI_STATUS @@ -39,7 +39,7 @@ HFileImageCleanup ( ); /** - Backup function for HFileImage. Only a few fields need to be backup. + Backup function for HFileImage. Only a few fields need to be backup. This is for making the file buffer refresh as few as possible. @retval EFI_SUCCESS The operation was successful. diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEdit.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEdit.c index 118aa7c3ed..199cc42c7f 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEdit.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEdit.c @@ -1,8 +1,8 @@ /** @file Main entry point of editor - + (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -74,7 +74,7 @@ ShellCommandRunHexEdit ( Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"hexedit", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"hexedit", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -86,10 +86,10 @@ ShellCommandRunHexEdit ( // if (ShellCommandLineGetFlag(Package, L"-d")){ if (ShellCommandLineGetCount(Package) < 4) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"hexedit"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"hexedit"); ShellStatus = SHELL_INVALID_PARAMETER; } else if (ShellCommandLineGetCount(Package) > 4) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"hexedit"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"hexedit"); ShellStatus = SHELL_INVALID_PARAMETER; } else { WhatToDo = FileTypeDiskBuffer; @@ -98,7 +98,7 @@ ShellCommandRunHexEdit ( Size = ShellStrToUintn(ShellCommandLineGetRawValue(Package, 3)); } if (Offset == (UINTN)-1 || Size == (UINTN)-1) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"hexedit", L"-d"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"hexedit", L"-d"); ShellStatus = SHELL_INVALID_PARAMETER; } } @@ -108,15 +108,15 @@ ShellCommandRunHexEdit ( // if (ShellCommandLineGetFlag(Package, L"-f") && (WhatToDo == FileTypeNone)){ if (ShellCommandLineGetCount(Package) < 2) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"hexedit"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"hexedit"); ShellStatus = SHELL_INVALID_PARAMETER; } else if (ShellCommandLineGetCount(Package) > 2) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"hexedit"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"hexedit"); ShellStatus = SHELL_INVALID_PARAMETER; } else { Name = ShellCommandLineGetRawValue(Package, 1); if (Name == NULL || !IsValidFileName(Name)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"hexedit", Name); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"hexedit", Name); ShellStatus = SHELL_INVALID_PARAMETER; } else { WhatToDo = FileTypeFileBuffer; @@ -129,10 +129,10 @@ ShellCommandRunHexEdit ( // if (ShellCommandLineGetFlag(Package, L"-m") && (WhatToDo == FileTypeNone)){ if (ShellCommandLineGetCount(Package) < 3) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"hexedit"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"hexedit"); ShellStatus = SHELL_INVALID_PARAMETER; } else if (ShellCommandLineGetCount(Package) > 3) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"hexedit"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"hexedit"); ShellStatus = SHELL_INVALID_PARAMETER; } else { WhatToDo = FileTypeMemBuffer; @@ -143,10 +143,10 @@ ShellCommandRunHexEdit ( Name = ShellCommandLineGetRawValue(Package, 1); if (WhatToDo == FileTypeNone && Name != NULL) { if (ShellCommandLineGetCount(Package) > 2) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"hexedit"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"hexedit"); ShellStatus = SHELL_INVALID_PARAMETER; } else if (!IsValidFileName(Name)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"hexedit", Name); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"hexedit", Name); ShellStatus = SHELL_INVALID_PARAMETER; } else { WhatToDo = FileTypeFileBuffer; @@ -154,7 +154,7 @@ ShellCommandRunHexEdit ( } else if (WhatToDo == FileTypeNone) { if (gEfiShellProtocol->GetCurDir(NULL) == NULL) { ShellStatus = SHELL_NOT_FOUND; - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_CWD), gShellDebug1HiiHandle, L"hexedit"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_CWD), gShellDebug1HiiHandle, L"hexedit"); } else { NewName = EditGetDefaultFileName(L"bin"); Name = NewName; @@ -163,10 +163,10 @@ ShellCommandRunHexEdit ( } if (ShellStatus == SHELL_SUCCESS && WhatToDo == FileTypeNone) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"hexedit"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"hexedit"); ShellStatus = SHELL_INVALID_PARAMETER; } else if (WhatToDo == FileTypeFileBuffer && ShellGetCurrentDir(NULL) == NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_CWD), gShellDebug1HiiHandle, L"hexedit"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_CWD), gShellDebug1HiiHandle, L"hexedit"); ShellStatus = SHELL_INVALID_PARAMETER; } @@ -252,7 +252,7 @@ ShellCommandRunHexEdit ( // print editor exit code on screen // if (Status == EFI_OUT_OF_RESOURCES) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellDebug1HiiHandle, L"hexedit"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellDebug1HiiHandle, L"hexedit"); } else if (EFI_ERROR(Status)){ if (Buffer != NULL) { if (StrCmp (Buffer, L"") != 0) { diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEditor.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEditor.h index d0a4bf4aae..e8d6bb5c75 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEditor.h +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEditor.h @@ -1,7 +1,7 @@ /** @file Main include file for hex editor - - Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.
+ + Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEditorTypes.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEditorTypes.h index 2a0429a4a1..b02cc9d262 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEditorTypes.h +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEditorTypes.h @@ -1,6 +1,6 @@ /** @file data types that are used by editor - + Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexeditStrings.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexeditStrings.uni index d9591ca13d..a87a19ff97 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexeditStrings.uni +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexeditStrings.uni @@ -1,6 +1,6 @@ // /** // -// Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.
+// Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
// (C) Copyright 2014 Hewlett-Packard Development Company, L.P.
// This program and the accompanying materials // are licensed and made available under the terms and conditions of the BSD License @@ -27,7 +27,7 @@ #string STR_HEXEDIT_DISKNAME #language en-US " %H-d DiskName FirstBlockNo. BlockNumber%N Open Disk Block For Editing\n" #string STR_HEXEDIT_OFFSET_SIZE #language en-US " %H-m Offset Size%N Open Memory Region For Editing\n" #string STR_HEXEDIT_FILE_NAME #language en-US "%Hhexedit%N: Invalid File Name\n" -#string STR_HEXEDIT_LIBEDITOR_MAINEDITOR_TITLE #language en-US "%EMainEditor init failed on TitleBar init\n%N" +#string STR_HEXEDIT_LIBEDITOR_MAINEDITOR_TITLE #language en-US "%EMainEditor init failed on TitleBar init\n%N" #string STR_HEXEDIT_LIBEDITOR_MAINEDITOR_MAINMENU #language en-US "%EMainEditor init failed on MainMenu init\n%N" #string STR_HEXEDIT_LIBEDITOR_MAINEDITOR_STATUS #language en-US "%EMainEditor init failed on StatusBar init\n%N" #string STR_HEXEDIT_LIBEDITOR_MAINEDITOR_INPUTBAR #language en-US "%EMainEditor init failed on InputBar init\n%N" diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.c index 1a89d3d72a..bf507d2822 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.c @@ -1,9 +1,9 @@ /** @file - Defines the Main Editor data type - - - Global variables + Defines the Main Editor data type - + - Global variables - Instances of the other objects of the editor - Main Interfaces - + Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -111,14 +111,14 @@ HMainCommandDisplayHelp ( EFI_KEY_DATA KeyData; EFI_STATUS Status; UINTN EventIndex; - + // - // print helpInfo + // print helpInfo // for (CurrentLine = 0; 0 != HexMainMenuHelpInfo[CurrentLine]; CurrentLine++) { InfoString = HiiGetString(gShellDebug1HiiHandle, HexMainMenuHelpInfo[CurrentLine] , NULL); - ShellPrintEx (0,CurrentLine+1,L"%E%s%N",InfoString); + ShellPrintEx (0,CurrentLine+1,L"%E%s%N",InfoString); } // @@ -245,7 +245,7 @@ HMainCommandGoToOffset ( /** Save current opened buffer. - If is file buffer, you can save to current file name or + If is file buffer, you can save to current file name or save to another file name. @retval EFI_SUCCESS The operation was successful. @@ -375,7 +375,7 @@ HMainCommandSaveBuffer ( // 7. Update File Name field in Title Bar to B // and remove the Modified flag in Title Bar. // - Str = CatSPrint(NULL, + Str = CatSPrint(NULL, L"File to Save: [%s]", HMainEditor.BufferImage->FileImage->FileName ); @@ -422,7 +422,7 @@ HMainCommandSaveBuffer ( // if just enter pressed, so think save to current file name // if (StrLen (InputBarGetString()) == 0) { - FileName = CatSPrint(NULL, + FileName = CatSPrint(NULL, L"%s", HMainEditor.BufferImage->FileImage->FileName ); @@ -476,7 +476,7 @@ HMainCommandSaveBuffer ( StatusBarSetStatusString (L"Access Denied"); SHELL_FREE_NON_NULL (FileName); return EFI_SUCCESS; - } + } SHELL_FREE_NON_NULL(Info); // @@ -520,7 +520,7 @@ HMainCommandSaveBuffer ( } // while } // if opened existing file } // if OldFile - + // // save file back to disk // @@ -1803,9 +1803,9 @@ HMainEditorCleanup ( MenuBarCleanup (); StatusBarCleanup (); - + InputBarCleanup (); - + Status = HBufferImageCleanup (); if (EFI_ERROR (Status)) { ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HEXEDIT_LIBEDITOR_BUFFERIMAGE_CLEAN), gShellDebug1HiiHandle); @@ -1850,28 +1850,28 @@ HMainEditorRefresh ( if (HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer) { if (HMainEditor.BufferImage->DiskImage != NULL && HBufferImageBackupVar.DiskImage != NULL && - (HMainEditor.BufferImage->DiskImage->Offset != HBufferImageBackupVar.DiskImage->Offset || + (HMainEditor.BufferImage->DiskImage->Offset != HBufferImageBackupVar.DiskImage->Offset || HMainEditor.BufferImage->DiskImage->Size != HBufferImageBackupVar.DiskImage->Size) ){ NameChange = TRUE; } } else if (HMainEditor.BufferImage->BufferType == FileTypeMemBuffer) { if (HMainEditor.BufferImage->MemImage != NULL && HBufferImageBackupVar.MemImage != NULL && - (HMainEditor.BufferImage->MemImage->Offset != HBufferImageBackupVar.MemImage->Offset || + (HMainEditor.BufferImage->MemImage->Offset != HBufferImageBackupVar.MemImage->Offset || HMainEditor.BufferImage->MemImage->Size != HBufferImageBackupVar.MemImage->Size) ){ NameChange = TRUE; } } else if (HMainEditor.BufferImage->BufferType == FileTypeFileBuffer) { - if ( HMainEditor.BufferImage->FileImage != NULL && - HMainEditor.BufferImage->FileImage->FileName != NULL && - HBufferImageBackupVar.FileImage != NULL && - HBufferImageBackupVar.FileImage->FileName != NULL && + if ( HMainEditor.BufferImage->FileImage != NULL && + HMainEditor.BufferImage->FileImage->FileName != NULL && + HBufferImageBackupVar.FileImage != NULL && + HBufferImageBackupVar.FileImage->FileName != NULL && StrCmp (HMainEditor.BufferImage->FileImage->FileName, HBufferImageBackupVar.FileImage->FileName) != 0 ) { NameChange = TRUE; } } - if ( HMainEditor.BufferImage->FileImage != NULL && - HBufferImageBackupVar.FileImage != NULL && + if ( HMainEditor.BufferImage->FileImage != NULL && + HBufferImageBackupVar.FileImage != NULL && HMainEditor.BufferImage->FileImage->ReadOnly != HBufferImageBackupVar.FileImage->ReadOnly ) { ReadChange = TRUE; } @@ -1885,10 +1885,10 @@ HMainEditorRefresh ( // // call the components refresh function // - if (HEditorFirst + if (HEditorFirst || NameChange - || HMainEditor.BufferImage->BufferType != HBufferImageBackupVar.BufferType - || HBufferImageBackupVar.Modified != HMainEditor.BufferImage->Modified + || HMainEditor.BufferImage->BufferType != HBufferImageBackupVar.BufferType + || HBufferImageBackupVar.Modified != HMainEditor.BufferImage->Modified || ReadChange ) { MainTitleBarRefresh ( @@ -1904,8 +1904,8 @@ HMainEditorRefresh ( HBufferImageRefresh (); } if (HEditorFirst - || HBufferImageBackupVar.DisplayPosition.Row != HMainEditor.BufferImage->DisplayPosition.Row - || HBufferImageBackupVar.DisplayPosition.Column != HMainEditor.BufferImage->DisplayPosition.Column + || HBufferImageBackupVar.DisplayPosition.Row != HMainEditor.BufferImage->DisplayPosition.Row + || HBufferImageBackupVar.DisplayPosition.Column != HMainEditor.BufferImage->DisplayPosition.Column || StatusBarGetRefresh()) { StatusBarRefresh ( @@ -2334,7 +2334,7 @@ HMainEditorKeyInput ( case FileTypeMemBuffer: OldSize = HBufferImage.MemImage->Size; break; - + default: OldSize = 0; break; diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.h index 0c2ffe9053..8d9c007d94 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.h +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.h @@ -1,10 +1,10 @@ /** @file - Defines the Main Editor data type - - - Global variables + Defines the Main Editor data type - + - Global variables - Instances of the other objects of the editor - Main Interfaces - - Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.
+ + Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MemImage.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MemImage.c index 12f1492583..4fdd9ab95c 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MemImage.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MemImage.c @@ -1,7 +1,7 @@ /** @file Functions to deal with Mem buffer - - Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.
+ + Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -67,7 +67,7 @@ HMemImageInit ( } /** - Backup function for HDiskImage. Only a few fields need to be backup. + Backup function for HDiskImage. Only a few fields need to be backup. This is for making the Disk buffer refresh as few as possible. @retval EFI_SUCCESS The operation was successful. diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MemImage.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MemImage.h index 54fe517858..41ff773d46 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MemImage.h +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MemImage.h @@ -1,8 +1,8 @@ /** @file - Defines MemImage - the view of the file that is visible at any point, + Defines MemImage - the view of the file that is visible at any point, as well as the event handlers for editing the file - - Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.
+ + Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -30,7 +30,7 @@ HMemImageInit ( ); /** - Backup function for HDiskImage. Only a few fields need to be backup. + Backup function for HDiskImage. Only a few fields need to be backup. This is for making the Disk buffer refresh as few as possible. @retval EFI_SUCCESS The operation was successful. diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Misc.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Misc.c index c3ed341936..cf768c3181 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Misc.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Misc.c @@ -1,7 +1,7 @@ /** @file Implementation of various string and line routines - - Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.
+ + Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -18,7 +18,7 @@ extern BOOLEAN HEditorMouseAction; /** Free a line and it's internal buffer. - + @param[in] Src The line to be freed. **/ VOID @@ -109,7 +109,7 @@ HLineRetreat ( @param[in] Count The line number to advance/retreat. >0 : advance - <0: retreat + <0: retreat @retval NULL An error occured. @return A pointer to the line after move. @@ -182,7 +182,7 @@ HMoveCurrentLine ( Lines CurrentLine NumLines - ListHead + ListHead @param[in] ListHead The list head. @param[in] Lines The lines. diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Misc.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Misc.h index df947935b0..f95de3d95f 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Misc.h +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Misc.h @@ -1,7 +1,7 @@ /** @file Definitions for various line and string routines - Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -22,7 +22,7 @@ @param[in] Count The line number to advance/retreat. >0 : advance - <0: retreat + <0: retreat @retval NULL An error occured. @return A pointer to the line after move. @@ -53,7 +53,7 @@ HMoveCurrentLine ( Lines CurrentLine NumLines - ListHead + ListHead @param[in] ListHead The list head. @param[in] Lines The lines. diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/LoadPciRom.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/LoadPciRom.c index 7be658dc87..6cd52e09c8 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/LoadPciRom.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/LoadPciRom.c @@ -2,7 +2,7 @@ Main file for LoadPciRom shell Debug1 function. (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -93,7 +93,7 @@ ShellCommandRunLoadPciRom ( Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"loadpcirom", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"loadpcirom", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -101,7 +101,7 @@ ShellCommandRunLoadPciRom ( } } else { if (ShellCommandLineGetCount(Package) < 2) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"loadpcirom"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"loadpcirom"); ShellStatus = SHELL_INVALID_PARAMETER; } else { if (ShellCommandLineGetFlag(Package, L"-nc")) { @@ -120,7 +120,7 @@ ShellCommandRunLoadPciRom ( ){ Status = ShellOpenFileMetaArg((CHAR16*)Param, EFI_FILE_MODE_WRITE|EFI_FILE_MODE_READ, &FileList); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"loadpcirom", Param); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"loadpcirom", Param); ShellStatus = SHELL_ACCESS_DENIED; break; } @@ -134,12 +134,12 @@ ShellCommandRunLoadPciRom ( ; Node = (EFI_SHELL_FILE_INFO*)GetNextNode(&FileList->Link, &Node->Link) ){ if (EFI_ERROR(Node->Status)){ - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"loadpcirom", Node->FullName); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"loadpcirom", Node->FullName); ShellStatus = SHELL_INVALID_PARAMETER; continue; } if (FileHandleIsDirectory(Node->Handle) == EFI_SUCCESS) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, L"loadpcirom", Node->FullName); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, L"loadpcirom", Node->FullName); ShellStatus = SHELL_INVALID_PARAMETER; continue; } @@ -152,7 +152,7 @@ ShellCommandRunLoadPciRom ( } Status = gEfiShellProtocol->ReadFile(Node->Handle, &SourceSize, File1Buffer); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_READ_FAIL), gShellDebug1HiiHandle, L"loadpcirom", Node->FullName); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_READ_FAIL), gShellDebug1HiiHandle, L"loadpcirom", Node->FullName); ShellStatus = SHELL_INVALID_PARAMETER; } else { Status = LoadEfiDriversFromRomImage ( @@ -166,7 +166,7 @@ ShellCommandRunLoadPciRom ( FreePool(File1Buffer); } } else if (ShellStatus == SHELL_SUCCESS) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_SPEC), gShellDebug1HiiHandle, "loadpcirom"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_SPEC), gShellDebug1HiiHandle, "loadpcirom"); ShellStatus = SHELL_NOT_FOUND; } if (FileList != NULL && !IsListEmpty(&FileList->Link)) { @@ -234,14 +234,14 @@ LoadEfiDriversFromRomImage ( EfiRomHeader = (EFI_PCI_EXPANSION_ROM_HEADER *) (UINTN) RomBarOffset; if (EfiRomHeader->Signature != PCI_EXPANSION_ROM_HEADER_SIGNATURE) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_LOADPCIROM_CORRUPT), gShellDebug1HiiHandle, L"loadpcirom", FileName, ImageIndex); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_LOADPCIROM_CORRUPT), gShellDebug1HiiHandle, L"loadpcirom", FileName, ImageIndex); // PrintToken (STRING_TOKEN (STR_LOADPCIROM_IMAGE_CORRUPT), HiiHandle, ImageIndex); return ReturnStatus; } // - // If the pointer to the PCI Data Structure is invalid, no further images can be located. - // The PCI Data Structure must be DWORD aligned. + // If the pointer to the PCI Data Structure is invalid, no further images can be located. + // The PCI Data Structure must be DWORD aligned. // if (EfiRomHeader->PcirOffset == 0 || (EfiRomHeader->PcirOffset & 3) != 0 || @@ -340,12 +340,12 @@ LoadEfiDriversFromRomImage ( &ImageHandle ); if (EFI_ERROR (Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_LOADPCIROM_LOAD_FAIL), gShellDebug1HiiHandle, L"loadpcirom", FileName, ImageIndex); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_LOADPCIROM_LOAD_FAIL), gShellDebug1HiiHandle, L"loadpcirom", FileName, ImageIndex); // PrintToken (STRING_TOKEN (STR_LOADPCIROM_LOAD_IMAGE_ERROR), HiiHandle, ImageIndex, Status); } else { Status = gBS->StartImage (ImageHandle, NULL, NULL); if (EFI_ERROR (Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_LOADPCIROM_START_FAIL), gShellDebug1HiiHandle, L"loadpcirom", FileName, ImageIndex); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_LOADPCIROM_START_FAIL), gShellDebug1HiiHandle, L"loadpcirom", FileName, ImageIndex); // PrintToken (STRING_TOKEN (STR_LOADPCIROM_START_IMAGE), HiiHandle, ImageIndex, Status); } else { ReturnStatus = Status; diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/MemMap.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/MemMap.c index c856661917..7389e14edf 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/MemMap.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/MemMap.c @@ -3,7 +3,7 @@ (C) Copyright 2016 Hewlett Packard Enterprise Development LP
(C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which acModeanies this distribution. The full text of the license may be found at @@ -200,7 +200,7 @@ ShellCommandRunMemMap ( Status = ShellCommandLineParse (SfoParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"memmap", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"memmap", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -208,7 +208,7 @@ ShellCommandRunMemMap ( } } else { if (ShellCommandLineGetCount(Package) > 1) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"memmap"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"memmap"); ShellStatus = SHELL_INVALID_PARAMETER; } else { Status = gBS->GetMemoryMap(&Size, Descriptors, &MapKey, &ItemSize, &Version); @@ -218,7 +218,7 @@ ShellCommandRunMemMap ( Status = gBS->GetMemoryMap(&Size, Descriptors, &MapKey, &ItemSize, &Version); } if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MEMMAP_GET_FAILED), gShellDebug1HiiHandle, L"memmap"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MEMMAP_GET_FAILED), gShellDebug1HiiHandle, L"memmap"); ShellStatus = SHELL_ACCESS_DENIED; } else { ASSERT(Version == EFI_MEMORY_DESCRIPTOR_VERSION); diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Mode.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Mode.c index 7696e3fbbd..c0e0d710ba 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Mode.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Mode.c @@ -2,7 +2,7 @@ Main file for Mode shell Debug1 function. (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which acModeanies this distribution. The full text of the license may be found at @@ -58,7 +58,7 @@ ShellCommandRunMode ( Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"mode", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"mode", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -66,21 +66,21 @@ ShellCommandRunMode ( } } else { if (ShellCommandLineGetCount(Package) > 3) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"mode"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"mode"); ShellStatus = SHELL_INVALID_PARAMETER; } else if (ShellCommandLineGetCount(Package) == 2) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"mode"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"mode"); ShellStatus = SHELL_INVALID_PARAMETER; } else if (ShellCommandLineGetCount(Package) == 3) { Temp = ShellCommandLineGetRawValue(Package, 1); if (!ShellIsHexOrDecimalNumber(Temp, FALSE, FALSE)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"mode", Temp); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"mode", Temp); ShellStatus = SHELL_INVALID_PARAMETER; } NewCol = ShellStrToUintn(Temp); Temp = ShellCommandLineGetRawValue(Package, 2); if (!ShellIsHexOrDecimalNumber(Temp, FALSE, FALSE)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"mode", Temp); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"mode", Temp); ShellStatus = SHELL_INVALID_PARAMETER; } NewRow = ShellStrToUintn(Temp); @@ -93,7 +93,7 @@ ShellCommandRunMode ( if (Col == NewCol && Row == NewRow) { Status = gST->ConOut->SetMode(gST->ConOut, LoopVar); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MODE_SET_FAIL), gShellDebug1HiiHandle, L"mode"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MODE_SET_FAIL), gShellDebug1HiiHandle, L"mode"); ShellStatus = SHELL_DEVICE_ERROR; } else { // worked fine... @@ -104,7 +104,7 @@ ShellCommandRunMode ( } if (!Done) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MODE_NO_MATCH), gShellDebug1HiiHandle, L"mode"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MODE_NO_MATCH), gShellDebug1HiiHandle, L"mode"); ShellStatus = SHELL_INVALID_PARAMETER; } diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c index 38559571c2..b6c6e6509c 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c @@ -1,9 +1,9 @@ /** @file Main file for Pci shell Debug1 function. - Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.
+ Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
(C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
- (C) Copyright 2016 Hewlett Packard Enterprise Development LP
+ (C) Copyright 2016 Hewlett Packard Enterprise Development LP
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -2487,7 +2487,7 @@ ShellCommandRunPci ( Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"pci", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"pci", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -2496,23 +2496,23 @@ ShellCommandRunPci ( } else { if (ShellCommandLineGetCount(Package) == 2) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"pci"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"pci"); ShellStatus = SHELL_INVALID_PARAMETER; goto Done; } if (ShellCommandLineGetCount(Package) > 4) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"pci"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"pci"); ShellStatus = SHELL_INVALID_PARAMETER; goto Done; } if (ShellCommandLineGetFlag(Package, L"-ec") && ShellCommandLineGetValue(Package, L"-ec") == NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"pci", L"-ec"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"pci", L"-ec"); ShellStatus = SHELL_INVALID_PARAMETER; goto Done; } if (ShellCommandLineGetFlag(Package, L"-s") && ShellCommandLineGetValue(Package, L"-s") == NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"pci", L"-s"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"pci", L"-s"); ShellStatus = SHELL_INVALID_PARAMETER; goto Done; } @@ -2524,7 +2524,7 @@ ShellCommandRunPci ( HandleBufSize = sizeof (EFI_HANDLE); HandleBuf = (EFI_HANDLE *) AllocateZeroPool (HandleBufSize); if (HandleBuf == NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellDebug1HiiHandle, L"pci"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellDebug1HiiHandle, L"pci"); ShellStatus = SHELL_OUT_OF_RESOURCES; goto Done; } @@ -2540,7 +2540,7 @@ ShellCommandRunPci ( if (Status == EFI_BUFFER_TOO_SMALL) { HandleBuf = ReallocatePool (sizeof (EFI_HANDLE), HandleBufSize, HandleBuf); if (HandleBuf == NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellDebug1HiiHandle, L"pci"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellDebug1HiiHandle, L"pci"); ShellStatus = SHELL_OUT_OF_RESOURCES; goto Done; } @@ -2555,7 +2555,7 @@ ShellCommandRunPci ( } if (EFI_ERROR (Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PCIRBIO_NF), gShellDebug1HiiHandle, L"pci"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PCIRBIO_NF), gShellDebug1HiiHandle, L"pci"); ShellStatus = SHELL_NOT_FOUND; goto Done; } @@ -2591,7 +2591,7 @@ ShellCommandRunPci ( &Descriptors ); if (EFI_ERROR (Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_PCI_HANDLE_CFG_ERR), gShellDebug1HiiHandle, L"pci"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_PCI_HANDLE_CFG_ERR), gShellDebug1HiiHandle, L"pci"); ShellStatus = SHELL_NOT_FOUND; goto Done; } @@ -2604,7 +2604,7 @@ ShellCommandRunPci ( Status = PciGetNextBusRange (&Descriptors, &MinBus, &MaxBus, &IsEnd); if (EFI_ERROR (Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_PCI_BUS_RANGE_ERR), gShellDebug1HiiHandle, L"pci"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_PCI_BUS_RANGE_ERR), gShellDebug1HiiHandle, L"pci"); ShellStatus = SHELL_NOT_FOUND; goto Done; } @@ -2729,7 +2729,7 @@ ShellCommandRunPci ( if (!EFI_ERROR (ShellConvertStringToUint64 (Temp, &RetVal, TRUE, TRUE))) { Segment = (UINT16) RetVal; } else { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV_HEX), gShellDebug1HiiHandle, L"pci", Temp); + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV_HEX), gShellDebug1HiiHandle, L"pci", Temp); ShellStatus = SHELL_INVALID_PARAMETER; goto Done; } @@ -2747,13 +2747,13 @@ ShellCommandRunPci ( if (!EFI_ERROR (ShellConvertStringToUint64 (Temp, &RetVal, TRUE, TRUE))) { Bus = (UINT16) RetVal; } else { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV_HEX), gShellDebug1HiiHandle, L"pci", Temp); + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV_HEX), gShellDebug1HiiHandle, L"pci", Temp); ShellStatus = SHELL_INVALID_PARAMETER; goto Done; } if (Bus > PCI_MAX_BUS) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"pci", Temp); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"pci", Temp); ShellStatus = SHELL_INVALID_PARAMETER; goto Done; } @@ -2766,13 +2766,13 @@ ShellCommandRunPci ( if (!EFI_ERROR (ShellConvertStringToUint64 (Temp, &RetVal, TRUE, TRUE))) { Device = (UINT16) RetVal; } else { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV_HEX), gShellDebug1HiiHandle, L"pci", Temp); + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV_HEX), gShellDebug1HiiHandle, L"pci", Temp); ShellStatus = SHELL_INVALID_PARAMETER; goto Done; } if (Device > PCI_MAX_DEVICE){ - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"pci", Temp); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"pci", Temp); ShellStatus = SHELL_INVALID_PARAMETER; goto Done; } @@ -2786,13 +2786,13 @@ ShellCommandRunPci ( if (!EFI_ERROR (ShellConvertStringToUint64 (Temp, &RetVal, TRUE, TRUE))) { Func = (UINT16) RetVal; } else { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV_HEX), gShellDebug1HiiHandle, L"pci", Temp); + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV_HEX), gShellDebug1HiiHandle, L"pci", Temp); ShellStatus = SHELL_INVALID_PARAMETER; goto Done; } if (Func > PCI_MAX_FUNC){ - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"pci", Temp); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"pci", Temp); ShellStatus = SHELL_INVALID_PARAMETER; goto Done; } @@ -2806,7 +2806,7 @@ ShellCommandRunPci ( if (!EFI_ERROR (ShellConvertStringToUint64 (Temp, &RetVal, TRUE, TRUE))) { ExtendedCapability = (UINT16) RetVal; } else { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV_HEX), gShellDebug1HiiHandle, L"pci", Temp); + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV_HEX), gShellDebug1HiiHandle, L"pci", Temp); ShellStatus = SHELL_INVALID_PARAMETER; goto Done; } @@ -2826,7 +2826,7 @@ ShellCommandRunPci ( if (EFI_ERROR (Status)) { ShellPrintHiiEx( - -1, -1, NULL, STRING_TOKEN (STR_PCI_NO_FIND), gShellDebug1HiiHandle, L"pci", + -1, -1, NULL, STRING_TOKEN (STR_PCI_NO_FIND), gShellDebug1HiiHandle, L"pci", Segment, Bus ); @@ -2844,7 +2844,7 @@ ShellCommandRunPci ( ); if (EFI_ERROR (Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_PCI_NO_CFG), gShellDebug1HiiHandle, L"pci"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_PCI_NO_CFG), gShellDebug1HiiHandle, L"pci"); ShellStatus = SHELL_ACCESS_DENIED; goto Done; } @@ -4999,13 +4999,13 @@ PrintInterpretedExtendedCompatibilityLinkControl ( Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_INTERNAL_LINK_CONTROL*)HeaderAddress; ShellPrintHiiEx( - -1, -1, NULL, - STRING_TOKEN (STR_PCI_EXT_CAP_LINK_CONTROL), - gShellDebug1HiiHandle, + -1, -1, NULL, + STRING_TOKEN (STR_PCI_EXT_CAP_LINK_CONTROL), + gShellDebug1HiiHandle, Header->RootComplexLinkCapabilities, Header->RootComplexLinkControl, Header->RootComplexLinkStatus - ); + ); DumpHex ( 4, EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress), @@ -5031,13 +5031,13 @@ PrintInterpretedExtendedCompatibilityPowerBudgeting ( Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_POWER_BUDGETING*)HeaderAddress; ShellPrintHiiEx( - -1, -1, NULL, - STRING_TOKEN (STR_PCI_EXT_CAP_POWER), - gShellDebug1HiiHandle, + -1, -1, NULL, + STRING_TOKEN (STR_PCI_EXT_CAP_POWER), + gShellDebug1HiiHandle, Header->DataSelect, Header->Data, Header->PowerBudgetCapability - ); + ); DumpHex ( 4, EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress), @@ -5067,12 +5067,12 @@ PrintInterpretedExtendedCompatibilityAcs ( VectorSize = 0; ShellPrintHiiEx( - -1, -1, NULL, - STRING_TOKEN (STR_PCI_EXT_CAP_ACS), - gShellDebug1HiiHandle, + -1, -1, NULL, + STRING_TOKEN (STR_PCI_EXT_CAP_ACS), + gShellDebug1HiiHandle, Header->AcsCapability, Header->AcsControl - ); + ); if (PCI_EXPRESS_EXTENDED_CAPABILITY_ACS_EXTENDED_GET_EGRES_CONTROL(Header)) { VectorSize = PCI_EXPRESS_EXTENDED_CAPABILITY_ACS_EXTENDED_GET_EGRES_VECTOR_SIZE(Header); if (VectorSize == 0) { @@ -5080,12 +5080,12 @@ PrintInterpretedExtendedCompatibilityAcs ( } for (LoopCounter = 0 ; LoopCounter * 8 < VectorSize ; LoopCounter++) { ShellPrintHiiEx( - -1, -1, NULL, - STRING_TOKEN (STR_PCI_EXT_CAP_ACS2), - gShellDebug1HiiHandle, + -1, -1, NULL, + STRING_TOKEN (STR_PCI_EXT_CAP_ACS2), + gShellDebug1HiiHandle, LoopCounter + 1, Header->EgressControlVectorArray[LoopCounter] - ); + ); } } DumpHex ( @@ -5113,12 +5113,12 @@ PrintInterpretedExtendedCompatibilityLatencyToleranceReporting ( Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_LATENCE_TOLERANCE_REPORTING*)HeaderAddress; ShellPrintHiiEx( - -1, -1, NULL, - STRING_TOKEN (STR_PCI_EXT_CAP_LAT), - gShellDebug1HiiHandle, + -1, -1, NULL, + STRING_TOKEN (STR_PCI_EXT_CAP_LAT), + gShellDebug1HiiHandle, Header->MaxSnoopLatency, Header->MaxNoSnoopLatency - ); + ); DumpHex ( 4, EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress), @@ -5144,11 +5144,11 @@ PrintInterpretedExtendedCompatibilitySerialNumber ( Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_SERIAL_NUMBER*)HeaderAddress; ShellPrintHiiEx( - -1, -1, NULL, - STRING_TOKEN (STR_PCI_EXT_CAP_SN), - gShellDebug1HiiHandle, + -1, -1, NULL, + STRING_TOKEN (STR_PCI_EXT_CAP_SN), + gShellDebug1HiiHandle, Header->SerialNumber - ); + ); DumpHex ( 4, EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress), @@ -5174,14 +5174,14 @@ PrintInterpretedExtendedCompatibilityRcrb ( Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_RCRB_HEADER*)HeaderAddress; ShellPrintHiiEx( - -1, -1, NULL, - STRING_TOKEN (STR_PCI_EXT_CAP_RCRB), - gShellDebug1HiiHandle, + -1, -1, NULL, + STRING_TOKEN (STR_PCI_EXT_CAP_RCRB), + gShellDebug1HiiHandle, Header->VendorId, Header->DeviceId, Header->RcrbCapabilities, Header->RcrbControl - ); + ); DumpHex ( 4, EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress), @@ -5207,11 +5207,11 @@ PrintInterpretedExtendedCompatibilityVendorSpecific ( Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_VENDOR_SPECIFIC*)HeaderAddress; ShellPrintHiiEx( - -1, -1, NULL, - STRING_TOKEN (STR_PCI_EXT_CAP_VEN), - gShellDebug1HiiHandle, + -1, -1, NULL, + STRING_TOKEN (STR_PCI_EXT_CAP_VEN), + gShellDebug1HiiHandle, Header->VendorSpecificHeader - ); + ); DumpHex ( 4, EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress), @@ -5237,11 +5237,11 @@ PrintInterpretedExtendedCompatibilityECEA ( Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_EVENT_COLLECTOR_ENDPOINT_ASSOCIATION*)HeaderAddress; ShellPrintHiiEx( - -1, -1, NULL, - STRING_TOKEN (STR_PCI_EXT_CAP_ECEA), - gShellDebug1HiiHandle, + -1, -1, NULL, + STRING_TOKEN (STR_PCI_EXT_CAP_ECEA), + gShellDebug1HiiHandle, Header->AssociationBitmap - ); + ); DumpHex ( 4, EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress), @@ -5267,12 +5267,12 @@ PrintInterpretedExtendedCompatibilityAri ( Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_ARI_CAPABILITY*)HeaderAddress; ShellPrintHiiEx( - -1, -1, NULL, - STRING_TOKEN (STR_PCI_EXT_CAP_ARI), - gShellDebug1HiiHandle, + -1, -1, NULL, + STRING_TOKEN (STR_PCI_EXT_CAP_ARI), + gShellDebug1HiiHandle, Header->AriCapability, Header->AriControl - ); + ); DumpHex ( 4, EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress), @@ -5299,19 +5299,19 @@ PrintInterpretedExtendedCompatibilityDynamicPowerAllocation ( Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_DYNAMIC_POWER_ALLOCATION*)HeaderAddress; ShellPrintHiiEx( - -1, -1, NULL, - STRING_TOKEN (STR_PCI_EXT_CAP_DPA), - gShellDebug1HiiHandle, + -1, -1, NULL, + STRING_TOKEN (STR_PCI_EXT_CAP_DPA), + gShellDebug1HiiHandle, Header->DpaCapability, Header->DpaLatencyIndicator, Header->DpaStatus, Header->DpaControl - ); + ); for (LinkCount = 0 ; LinkCount < PCI_EXPRESS_EXTENDED_CAPABILITY_DYNAMIC_POWER_ALLOCATION_GET_SUBSTATE_MAX(Header) + 1 ; LinkCount++) { ShellPrintHiiEx( - -1, -1, NULL, - STRING_TOKEN (STR_PCI_EXT_CAP_DPA2), - gShellDebug1HiiHandle, + -1, -1, NULL, + STRING_TOKEN (STR_PCI_EXT_CAP_DPA2), + gShellDebug1HiiHandle, LinkCount+1, Header->DpaPowerAllocationArray[LinkCount] ); @@ -5342,17 +5342,17 @@ PrintInterpretedExtendedCompatibilityLinkDeclaration ( Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_LINK_DECLARATION*)HeaderAddress; ShellPrintHiiEx( - -1, -1, NULL, - STRING_TOKEN (STR_PCI_EXT_CAP_LINK_DECLAR), - gShellDebug1HiiHandle, + -1, -1, NULL, + STRING_TOKEN (STR_PCI_EXT_CAP_LINK_DECLAR), + gShellDebug1HiiHandle, Header->ElementSelfDescription ); for (LinkCount = 0 ; LinkCount < PCI_EXPRESS_EXTENDED_CAPABILITY_LINK_DECLARATION_GET_LINK_COUNT(Header) ; LinkCount++) { ShellPrintHiiEx( - -1, -1, NULL, - STRING_TOKEN (STR_PCI_EXT_CAP_LINK_DECLAR2), - gShellDebug1HiiHandle, + -1, -1, NULL, + STRING_TOKEN (STR_PCI_EXT_CAP_LINK_DECLAR2), + gShellDebug1HiiHandle, LinkCount+1, Header->LinkEntry[LinkCount] ); @@ -5382,9 +5382,9 @@ PrintInterpretedExtendedCompatibilityAer ( Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_ADVANCED_ERROR_REPORTING*)HeaderAddress; ShellPrintHiiEx( - -1, -1, NULL, - STRING_TOKEN (STR_PCI_EXT_CAP_AER), - gShellDebug1HiiHandle, + -1, -1, NULL, + STRING_TOKEN (STR_PCI_EXT_CAP_AER), + gShellDebug1HiiHandle, Header->UncorrectableErrorStatus, Header->UncorrectableErrorMask, Header->UncorrectableErrorSeverity, @@ -5431,9 +5431,9 @@ PrintInterpretedExtendedCompatibilityMulticast ( Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_MULTICAST*)HeaderAddress; ShellPrintHiiEx( - -1, -1, NULL, - STRING_TOKEN (STR_PCI_EXT_CAP_MULTICAST), - gShellDebug1HiiHandle, + -1, -1, NULL, + STRING_TOKEN (STR_PCI_EXT_CAP_MULTICAST), + gShellDebug1HiiHandle, Header->MultiCastCapability, Header->MulticastControl, Header->McBaseAddress, @@ -5471,9 +5471,9 @@ PrintInterpretedExtendedCompatibilityVirtualChannel ( Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_VIRTUAL_CHANNEL_CAPABILITY*)HeaderAddress; ShellPrintHiiEx( - -1, -1, NULL, - STRING_TOKEN (STR_PCI_EXT_CAP_VC_BASE), - gShellDebug1HiiHandle, + -1, -1, NULL, + STRING_TOKEN (STR_PCI_EXT_CAP_VC_BASE), + gShellDebug1HiiHandle, Header->ExtendedVcCount, Header->PortVcCapability1, Header->PortVcCapability2, @@ -5484,9 +5484,9 @@ PrintInterpretedExtendedCompatibilityVirtualChannel ( for (ItemCount = 0 ; ItemCount < Header->ExtendedVcCount ; ItemCount++) { CapabilityItem = &Header->Capability[ItemCount]; ShellPrintHiiEx( - -1, -1, NULL, - STRING_TOKEN (STR_PCI_EXT_CAP_VC_ITEM), - gShellDebug1HiiHandle, + -1, -1, NULL, + STRING_TOKEN (STR_PCI_EXT_CAP_VC_ITEM), + gShellDebug1HiiHandle, ItemCount+1, CapabilityItem->VcResourceCapability, CapabilityItem->PortArbTableOffset, @@ -5524,9 +5524,9 @@ PrintInterpretedExtendedCompatibilityResizeableBar ( for (ItemCount = 0 ; ItemCount < (UINT32)GET_NUMBER_RESIZABLE_BARS(Header) ; ItemCount++) { ShellPrintHiiEx( - -1, -1, NULL, - STRING_TOKEN (STR_PCI_EXT_CAP_RESIZE_BAR), - gShellDebug1HiiHandle, + -1, -1, NULL, + STRING_TOKEN (STR_PCI_EXT_CAP_RESIZE_BAR), + gShellDebug1HiiHandle, ItemCount+1, Header->Capability[ItemCount].ResizableBarCapability, Header->Capability[ItemCount].ResizableBarControl @@ -5559,9 +5559,9 @@ PrintInterpretedExtendedCompatibilityTph ( Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_TPH*)HeaderAddress; ShellPrintHiiEx( - -1, -1, NULL, - STRING_TOKEN (STR_PCI_EXT_CAP_TPH), - gShellDebug1HiiHandle, + -1, -1, NULL, + STRING_TOKEN (STR_PCI_EXT_CAP_TPH), + gShellDebug1HiiHandle, Header->TphRequesterCapability, Header->TphRequesterControl ); @@ -5600,9 +5600,9 @@ PrintInterpretedExtendedCompatibilitySecondary ( Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_SECONDARY_PCIE*)HeaderAddress; ShellPrintHiiEx( - -1, -1, NULL, - STRING_TOKEN (STR_PCI_EXT_CAP_SECONDARY), - gShellDebug1HiiHandle, + -1, -1, NULL, + STRING_TOKEN (STR_PCI_EXT_CAP_SECONDARY), + gShellDebug1HiiHandle, Header->LinkControl3.Uint32, Header->LaneErrorStatus ); @@ -5633,7 +5633,7 @@ PrintInterpretedExtendedCompatibilitySecondary ( **/ EFI_STATUS PrintPciExtendedCapabilityDetails( - IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress, + IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress, IN CONST PCI_EXP_EXT_HDR *HeaderAddress, IN CONST PCI_CAPABILITY_PCIEXP *PciExpressCapPtr ) @@ -5666,7 +5666,7 @@ PrintPciExtendedCapabilityDetails( case PCI_EXPRESS_EXTENDED_CAPABILITY_VIRTUAL_CHANNEL_ID: case PCI_EXPRESS_EXTENDED_CAPABILITY_MULTI_FUNCTION_VIRTUAL_CHANNEL_ID: return PrintInterpretedExtendedCompatibilityVirtualChannel(HeaderAddress, HeadersBaseAddress); - case PCI_EXPRESS_EXTENDED_CAPABILITY_MULTICAST_ID: + case PCI_EXPRESS_EXTENDED_CAPABILITY_MULTICAST_ID: // // should only be present if PCIE_CAP_DEVICEPORT_TYPE(PciExpressCapPtr->PcieCapReg) == 0100b, 0101b, or 0110b // diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SerMode.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SerMode.c index fe612b877b..564acfb8a2 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SerMode.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SerMode.c @@ -2,7 +2,7 @@ Main file for SerMode shell Debug1 function. (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -50,7 +50,7 @@ DisplaySettings ( Status = gBS->LocateHandleBuffer (ByProtocol, &gEfiSerialIoProtocolGuid, NULL, &NoHandles, &Handles); if (EFI_ERROR (Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_NO_FOUND), gShellDebug1HiiHandle, L"sermode"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_NO_FOUND), gShellDebug1HiiHandle, L"sermode"); return SHELL_INVALID_PARAMETER; } @@ -138,7 +138,7 @@ DisplaySettings ( StopBits ); } else { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_NO_FOUND), gShellDebug1HiiHandle, L"sermode"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_NO_FOUND), gShellDebug1HiiHandle, L"sermode"); ShellStatus = SHELL_NOT_FOUND; break; } @@ -150,7 +150,7 @@ DisplaySettings ( if (Index == NoHandles) { if ((NoHandles != 0 && HandleValid) || 0 == NoHandles) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_NOT_FOUND), gShellDebug1HiiHandle, L"sermode"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_NOT_FOUND), gShellDebug1HiiHandle, L"sermode"); ShellStatus = SHELL_NOT_FOUND; } } @@ -199,7 +199,7 @@ ShellCommandRunSerMode ( Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"sermode", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"sermode", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -207,10 +207,10 @@ ShellCommandRunSerMode ( } } else { if (ShellCommandLineGetCount(Package) < 6 && ShellCommandLineGetCount(Package) > 2) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"sermode"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"sermode"); ShellStatus = SHELL_INVALID_PARAMETER; } else if (ShellCommandLineGetCount(Package) > 6) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"sermode"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"sermode"); ShellStatus = SHELL_INVALID_PARAMETER; } else { Temp = ShellCommandLineGetRawValue(Package, 1); @@ -235,7 +235,7 @@ ShellCommandRunSerMode ( } Temp = ShellCommandLineGetRawValue(Package, 3); if (Temp == NULL || StrLen(Temp)>1) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"sermode", Temp); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"sermode", Temp); ShellStatus = SHELL_INVALID_PARAMETER; } else { switch(Temp[0]){ @@ -264,7 +264,7 @@ ShellCommandRunSerMode ( Parity = SpaceParity; break; default: - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"sermode", Temp); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"sermode", Temp); ShellStatus = SHELL_INVALID_PARAMETER; goto Done; } @@ -284,7 +284,7 @@ ShellCommandRunSerMode ( case 8: break; default: - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"sermode", Temp); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"sermode", Temp); ShellStatus = SHELL_INVALID_PARAMETER; goto Done; } @@ -308,13 +308,13 @@ ShellCommandRunSerMode ( break; default: - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"sermode", Temp); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"sermode", Temp); ShellStatus = SHELL_INVALID_PARAMETER; goto Done; } Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiSerialIoProtocolGuid, NULL, &NoHandles, &Handles); if (EFI_ERROR (Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_NO_FOUND), gShellDebug1HiiHandle, L"sermode"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_NO_FOUND), gShellDebug1HiiHandle, L"sermode"); ShellStatus = SHELL_INVALID_PARAMETER; goto Done; } @@ -337,13 +337,13 @@ ShellCommandRunSerMode ( ); if (EFI_ERROR (Status)) { if (Status == EFI_INVALID_PARAMETER) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_SET_UNSUPPORTED), gShellDebug1HiiHandle, L"sermode", ConvertHandleToHandleIndex(Handles[Index])); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_SET_UNSUPPORTED), gShellDebug1HiiHandle, L"sermode", ConvertHandleToHandleIndex(Handles[Index])); ShellStatus = SHELL_UNSUPPORTED; } else if (Status == EFI_DEVICE_ERROR) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_SET_DEV_ERROR), gShellDebug1HiiHandle, L"sermode", ConvertHandleToHandleIndex(Handles[Index])); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_SET_DEV_ERROR), gShellDebug1HiiHandle, L"sermode", ConvertHandleToHandleIndex(Handles[Index])); ShellStatus = SHELL_ACCESS_DENIED; } else { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_SET_FAIL), gShellDebug1HiiHandle, L"sermode", ConvertHandleToHandleIndex(Handles[Index])); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_SET_FAIL), gShellDebug1HiiHandle, L"sermode", ConvertHandleToHandleIndex(Handles[Index])); ShellStatus = SHELL_ACCESS_DENIED; } } else { @@ -356,7 +356,7 @@ ShellCommandRunSerMode ( } if (ShellStatus == SHELL_SUCCESS && Index == NoHandles) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_BAD_HANDLE), gShellDebug1HiiHandle, L"sermode", HandleIdx); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_BAD_HANDLE), gShellDebug1HiiHandle, L"sermode", HandleIdx); ShellStatus = SHELL_INVALID_PARAMETER; } diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SetSize.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SetSize.c index a33aec12a5..14d8b719cd 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SetSize.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SetSize.c @@ -2,7 +2,7 @@ Main file for SetSize shell Debug1 function. (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -55,7 +55,7 @@ ShellCommandRunSetSize ( Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"setsize", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"setsize", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -63,13 +63,13 @@ ShellCommandRunSetSize ( } } else { if (ShellCommandLineGetCount(Package) < 3) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"setsize"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"setsize"); ShellStatus = SHELL_INVALID_PARAMETER; NewSize = 0; } else { Temp1 = ShellCommandLineGetRawValue(Package, 1); if (!ShellIsHexOrDecimalNumber(Temp1, FALSE, FALSE)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SIZE_NOT_SPEC), gShellDebug1HiiHandle, L"setsize"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SIZE_NOT_SPEC), gShellDebug1HiiHandle, L"setsize"); ShellStatus = SHELL_INVALID_PARAMETER; NewSize = 0; } else { @@ -82,19 +82,19 @@ ShellCommandRunSetSize ( Status = ShellOpenFileByName(ShellCommandLineGetRawValue(Package, LoopVar), &FileHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE|EFI_FILE_MODE_CREATE, 0); } if (EFI_ERROR(Status) && LoopVar == 2) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_SPEC), gShellDebug1HiiHandle, L"setsize"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_SPEC), gShellDebug1HiiHandle, L"setsize"); ShellStatus = SHELL_INVALID_PARAMETER; } else if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"setsize", ShellCommandLineGetRawValue(Package, LoopVar)); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"setsize", ShellCommandLineGetRawValue(Package, LoopVar)); ShellStatus = SHELL_INVALID_PARAMETER; break; } else { Status = FileHandleSetSize(FileHandle, NewSize); if (Status == EFI_VOLUME_FULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_VOLUME_FULL), gShellDebug1HiiHandle, L"setsize"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_VOLUME_FULL), gShellDebug1HiiHandle, L"setsize"); ShellStatus = SHELL_VOLUME_FULL; } else if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SET_SIZE_FAIL), gShellDebug1HiiHandle, L"setsize", ShellCommandLineGetRawValue(Package, LoopVar)); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SET_SIZE_FAIL), gShellDebug1HiiHandle, L"setsize", ShellCommandLineGetRawValue(Package, LoopVar)); ShellStatus = SHELL_INVALID_PARAMETER; } else { ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SET_SIZE_DONE), gShellDebug1HiiHandle, ShellCommandLineGetRawValue(Package, LoopVar)); diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SetVar.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SetVar.c index b7d3bbdc03..b4f2da4fd9 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SetVar.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SetVar.c @@ -2,7 +2,7 @@ Main file for SetVar shell Debug1 function. (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -378,19 +378,19 @@ ShellCommandRunSetVar ( Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"setvar", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"setvar", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { ASSERT(FALSE); } } else if (ShellCommandLineCheckDuplicate (Package,&ProblemParam) != EFI_SUCCESS) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_DUPLICATE), gShellDebug1HiiHandle, L"setvar", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_DUPLICATE), gShellDebug1HiiHandle, L"setvar", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { if (ShellCommandLineGetCount(Package) < 2) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"setvar"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"setvar"); ShellStatus = SHELL_INVALID_PARAMETER; } else { VariableName = ShellCommandLineGetRawValue(Package, 1); @@ -400,7 +400,7 @@ ShellCommandRunSetVar ( StringGuid = ShellCommandLineGetValue(Package, L"-guid"); RStatus = StrToGuid (StringGuid, &Guid); if (RETURN_ERROR (RStatus) || (StringGuid[GUID_STRING_LENGTH] != L'\0')) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"setvar", StringGuid); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"setvar", StringGuid); ShellStatus = SHELL_INVALID_PARAMETER; } } diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.c index edfdcc9b2a..bf14ba654a 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.c @@ -1,7 +1,7 @@ /** @file API for SMBIOS table. - Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.
+ Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ - + #include "UefiShellDebug1CommandsLib.h" #include diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c index 7a75554d79..93c6094df1 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c @@ -1,8 +1,8 @@ /** @file Module for clarifying the content of the smbios structure element information. - Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.
- (C) Copyright 2014 Hewlett-Packard Development Company, L.P.
+ Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
+ (C) Copyright 2014 Hewlett-Packard Development Company, L.P.
(C) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -2892,7 +2892,7 @@ DisplaySBDSManufactureDate ( /** Display System Reset (Type 23) information. - + Identifies the system-reset capabilities for the system. Bits 7:6 Reserved for future assignment via this specification, set to 00b. Bit 5 System contains a watchdog timer, either True (1) or False (0). @@ -2996,7 +2996,7 @@ DisplaySystemResetCapabilities ( /** Display Hardware Security (Type 24) information. - + Identifies the password and reset status for the system: Bits 7:6 Power-on Password Status, one of: diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c index 3c561ad858..b56cd61d07 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c @@ -2,7 +2,7 @@ Build a table, each item is (Key, Info) pair. And give a interface of query a string out of a table. - Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.
+ Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
(C) Copyright 2016-2017 Hewlett Packard Enterprise Development LP
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -3412,7 +3412,7 @@ QueryTable ( // Check if Key is in the range // or if Key == Value in the table // - if ((High > Low && Key >= Low && Key <= High) + if ((High > Low && Key >= Low && Key <= High) || (Table[Index].Key == Key)) { StrnCpyS (Info, InfoLen, Table[Index].Info, InfoLen - 1); StrnCatS (Info, InfoLen, L"\n", InfoLen - 1 - StrLen(Info)); diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.c index 6e7c7637a1..e20b20793d 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.c @@ -2,7 +2,7 @@ Tools of clarify the content of the smbios table. (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.
+ Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -69,7 +69,7 @@ ShellCommandRunSmbiosView ( Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"smbiosview", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"smbiosview", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -77,13 +77,13 @@ ShellCommandRunSmbiosView ( } } else { if (ShellCommandLineGetCount(Package) > 1) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"smbiosview"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"smbiosview"); ShellStatus = SHELL_INVALID_PARAMETER; } else if (ShellCommandLineGetFlag(Package, L"-t") && ShellCommandLineGetValue(Package, L"-t") == NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"smbiosview", L"-t"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"smbiosview", L"-t"); ShellStatus = SHELL_INVALID_PARAMETER; } else if (ShellCommandLineGetFlag(Package, L"-h") && ShellCommandLineGetValue(Package, L"-h") == NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"smbiosview", L"-h"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"smbiosview", L"-h"); ShellStatus = SHELL_INVALID_PARAMETER; } else if ( (ShellCommandLineGetFlag(Package, L"-t") && ShellCommandLineGetFlag(Package, L"-h")) || @@ -93,7 +93,7 @@ ShellCommandRunSmbiosView ( (ShellCommandLineGetFlag(Package, L"-h") && ShellCommandLineGetFlag(Package, L"-a")) || (ShellCommandLineGetFlag(Package, L"-s") && ShellCommandLineGetFlag(Package, L"-a")) ) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"smbiosview"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"smbiosview"); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -103,30 +103,30 @@ ShellCommandRunSmbiosView ( Status1 = LibSmbiosInit (); Status2 = LibSmbios64BitInit (); if (EFI_ERROR (Status1) && EFI_ERROR (Status2)) { - ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_LIBSMBIOSVIEW_CANNOT_GET_TABLE), gShellDebug1HiiHandle); + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_LIBSMBIOSVIEW_CANNOT_GET_TABLE), gShellDebug1HiiHandle); ShellStatus = SHELL_NOT_FOUND; goto Done; } - + StructType = STRUCTURE_TYPE_RANDOM; RandomView = TRUE; - + Temp = ShellCommandLineGetValue(Package, L"-t"); if (Temp != NULL) { StructType = (UINT8) ShellStrToUintn (Temp); } - + if (ShellCommandLineGetFlag(Package, L"-a")) { gShowType = SHOW_ALL; } - + if (!EFI_ERROR (Status1)) { // // Initialize the StructHandle to be the first handle // StructHandle = INVALID_HANDLE; LibGetSmbiosStructure (&StructHandle, NULL, NULL); - + Temp = ShellCommandLineGetValue(Package, L"-h"); if (Temp != NULL) { RandomView = FALSE; @@ -140,7 +140,7 @@ ShellCommandRunSmbiosView ( ShellStatus = SHELL_NOT_FOUND; goto Done; } - + if (ShellCommandLineGetFlag(Package, L"-s")) { Status = DisplayStatisticsTable (SHOW_DETAIL); if (EFI_ERROR(Status)) { @@ -148,7 +148,7 @@ ShellCommandRunSmbiosView ( } goto Show64Bit; } - + // // Show SMBIOS structure information // @@ -174,13 +174,13 @@ Show64Bit: // StructHandle = INVALID_HANDLE; LibGetSmbios64BitStructure (&StructHandle, NULL, NULL); - + Temp = ShellCommandLineGetValue(Package, L"-h"); if (Temp != NULL) { RandomView = FALSE; StructHandle = (UINT16) ShellStrToUintn(Temp); } - + if (ShellCommandLineGetFlag(Package, L"-s")) { Status = DisplaySmbios64BitStatisticsTable (SHOW_DETAIL); if (EFI_ERROR(Status)) { @@ -188,7 +188,7 @@ Show64Bit: } goto Done; } - + // // Show SMBIOS structure information // @@ -666,7 +666,7 @@ InitSmbiosTableStatistics ( @param[out] NumberOfSmbios64Structures The number of structures in 64-bit SMBIOS table. @param[out] Smbios64TableLength The total length of 64-bit SMBIOS table. - @retval EFI_SUCCESS Calculation was successful. + @retval EFI_SUCCESS Calculation was successful. **/ EFI_STATUS CalculateSmbios64BitStructureCountAndLength ( @@ -677,10 +677,10 @@ CalculateSmbios64BitStructureCountAndLength ( { SMBIOS_STRUCTURE_POINTER Smbios; UINT8 *Raw; - + *Smbios64TableLength = 0; *NumberOfSmbios64Structures = 0; - + Smbios.Raw = (UINT8 *)(UINTN)(Smbios64EntryPoint->TableAddress); while (TRUE) { if (Smbios.Hdr->Type == 127) { @@ -702,11 +702,11 @@ CalculateSmbios64BitStructureCountAndLength ( // (*Smbios64TableLength) += ((UINTN) Smbios.Raw - (UINTN) Raw); if ((*Smbios64TableLength) > Smbios64EntryPoint->TableMaximumSize) { - // - // The actual table length exceeds maximum table size, - // There should be something wrong with SMBIOS table. - // - return EFI_INVALID_PARAMETER; + // + // The actual table length exceeds maximum table size, + // There should be something wrong with SMBIOS table. + // + return EFI_INVALID_PARAMETER; } (*NumberOfSmbios64Structures)++; } @@ -727,7 +727,7 @@ InitSmbios64BitTableStatistics ( UINT16 Length; UINT16 Offset; UINT16 Index; - EFI_STATUS Status; + EFI_STATUS Status; SMBIOS_STRUCTURE_POINTER SmbiosStruct; SMBIOS_TABLE_3_0_ENTRY_POINT *SMBiosTable; STRUCTURE_STATISTICS *StatisticsPointer; @@ -755,9 +755,9 @@ InitSmbios64BitTableStatistics ( // Status = CalculateSmbios64BitStructureCountAndLength (SMBiosTable, &mNumberOfSmbios64BitStructures, &mSmbios64BitTableLength); if ((EFI_ERROR (Status)) || (mSmbios64BitTableLength > SMBiosTable->TableMaximumSize)) { - return EFI_INVALID_PARAMETER; + return EFI_INVALID_PARAMETER; } - + mSmbios64BitStatisticsTable = (STRUCTURE_STATISTICS *) AllocateZeroPool (mNumberOfSmbios64BitStructures * sizeof (STRUCTURE_STATISTICS)); if (mSmbios64BitStatisticsTable == NULL) { diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.c index b45e9a33f3..bd4dfa98f7 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.c @@ -1,7 +1,7 @@ /** @file Main file for NULL named library for debug1 profile shell command functions. - Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -173,7 +173,7 @@ GetSystemConfigurationTable ( /** Clear the line at the specified Row. - + @param[in] Row The row number to be cleared ( start from 1 ) @param[in] LastCol The last printable column. @param[in] LastRow The last printable row. @@ -210,7 +210,7 @@ EditorClearLine ( Line[LastCol % (ARRAY_SIZE (Line) - 1)] = CHAR_NULL; } } - + // // print out the blank line // @@ -243,7 +243,7 @@ IsValidFileNameChar ( /** Check if file name has illegal characters. - + @param Name The filename to check. @retval TRUE The filename is ok. @@ -323,18 +323,18 @@ EditGetDefaultFileName ( } /** - Read a file into an allocated buffer. The buffer is the responsibility + Read a file into an allocated buffer. The buffer is the responsibility of the caller to free. @param[in] FileName The filename of the file to open. - @param[out] Buffer Upon successful return, the pointer to the - address of the allocated buffer. + @param[out] Buffer Upon successful return, the pointer to the + address of the allocated buffer. @param[out] BufferSize If not NULL, then the pointer to the size of the allocated buffer. @param[out] ReadOnly Upon successful return TRUE if the file is read only. FALSE otherwise. - @retval EFI_NOT_FOUND The filename did not represent a file in the + @retval EFI_NOT_FOUND The filename did not represent a file in the file system. @retval EFI_SUCCESS The file was read into the buffer. @retval EFI_OUT_OF_RESOURCES A memory allocation failed. @@ -381,7 +381,7 @@ ReadFileIntoBuffer ( } Info = ShellGetFileInfo(FileHandle); - + if (Info->Attribute & EFI_FILE_DIRECTORY) { FreePool (Info); return EFI_INVALID_PARAMETER; diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.h index 80a8476a5e..c4ef9909e8 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.h +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.h @@ -1,7 +1,7 @@ /** @file Main file for NULL named library for Profile1 shell command functions. - Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -312,7 +312,7 @@ ShellCommandRunHexEdit ( /** Clear the line at the specified Row. - + @param[in] Row The row number to be cleared ( start from 1 ) @param[in] LastCol The last printable column. @param[in] LastRow The last printable row. @@ -326,7 +326,7 @@ EditorClearLine ( /** Check if file name has illegal characters. - + @param Name The filename to check. @retval TRUE The filename is ok. @@ -351,18 +351,18 @@ EditGetDefaultFileName ( ); /** - Read a file into an allocated buffer. The buffer is the responsibility + Read a file into an allocated buffer. The buffer is the responsibility of the caller to free. @param[in] FileName The filename of the file to open. - @param[out] Buffer Upon successful return, the pointer to the - address of the allocated buffer. + @param[out] Buffer Upon successful return, the pointer to the + address of the allocated buffer. @param[out] BufferSize If not NULL, then the pointer to the size of the allocated buffer. @param[out] ReadOnly Upon successful return TRUE if the file is read only. FALSE otherwise. - @retval EFI_NOT_FOUND The filename did not represent a file in the + @retval EFI_NOT_FOUND The filename did not represent a file in the file system. Directories cannot be read with this method. @retval EFI_SUCCESS The file was read into the buffer. diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf index 6b837b5faa..3ea51ec082 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf @@ -1,7 +1,7 @@ ## @file # Provides shell Debug1 profile functions # -# Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.
+# Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -64,8 +64,8 @@ EditStatusBar.c EditMenuBar.h EditMenuBar.c - -## Files specific to the text editor + +## Files specific to the text editor Edit/Edit.c Edit/TextEditor.h Edit/TextEditorTypes.h @@ -76,7 +76,7 @@ Edit/Misc.h Edit/Misc.c Edit/TextEditStrings.uni - + ## Files specific to the HEX editor HexEdit/BufferImage.h HexEdit/BufferImage.c diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni index 011a7bfc2d..ae1b9b2b0d 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni @@ -1,6 +1,6 @@ // /** // -// Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
+// Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
// (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
// (C) Copyright 2016 Hewlett Packard Enterprise Development LP
// This program and the accompanying materials @@ -1041,7 +1041,7 @@ " 2. The variable value is printed as a hexadecimal dump.\r\n" " 3. Option -d is used to delete variables. Option -s and -l are used to save\r\n" " and load variables to and from a file. The variable name can be specified\r\n" -" when using these flags so that the operation only takes effect on\r\n" +" when using these flags so that the operation only takes effect on\r\n" " that variable.\r\n" ".SH EXAMPLES\r\n" " \r\n" diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/Connect.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/Connect.c index dd868a7016..24a3279042 100644 --- a/ShellPkg/Library/UefiShellDriver1CommandsLib/Connect.c +++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/Connect.c @@ -2,7 +2,7 @@ Main file for connect shell Driver1 function. (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -36,16 +36,16 @@ ShellConnectDevicePath ( EFI_STATUS Status; EFI_HANDLE Handle; EFI_HANDLE PreviousHandle; - + if (DevicePathToConnect == NULL) { return EFI_INVALID_PARAMETER; } PreviousHandle = NULL; - do{ + do{ RemainingDevicePath = DevicePathToConnect; Status = gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &RemainingDevicePath, &Handle); - + if (!EFI_ERROR (Status) && (Handle != NULL)) { if (PreviousHandle == Handle) { Status = EFI_NOT_FOUND; @@ -54,16 +54,16 @@ ShellConnectDevicePath ( Status = gBS->ConnectController (Handle, NULL, RemainingDevicePath, FALSE); } } - + } while (!EFI_ERROR (Status) && !IsDevicePathEnd (RemainingDevicePath) ); - + return Status; - + } /** Connect drivers for PCI root bridge. - + @retval EFI_SUCCESS Connect drivers successfully. @retval EFI_NOT_FOUND Cannot find PCI root bridge device. @@ -72,31 +72,31 @@ EFI_STATUS ShellConnectPciRootBridge ( VOID ) -{ +{ UINTN RootBridgeHandleCount; EFI_HANDLE *RootBridgeHandleBuffer; UINTN RootBridgeIndex; EFI_STATUS Status; - + RootBridgeHandleCount = 0; - - Status = gBS->LocateHandleBuffer ( - ByProtocol, - &gEfiPciRootBridgeIoProtocolGuid, - NULL, - &RootBridgeHandleCount, - &RootBridgeHandleBuffer + + Status = gBS->LocateHandleBuffer ( + ByProtocol, + &gEfiPciRootBridgeIoProtocolGuid, + NULL, + &RootBridgeHandleCount, + &RootBridgeHandleBuffer ); if (EFI_ERROR (Status)) { return Status; } - - for (RootBridgeIndex = 0; RootBridgeIndex < RootBridgeHandleCount; RootBridgeIndex++) { - gBS->ConnectController (RootBridgeHandleBuffer[RootBridgeIndex], NULL, NULL, FALSE); - } + + for (RootBridgeIndex = 0; RootBridgeIndex < RootBridgeHandleCount; RootBridgeIndex++) { + gBS->ConnectController (RootBridgeHandleBuffer[RootBridgeIndex], NULL, NULL, FALSE); + } FreePool (RootBridgeHandleBuffer); - + return EFI_SUCCESS; } @@ -199,7 +199,7 @@ ShellConnectFromDevPaths ( { EFI_DEVICE_PATH_PROTOCOL *DevPath; EFI_DEVICE_PATH_PROTOCOL *CopyOfDevPath; - EFI_DEVICE_PATH_PROTOCOL *Instance; + EFI_DEVICE_PATH_PROTOCOL *Instance; EFI_DEVICE_PATH_PROTOCOL *Next; UINTN Length; UINTN Index; @@ -210,7 +210,7 @@ ShellConnectFromDevPaths ( BOOLEAN AtLeastOneConnected; EFI_PCI_IO_PROTOCOL *PciIo; UINT8 Class[3]; - + DevPath = NULL; Length = 0; AtLeastOneConnected = FALSE; @@ -266,14 +266,14 @@ ShellConnectFromDevPaths ( ((DevicePathSubType (Instance) == MSG_USB_CLASS_DP) || (DevicePathSubType (Instance) == MSG_USB_WWID_DP) )) { - + Status = ShellConnectPciRootBridge (); if (EFI_ERROR(Status)) { FreePool(Instance); FreePool(DevPath); return Status; } - + Status = gBS->LocateHandleBuffer ( ByProtocol, &gEfiPciIoProtocolGuid, @@ -281,7 +281,7 @@ ShellConnectFromDevPaths ( &HandleArrayCount, &HandleArray ); - + if (!EFI_ERROR (Status)) { for (Index = 0; Index < HandleArrayCount; Index++) { Status = gBS->HandleProtocol ( @@ -289,7 +289,7 @@ ShellConnectFromDevPaths ( &gEfiPciIoProtocolGuid, (VOID **)&PciIo ); - + if (!EFI_ERROR (Status)) { Status = PciIo->Pci.Read (PciIo, EfiPciIoWidthUint8, 0x09, 3, &Class); if (!EFI_ERROR (Status)) { @@ -313,7 +313,7 @@ ShellConnectFromDevPaths ( if (HandleArray != NULL) { FreePool (HandleArray); } - } else { + } else { // // connect the entire device path // @@ -323,9 +323,9 @@ ShellConnectFromDevPaths ( } } FreePool (Instance); - + } while (CopyOfDevPath != NULL); - + if (DevPath != NULL) { FreePool(DevPath); } @@ -335,7 +335,7 @@ ShellConnectFromDevPaths ( } else { return EFI_NOT_FOUND; } - + } /** @@ -437,7 +437,7 @@ ShellCommandRunConnect ( Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, L"connect", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, L"connect", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -456,7 +456,7 @@ ShellCommandRunConnect ( // // error for too many parameters // - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"connect"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"connect"); ShellStatus = SHELL_INVALID_PARAMETER; } else if (ShellCommandLineGetFlag(Package, L"-c")) { // @@ -504,7 +504,7 @@ ShellCommandRunConnect ( Status = ShellConvertStringToUint64(Param1, &Intermediate, TRUE, FALSE); Handle1 = ConvertHandleIndexToHandle((UINTN)Intermediate); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"connect", Param1); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"connect", Param1); ShellStatus = SHELL_INVALID_PARAMETER; } } else { @@ -515,22 +515,22 @@ ShellCommandRunConnect ( Status = ShellConvertStringToUint64(Param2, &Intermediate, TRUE, FALSE); Handle2 = ConvertHandleIndexToHandle((UINTN)Intermediate); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"connect", Param2); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"connect", Param2); ShellStatus = SHELL_INVALID_PARAMETER; } } else { Handle2 = NULL; } - + if (ShellStatus == SHELL_SUCCESS) { if (Param1 != NULL && Handle1 == NULL){ - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"connect", Param1); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"connect", Param1); ShellStatus = SHELL_INVALID_PARAMETER; } else if (Param2 != NULL && Handle2 == NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"connect", Param2); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"connect", Param2); ShellStatus = SHELL_INVALID_PARAMETER; } else if (Handle2 != NULL && Handle1 != NULL && EFI_ERROR(gBS->OpenProtocol(Handle2, &gEfiDriverBindingProtocolGuid, NULL, gImageHandle, NULL, EFI_OPEN_PROTOCOL_TEST_PROTOCOL))) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"connect", Param2); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"connect", Param2); ShellStatus = SHELL_INVALID_PARAMETER; } else { Status = ConvertAndConnectControllers(Handle1, Handle2, ShellCommandLineGetFlag(Package, L"-r"), (BOOLEAN)(Count!=0)); diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/DevTree.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/DevTree.c index 6f070eeaa1..0658f9b87a 100644 --- a/ShellPkg/Library/UefiShellDriver1CommandsLib/DevTree.c +++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/DevTree.c @@ -2,7 +2,7 @@ Main file for DevTree shell Driver1 function. (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -58,12 +58,12 @@ DoDevTreeForHandle( ASSERT (TheHandle != NULL); ASSERT (HiiString != NULL); - + if (ShellGetExecutionBreakFlag()) { ShellStatus = SHELL_ABORTED; return ShellStatus; } - + // // We want controller handles. they will not have LoadedImage or DriverBinding (or others...) // @@ -184,7 +184,7 @@ ShellCommandRunDevTree ( Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, L"devtree", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, L"devtree", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -192,7 +192,7 @@ ShellCommandRunDevTree ( } } else { if (ShellCommandLineGetCount(Package) > 2) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"devtree"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"devtree"); ShellCommandLineFreeVarList (Package); return (SHELL_INVALID_PARAMETER); } @@ -206,7 +206,7 @@ ShellCommandRunDevTree ( // AsciiSPrint(Language, 10, "en-us"); } else { ASSERT(Language == NULL); - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDriver1HiiHandle, L"devtree", L"-l"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDriver1HiiHandle, L"devtree", L"-l"); ShellCommandLineFreeVarList (Package); return (SHELL_INVALID_PARAMETER); } @@ -259,7 +259,7 @@ ShellCommandRunDevTree ( } else { Status = ShellConvertStringToUint64(Lang, &Intermediate, TRUE, FALSE); if (EFI_ERROR(Status) || ConvertHandleIndexToHandle((UINTN)Intermediate) == NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"devtree", Lang); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"devtree", Lang); ShellStatus = SHELL_INVALID_PARAMETER; } else { ShellStatus = DoDevTreeForHandle(ConvertHandleIndexToHandle((UINTN)Intermediate), Language, FlagD, 0, HiiString); diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/Devices.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/Devices.c index b725178ebd..629167c243 100644 --- a/ShellPkg/Library/UefiShellDriver1CommandsLib/Devices.c +++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/Devices.c @@ -2,7 +2,7 @@ Main file for devices shell Driver1 function. (C) Copyright 2012-2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -19,19 +19,19 @@ Get lots of info about a device from its handle. @param[in] TheHandle The device handle to get info on. - @param[in, out] Type On successful return R, B, or D (root, bus, or + @param[in, out] Type On successful return R, B, or D (root, bus, or device) will be placed in this buffer. - @param[in, out] Cfg On successful return this buffer will be + @param[in, out] Cfg On successful return this buffer will be TRUE if the handle has configuration, FALSE otherwise. - @param[in, out] Diag On successful return this buffer will be + @param[in, out] Diag On successful return this buffer will be TRUE if the handle has disgnostics, FALSE otherwise. - @param[in, out] Parents On successful return this buffer will be + @param[in, out] Parents On successful return this buffer will be contain the number of parent handles. - @param[in, out] Devices On successful return this buffer will be + @param[in, out] Devices On successful return this buffer will be contain the number of devices controlled. - @param[in, out] Children On successful return this buffer will be + @param[in, out] Children On successful return this buffer will be contain the number of child handles. @param[out] Name The pointer to a buffer that will be allocated and contain the string name of the handle. @@ -58,7 +58,7 @@ GetDeviceHandleInfo ( EFI_HANDLE *HandleBuffer; UINTN Count; - if (TheHandle == NULL + if (TheHandle == NULL || Type == NULL || Cfg == NULL || Diag == NULL @@ -168,7 +168,7 @@ ShellCommandRunDevices ( Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, L"devices", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, L"devices", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -182,7 +182,7 @@ ShellCommandRunDevices ( // // error for too many parameters // - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"devices"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"devices"); ShellStatus = SHELL_INVALID_PARAMETER; } else { // @@ -198,7 +198,7 @@ ShellCommandRunDevices ( // AsciiSPrint(Language, 10, "en-us"); } else { ASSERT(Language == NULL); - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDriver1HiiHandle, L"devices", L"-l"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDriver1HiiHandle, L"devices", L"-l"); ShellCommandLineFreeVarList (Package); return (SHELL_INVALID_PARAMETER); } @@ -253,13 +253,13 @@ ShellCommandRunDevices ( ShellStatus = SHELL_ABORTED; break; } - + } if (HandleList != NULL) { FreePool(HandleList); } - + } SHELL_FREE_NON_NULL(Language); ShellCommandLineFreeVarList (Package); diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/Dh.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/Dh.c index a7bd2516d0..5e8db3d66c 100644 --- a/ShellPkg/Library/UefiShellDriver1CommandsLib/Dh.c +++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/Dh.c @@ -2,7 +2,7 @@ Main file for Dh shell Driver1 function. (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
(C) Copyright 2017 Hewlett Packard Enterprise Development LP
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -342,7 +342,7 @@ GetProtocolInfoString( } } } - + SHELL_FREE_NON_NULL(ProtocolGuidArray); if (RetVal == NULL) { @@ -395,7 +395,7 @@ GetDriverImageName ( /** Display driver model information for a given handle. - + @param[in] Handle The handle to display info on. @param[in] BestName Use the best name? @param[in] Language The language to output in. @@ -483,14 +483,14 @@ DisplayDriverModelHandle ( Status = gEfiShellProtocol->GetDeviceName(Handle, EFI_DEVICE_NAME_USE_COMPONENT_NAME|EFI_DEVICE_NAME_USE_DEVICE_PATH, (CHAR8*)Language, &TempStringPointer); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DH_OUTPUT_DRIVER1), gShellDriver1HiiHandle, TempStringPointer!=NULL?TempStringPointer:L""); SHELL_FREE_NON_NULL(TempStringPointer); - + TempStringPointer = ConvertDevicePathToText(DevicePath, TRUE, FALSE); ShellPrintHiiEx( - -1, - -1, - NULL, - STRING_TOKEN (STR_DH_OUTPUT_DRIVER2), - gShellDriver1HiiHandle, + -1, + -1, + NULL, + STRING_TOKEN (STR_DH_OUTPUT_DRIVER2), + gShellDriver1HiiHandle, TempStringPointer!=NULL?TempStringPointer:L"", ParentControllerHandleCount == 0?L"ROOT":(ChildControllerHandleCount > 0)?L"BUS":L"DEVICE", ConfigurationStatus?L"YES":L"NO", @@ -501,20 +501,20 @@ DisplayDriverModelHandle ( if (DriverBindingHandleCount == 0) { ShellPrintHiiEx( - -1, - -1, - NULL, - STRING_TOKEN (STR_DH_OUTPUT_DRIVER3), - gShellDriver1HiiHandle, + -1, + -1, + NULL, + STRING_TOKEN (STR_DH_OUTPUT_DRIVER3), + gShellDriver1HiiHandle, L"" ); } else { ShellPrintHiiEx( - -1, - -1, - NULL, - STRING_TOKEN (STR_DH_OUTPUT_DRIVER3), - gShellDriver1HiiHandle, + -1, + -1, + NULL, + STRING_TOKEN (STR_DH_OUTPUT_DRIVER3), + gShellDriver1HiiHandle, L"" ); for (Index = 0; Index < DriverBindingHandleCount; Index++) { @@ -536,9 +536,9 @@ DisplayDriverModelHandle ( if (Image) { ShellPrintHiiEx( - -1, - -1, - NULL, + -1, + -1, + NULL, STRING_TOKEN (STR_DH_OUTPUT_DRIVER4A), gShellDriver1HiiHandle, ConvertHandleToHandleIndex (DriverBindingHandleBuffer[Index]), @@ -546,9 +546,9 @@ DisplayDriverModelHandle ( ); } else { ShellPrintHiiEx( - -1, - -1, - NULL, + -1, + -1, + NULL, STRING_TOKEN (STR_DH_OUTPUT_DRIVER4B), gShellDriver1HiiHandle, ConvertHandleToHandleIndex (DriverBindingHandleBuffer[Index]), @@ -561,28 +561,28 @@ DisplayDriverModelHandle ( if (ParentControllerHandleCount == 0) { ShellPrintHiiEx( - -1, - -1, - NULL, - STRING_TOKEN (STR_DH_OUTPUT_DRIVER5), - gShellDriver1HiiHandle, + -1, + -1, + NULL, + STRING_TOKEN (STR_DH_OUTPUT_DRIVER5), + gShellDriver1HiiHandle, L"" ); } else { ShellPrintHiiEx( - -1, - -1, - NULL, - STRING_TOKEN (STR_DH_OUTPUT_DRIVER5), - gShellDriver1HiiHandle, + -1, + -1, + NULL, + STRING_TOKEN (STR_DH_OUTPUT_DRIVER5), + gShellDriver1HiiHandle, L"" ); for (Index = 0; Index < ParentControllerHandleCount; Index++) { Status = gEfiShellProtocol->GetDeviceName(ParentControllerHandleBuffer[Index], EFI_DEVICE_NAME_USE_COMPONENT_NAME|EFI_DEVICE_NAME_USE_DEVICE_PATH, (CHAR8*)Language, &TempStringPointer); ShellPrintHiiEx( - -1, - -1, - NULL, + -1, + -1, + NULL, STRING_TOKEN (STR_DH_OUTPUT_DRIVER5B), gShellDriver1HiiHandle, ConvertHandleToHandleIndex (ParentControllerHandleBuffer[Index]), @@ -594,28 +594,28 @@ DisplayDriverModelHandle ( if (ChildControllerHandleCount == 0) { ShellPrintHiiEx( - -1, - -1, - NULL, - STRING_TOKEN (STR_DH_OUTPUT_DRIVER6), - gShellDriver1HiiHandle, + -1, + -1, + NULL, + STRING_TOKEN (STR_DH_OUTPUT_DRIVER6), + gShellDriver1HiiHandle, L"" ); } else { ShellPrintHiiEx( - -1, - -1, - NULL, - STRING_TOKEN (STR_DH_OUTPUT_DRIVER6), - gShellDriver1HiiHandle, + -1, + -1, + NULL, + STRING_TOKEN (STR_DH_OUTPUT_DRIVER6), + gShellDriver1HiiHandle, L"" ); for (Index = 0; Index < ChildControllerHandleCount; Index++) { Status = gEfiShellProtocol->GetDeviceName(ChildControllerHandleBuffer[Index], EFI_DEVICE_NAME_USE_COMPONENT_NAME|EFI_DEVICE_NAME_USE_DEVICE_PATH, (CHAR8*)Language, &TempStringPointer); ShellPrintHiiEx( - -1, - -1, - NULL, + -1, + -1, + NULL, STRING_TOKEN (STR_DH_OUTPUT_DRIVER6B), gShellDriver1HiiHandle, ConvertHandleToHandleIndex (ChildControllerHandleBuffer[Index]), @@ -675,9 +675,9 @@ DisplayDriverModelHandle ( } ShellPrintHiiEx( - -1, - -1, - NULL, + -1, + -1, + NULL, STRING_TOKEN (STR_DH_OUTPUT_DRIVER7), gShellDriver1HiiHandle, ConvertHandleToHandleIndex(Handle), @@ -692,9 +692,9 @@ DisplayDriverModelHandle ( DriverName = NULL; } ShellPrintHiiEx( - -1, - -1, - NULL, + -1, + -1, + NULL, STRING_TOKEN (STR_DH_OUTPUT_DRIVER7B), gShellDriver1HiiHandle, DriverName!=NULL?DriverName:L"" @@ -702,11 +702,11 @@ DisplayDriverModelHandle ( SHELL_FREE_NON_NULL(DriverName); ShellPrintHiiEx( - -1, - -1, - NULL, - STRING_TOKEN (STR_DH_OUTPUT_DRIVER8), - gShellDriver1HiiHandle, + -1, + -1, + NULL, + STRING_TOKEN (STR_DH_OUTPUT_DRIVER8), + gShellDriver1HiiHandle, DriverBinding->Version, NumberOfChildren > 0?L"Bus":ControllerHandleCount > 0?L"Device":L"", ConfigurationStatus?L"YES":L"NO", @@ -715,29 +715,29 @@ DisplayDriverModelHandle ( if (ControllerHandleCount == 0) { ShellPrintHiiEx( - -1, - -1, - NULL, + -1, + -1, + NULL, STRING_TOKEN (STR_DH_OUTPUT_DRIVER9), - gShellDriver1HiiHandle, + gShellDriver1HiiHandle, L"None" ); } else { ShellPrintHiiEx( - -1, - -1, - NULL, + -1, + -1, + NULL, STRING_TOKEN (STR_DH_OUTPUT_DRIVER9), - gShellDriver1HiiHandle, + gShellDriver1HiiHandle, L"" ); for (HandleIndex = 0; HandleIndex < ControllerHandleCount; HandleIndex++) { Status = gEfiShellProtocol->GetDeviceName(ControllerHandleBuffer[HandleIndex], EFI_DEVICE_NAME_USE_COMPONENT_NAME|EFI_DEVICE_NAME_USE_DEVICE_PATH, (CHAR8*)Language, &TempStringPointer); ShellPrintHiiEx( - -1, - -1, - NULL, + -1, + -1, + NULL, STRING_TOKEN (STR_DH_OUTPUT_DRIVER9B), gShellDriver1HiiHandle, ConvertHandleToHandleIndex(ControllerHandleBuffer[HandleIndex]), @@ -756,9 +756,9 @@ DisplayDriverModelHandle ( Status = gEfiShellProtocol->GetDeviceName(ChildControllerHandleBuffer[ChildIndex], EFI_DEVICE_NAME_USE_COMPONENT_NAME|EFI_DEVICE_NAME_USE_DEVICE_PATH, (CHAR8*)Language, &TempStringPointer); ShellPrintHiiEx( - -1, - -1, - NULL, + -1, + -1, + NULL, STRING_TOKEN (STR_DH_OUTPUT_DRIVER6C), gShellDriver1HiiHandle, ConvertHandleToHandleIndex(ChildControllerHandleBuffer[ChildIndex]), @@ -1109,7 +1109,7 @@ ShellCommandRunDh ( Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, L"dh", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, L"dh", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -1117,7 +1117,7 @@ ShellCommandRunDh ( } } else { if (ShellCommandLineGetCount(Package) > 2) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"dh"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"dh"); ShellCommandLineFreeVarList (Package); return (SHELL_INVALID_PARAMETER); } diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/Disconnect.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/Disconnect.c index 1fd7b196e6..c83f564a26 100644 --- a/ShellPkg/Library/UefiShellDriver1CommandsLib/Disconnect.c +++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/Disconnect.c @@ -3,7 +3,7 @@ (C) Copyright 2016 Hewlett Packard Enterprise Development LP
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -118,7 +118,7 @@ ShellCommandRunDisconnect ( Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, L"disconnect", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, L"disconnect", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -127,10 +127,10 @@ ShellCommandRunDisconnect ( } else { if (ShellCommandLineGetFlag(Package, L"-r")){ if (ShellCommandLineGetCount(Package) > 1){ - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"disconnect"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"disconnect"); ShellStatus = SHELL_INVALID_PARAMETER; } else if (ShellCommandLineGetCount(Package) < 1) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDriver1HiiHandle, L"disconnect"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDriver1HiiHandle, L"disconnect"); ShellStatus = SHELL_INVALID_PARAMETER; } else { Status = DisconnectAll (); @@ -151,10 +151,10 @@ ShellCommandRunDisconnect ( ShellStatus = SHELL_INVALID_PARAMETER; } else { if (ShellCommandLineGetCount(Package) > 4){ - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"disconnect"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"disconnect"); ShellStatus = SHELL_INVALID_PARAMETER; } else if (ShellCommandLineGetCount(Package) < 2) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDriver1HiiHandle, L"disconnect"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDriver1HiiHandle, L"disconnect"); ShellStatus = SHELL_INVALID_PARAMETER; } else { // @@ -171,17 +171,17 @@ ShellCommandRunDisconnect ( Handle3 = Param3!=NULL?ConvertHandleIndexToHandle((UINTN)Intermediate3):NULL; if (Param1 != NULL && Handle1 == NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"disconnect", Param1); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"disconnect", Param1); ShellStatus = SHELL_INVALID_PARAMETER; } else if (Param2 != NULL && Handle2 == NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"disconnect", Param2); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"disconnect", Param2); ShellStatus = SHELL_INVALID_PARAMETER; } else if (Param3 != NULL && Handle3 == NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"disconnect", Param3); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"disconnect", Param3); ShellStatus = SHELL_INVALID_PARAMETER; } else if (Handle2 != NULL && EFI_ERROR(gBS->OpenProtocol(Handle2, &gEfiDriverBindingProtocolGuid, NULL, gImageHandle, NULL, EFI_OPEN_PROTOCOL_TEST_PROTOCOL))) { ASSERT(Param2 != NULL); - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_HANDLE_NOT), gShellDriver1HiiHandle, L"disconnect", ShellStrToUintn(Param2), L"driver handle"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_HANDLE_NOT), gShellDriver1HiiHandle, L"disconnect", ShellStrToUintn(Param2), L"driver handle"); ShellStatus = SHELL_INVALID_PARAMETER; } else { ASSERT(Param1 != NULL); diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/Drivers.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/Drivers.c index 26b785c563..45ed6d0e7d 100644 --- a/ShellPkg/Library/UefiShellDriver1CommandsLib/Drivers.c +++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/Drivers.c @@ -2,7 +2,7 @@ Main file for Drivers shell Driver1 function. (C) Copyright 2012-2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -29,7 +29,7 @@ STATIC CONST SHELL_PARAM_ITEM ParamList[] = { @param[in] TheHandle The handle to get the device path for. @retval NULL An error occured. - @return A pointer to the driver path as a string. The callee must + @return A pointer to the driver path as a string. The callee must free this memory. **/ CHAR16* @@ -302,7 +302,7 @@ ShellCommandRunDrivers ( Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, L"drivers", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, L"drivers", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -310,7 +310,7 @@ ShellCommandRunDrivers ( } } else { if (ShellCommandLineGetCount(Package) > 1) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"drivers"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"drivers"); ShellStatus = SHELL_INVALID_PARAMETER; } else { if (ShellCommandLineGetFlag(Package, L"-l")){ @@ -320,7 +320,7 @@ ShellCommandRunDrivers ( AsciiSPrint(Language, StrSize(Lang), "%S", Lang); } else { ASSERT(Language == NULL); - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDriver1HiiHandle, L"drivers", L"-l"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDriver1HiiHandle, L"drivers", L"-l"); ShellCommandLineFreeVarList (Package); return (SHELL_INVALID_PARAMETER); } diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvCfg.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvCfg.c index 37501d4d3f..1bc2974797 100644 --- a/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvCfg.c +++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvCfg.c @@ -2,7 +2,7 @@ Main file for DrvCfg shell Driver1 function. (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -183,7 +183,7 @@ ConfigToFile( STRING_TOKEN(STR_GEN_FILE_OPEN_FAIL), gShellDriver1HiiHandle, L"drvcfg", - FileName, + FileName, Status); return (SHELL_DEVICE_ERROR); } @@ -199,13 +199,13 @@ ConfigToFile( if (EFI_ERROR(Status) || HiiDatabase == NULL) { ShellPrintHiiEx( - -1, - -1, + -1, + -1, NULL, - STRING_TOKEN(STR_GEN_PROTOCOL_NF), + STRING_TOKEN(STR_GEN_PROTOCOL_NF), gShellDriver1HiiHandle, L"drvcfg", - L"EfiHiiDatabaseProtocol", + L"EfiHiiDatabaseProtocol", &gEfiHiiDatabaseProtocolGuid); ShellCloseFile(&FileHandle); return (SHELL_NOT_FOUND); @@ -215,16 +215,16 @@ ConfigToFile( Status = ConvertHandleToHiiHandle(Handle, &HiiHandle, HiiDatabase); if (EFI_ERROR(Status)) { ShellPrintHiiEx( - -1, - -1, - NULL, - STRING_TOKEN(STR_GEN_HANDLE_NOT), + -1, + -1, + NULL, + STRING_TOKEN(STR_GEN_HANDLE_NOT), gShellDriver1HiiHandle, L"drvcfg", - ConvertHandleToHandleIndex(Handle), + ConvertHandleToHandleIndex(Handle), L"Device"); ShellCloseFile(&FileHandle); - return (SHELL_DEVICE_ERROR); + return (SHELL_DEVICE_ERROR); } Status = HiiDatabase->ExportPackageLists(HiiDatabase, HiiHandle, &MainBufferSize, MainBuffer); @@ -240,20 +240,20 @@ ConfigToFile( if (EFI_ERROR(Status)) { ShellPrintHiiEx( - -1, + -1, -1, NULL, - STRING_TOKEN(STR_FILE_WRITE_FAIL), + STRING_TOKEN(STR_FILE_WRITE_FAIL), gShellDriver1HiiHandle, L"drvcfg", FileName); - return (SHELL_DEVICE_ERROR); + return (SHELL_DEVICE_ERROR); } ShellPrintHiiEx( - -1, + -1, -1, NULL, - STRING_TOKEN(STR_DRVCFG_COMP), + STRING_TOKEN(STR_DRVCFG_COMP), gShellDriver1HiiHandle); return (SHELL_SUCCESS); @@ -296,9 +296,9 @@ ConfigFromFile( -1, NULL, STRING_TOKEN(STR_GEN_FILE_OPEN_FAIL), - gShellDriver1HiiHandle, + gShellDriver1HiiHandle, L"drvcfg", - FileName, + FileName, Status); return (SHELL_DEVICE_ERROR); } @@ -314,13 +314,13 @@ ConfigFromFile( if (EFI_ERROR(Status) || HiiDatabase == NULL) { ShellPrintHiiEx( - -1, - -1, + -1, + -1, NULL, - STRING_TOKEN(STR_GEN_PROTOCOL_NF), - gShellDriver1HiiHandle, + STRING_TOKEN(STR_GEN_PROTOCOL_NF), + gShellDriver1HiiHandle, L"drvcfg", - L"EfiHiiDatabaseProtocol", + L"EfiHiiDatabaseProtocol", &gEfiHiiDatabaseProtocolGuid); ShellCloseFile(&FileHandle); return (SHELL_NOT_FOUND); @@ -330,42 +330,42 @@ ConfigFromFile( MainBufferSize = (UINTN)Temp; if (EFI_ERROR(Status)) { ShellPrintHiiEx( - -1, - -1, - NULL, - STRING_TOKEN(STR_FILE_READ_FAIL), + -1, + -1, + NULL, + STRING_TOKEN(STR_FILE_READ_FAIL), gShellDriver1HiiHandle, L"drvcfg", FileName); ShellCloseFile(&FileHandle); - return (SHELL_DEVICE_ERROR); + return (SHELL_DEVICE_ERROR); } - MainBuffer = AllocateZeroPool((UINTN)MainBufferSize); + MainBuffer = AllocateZeroPool((UINTN)MainBufferSize); if (EFI_ERROR(Status)) { ShellPrintHiiEx( - -1, - -1, - NULL, - STRING_TOKEN(STR_GEN_OUT_MEM), + -1, + -1, + NULL, + STRING_TOKEN(STR_GEN_OUT_MEM), gShellDriver1HiiHandle, L"drvcfg"); ShellCloseFile(&FileHandle); - return (SHELL_DEVICE_ERROR); + return (SHELL_DEVICE_ERROR); } Status = ShellReadFile(FileHandle, &MainBufferSize, MainBuffer); if (EFI_ERROR(Status)) { ShellPrintHiiEx( - -1, - -1, - NULL, - STRING_TOKEN(STR_FILE_READ_FAIL), - gShellDriver1HiiHandle, + -1, + -1, + NULL, + STRING_TOKEN(STR_FILE_READ_FAIL), + gShellDriver1HiiHandle, L"drvcfg", FileName); ShellCloseFile(&FileHandle); SHELL_FREE_NON_NULL(MainBuffer); - return (SHELL_DEVICE_ERROR); + return (SHELL_DEVICE_ERROR); } ShellCloseFile(&FileHandle); @@ -378,28 +378,28 @@ ConfigFromFile( Status = ConvertHandleToHiiHandle(Handle, &HiiHandle, HiiDatabase); if (EFI_ERROR(Status)) { ShellPrintHiiEx( - -1, - -1, - NULL, - STRING_TOKEN(STR_GEN_HANDLE_NOT), + -1, + -1, + NULL, + STRING_TOKEN(STR_GEN_HANDLE_NOT), gShellDriver1HiiHandle, L"drvcfg", - ConvertHandleToHandleIndex(Handle), + ConvertHandleToHandleIndex(Handle), L"Device"); ShellCloseFile(&FileHandle); - return (SHELL_DEVICE_ERROR); + return (SHELL_DEVICE_ERROR); } Status = HiiDatabase->UpdatePackageList(HiiDatabase, HiiHandle, MainBuffer); if (EFI_ERROR(Status)) { ShellPrintHiiEx( - -1, - -1, - NULL, + -1, + -1, + NULL, STRING_TOKEN(STR_GEN_UEFI_FUNC_WARN), gShellDriver1HiiHandle, L"drvcfg", - L"HiiDatabase->UpdatePackageList", + L"HiiDatabase->UpdatePackageList", Status); - return (SHELL_DEVICE_ERROR); + return (SHELL_DEVICE_ERROR); } } else { // @@ -421,24 +421,24 @@ ConfigFromFile( // TempDevPathString = ConvertDevicePathToText((EFI_DEVICE_PATH_PROTOCOL*)(((CHAR8*)PackageHeader) + sizeof(EFI_HII_PACKAGE_HEADER)), TRUE, TRUE); ShellPrintHiiEx( - -1, - -1, - NULL, - STRING_TOKEN(STR_DRVCFG_IN_FILE_NF), - gShellDriver1HiiHandle, + -1, + -1, + NULL, + STRING_TOKEN(STR_DRVCFG_IN_FILE_NF), + gShellDriver1HiiHandle, TempDevPathString); SHELL_FREE_NON_NULL(TempDevPathString); } else { Status = HiiDatabase->UpdatePackageList(HiiDatabase, HiiHandle, PackageListHeader); if (EFI_ERROR(Status)) { ShellPrintHiiEx( - -1, - -1, - NULL, + -1, + -1, + NULL, STRING_TOKEN(STR_GEN_UEFI_FUNC_WARN), - gShellDriver1HiiHandle, + gShellDriver1HiiHandle, L"drvcfg", - L"HiiDatabase->UpdatePackageList", + L"HiiDatabase->UpdatePackageList", Status); return (SHELL_DEVICE_ERROR); } else { @@ -446,14 +446,14 @@ ConfigFromFile( gBS->LocateDevicePath(&gEfiHiiConfigAccessProtocolGuid, &DevPath, &Handle); HandleIndex = ConvertHandleToHandleIndex(Handle); ShellPrintHiiEx( - -1, - -1, - NULL, - STRING_TOKEN(STR_DRVCFG_DONE_HII), - gShellDriver1HiiHandle, + -1, + -1, + NULL, + STRING_TOKEN(STR_DRVCFG_DONE_HII), + gShellDriver1HiiHandle, HandleIndex); } - } + } } } } @@ -463,10 +463,10 @@ ConfigFromFile( ShellPrintHiiEx( - -1, + -1, -1, NULL, - STRING_TOKEN(STR_DRVCFG_COMP), + STRING_TOKEN(STR_DRVCFG_COMP), gShellDriver1HiiHandle); return (SHELL_SUCCESS); } @@ -593,22 +593,22 @@ PreHiiDrvCfg ( -1, -1, NULL, - STRING_TOKEN (STR_DRVCFG_FORCE_D), - gShellDriver1HiiHandle, + STRING_TOKEN (STR_DRVCFG_FORCE_D), + gShellDriver1HiiHandle, DefaultType); } else if (ValidateOptions) { ShellPrintHiiEx( -1, -1, NULL, - STRING_TOKEN (STR_DRVCFG_VALIDATE), + STRING_TOKEN (STR_DRVCFG_VALIDATE), gShellDriver1HiiHandle); } else if (SetOptions) { ShellPrintHiiEx( -1, -1, NULL, - STRING_TOKEN (STR_DRVCFG_SET), + STRING_TOKEN (STR_DRVCFG_SET), gShellDriver1HiiHandle); } @@ -619,8 +619,8 @@ PreHiiDrvCfg ( goto Done; } for ( - HandleBuffer = DriverImageHandleBuffer, DriverImageHandleCount = 0 - ; HandleBuffer != NULL && *HandleBuffer != NULL + HandleBuffer = DriverImageHandleBuffer, DriverImageHandleCount = 0 + ; HandleBuffer != NULL && *HandleBuffer != NULL ; HandleBuffer++,DriverImageHandleCount++); } else { DriverImageHandleCount = 1; @@ -666,7 +666,7 @@ PreHiiDrvCfg ( ShellStatus = SHELL_UNSUPPORTED; continue; } - + BestLanguage = GetBestLanguage ( DriverConfiguration->SupportedLanguages, Iso639Language, @@ -725,7 +725,7 @@ PreHiiDrvCfg ( -1, -1, NULL, - STRING_TOKEN (STR_DRVCFG_OPTIONS_SET), + STRING_TOKEN (STR_DRVCFG_OPTIONS_SET), gShellDriver1HiiHandle); for (LoopCounter = 0; LoopCounter < HandleCount; LoopCounter++) { if ((HandleType[LoopCounter] & HR_CONTROLLER_HANDLE) == HR_CONTROLLER_HANDLE) { @@ -742,8 +742,8 @@ PreHiiDrvCfg ( -1, -1, NULL, - STRING_TOKEN (STR_DRVCFG_NOT_SET), - gShellDriver1HiiHandle, + STRING_TOKEN (STR_DRVCFG_NOT_SET), + gShellDriver1HiiHandle, Status); } continue; @@ -784,7 +784,7 @@ PreHiiDrvCfg ( -1, -1, NULL, - STRING_TOKEN (STR_DRVCFG_DEF_FORCED), + STRING_TOKEN (STR_DRVCFG_DEF_FORCED), gShellDriver1HiiHandle); ShellCmdDriverConfigurationProcessActionRequired ( DriverImageHandleBuffer[OuterLoopCounter], @@ -797,8 +797,8 @@ PreHiiDrvCfg ( -1, -1, NULL, - STRING_TOKEN (STR_DRVCFG_FORCE_FAILED), - gShellDriver1HiiHandle, + STRING_TOKEN (STR_DRVCFG_FORCE_FAILED), + gShellDriver1HiiHandle, Status); ShellStatus = SHELL_DEVICE_ERROR; } @@ -814,15 +814,15 @@ PreHiiDrvCfg ( -1, -1, NULL, - STRING_TOKEN (STR_DRVCFG_OPTIONS_VALID), + STRING_TOKEN (STR_DRVCFG_OPTIONS_VALID), gShellDriver1HiiHandle); } else { ShellPrintHiiEx( -1, -1, NULL, - STRING_TOKEN (STR_DRVCFG_OPTIONS_INV), - gShellDriver1HiiHandle, + STRING_TOKEN (STR_DRVCFG_OPTIONS_INV), + gShellDriver1HiiHandle, Status); ShellStatus = SHELL_DEVICE_ERROR; } @@ -853,7 +853,7 @@ PreHiiDrvCfg ( -1, -1, NULL, - STRING_TOKEN (STR_DRVCFG_OPTIONS_SET), + STRING_TOKEN (STR_DRVCFG_OPTIONS_SET), gShellDriver1HiiHandle); ShellCmdDriverConfigurationProcessActionRequired ( @@ -868,8 +868,8 @@ PreHiiDrvCfg ( -1, -1, NULL, - STRING_TOKEN (STR_DRVCFG_NOT_SET), - gShellDriver1HiiHandle, + STRING_TOKEN (STR_DRVCFG_NOT_SET), + gShellDriver1HiiHandle, Status); ShellStatus = SHELL_DEVICE_ERROR; } @@ -931,7 +931,7 @@ PreHiiDrvCfg ( -1, -1, NULL, - STRING_TOKEN (STR_DRVCFG_DEF_FORCED), + STRING_TOKEN (STR_DRVCFG_DEF_FORCED), gShellDriver1HiiHandle); ShellCmdDriverConfigurationProcessActionRequired ( @@ -946,8 +946,8 @@ PreHiiDrvCfg ( -1, -1, NULL, - STRING_TOKEN (STR_DRVCFG_FORCE_FAILED), - gShellDriver1HiiHandle, + STRING_TOKEN (STR_DRVCFG_FORCE_FAILED), + gShellDriver1HiiHandle, Status); ShellStatus = SHELL_DEVICE_ERROR; } @@ -963,15 +963,15 @@ PreHiiDrvCfg ( -1, -1, NULL, - STRING_TOKEN (STR_DRVCFG_OPTIONS_VALID), + STRING_TOKEN (STR_DRVCFG_OPTIONS_VALID), gShellDriver1HiiHandle); } else { ShellPrintHiiEx( -1, -1, NULL, - STRING_TOKEN (STR_DRVCFG_OPTIONS_INV), - gShellDriver1HiiHandle, + STRING_TOKEN (STR_DRVCFG_OPTIONS_INV), + gShellDriver1HiiHandle, Status); ShellStatus = SHELL_DEVICE_ERROR; } @@ -1004,7 +1004,7 @@ PreHiiDrvCfg ( -1, -1, NULL, - STRING_TOKEN (STR_DRVCFG_OPTIONS_SET), + STRING_TOKEN (STR_DRVCFG_OPTIONS_SET), gShellDriver1HiiHandle); ShellCmdDriverConfigurationProcessActionRequired ( @@ -1019,8 +1019,8 @@ PreHiiDrvCfg ( -1, -1, NULL, - STRING_TOKEN (STR_DRVCFG_NOT_SET), - gShellDriver1HiiHandle, + STRING_TOKEN (STR_DRVCFG_NOT_SET), + gShellDriver1HiiHandle, Status); ShellStatus = SHELL_DEVICE_ERROR; } @@ -1081,11 +1081,11 @@ PrintConfigInfoOnAll( Found = TRUE; Index2 = *CurrentHandle == NULL ? 0 : ConvertHandleToHandleIndex(*CurrentHandle); ShellPrintHiiEx( - -1, - -1, - NULL, - STRING_TOKEN (STR_DRVCFG_LINE_HII), - gShellDriver1HiiHandle, + -1, + -1, + NULL, + STRING_TOKEN (STR_DRVCFG_LINE_HII), + gShellDriver1HiiHandle, Index2 ); } @@ -1203,7 +1203,7 @@ ShellCommandRunDrvCfg ( ASSERT(FALSE); } } - } + } if (ShellStatus == SHELL_SUCCESS) { if (ShellCommandLineGetCount(Package) > 4) { ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"drvcfg"); @@ -1236,24 +1236,24 @@ ShellCommandRunDrvCfg ( } if (InFromFile && EFI_ERROR(ShellFileExists(FileName))) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FIND_FAIL), gShellDriver1HiiHandle, L"drvcfg", FileName); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FIND_FAIL), gShellDriver1HiiHandle, L"drvcfg", FileName); ShellStatus = SHELL_INVALID_PARAMETER; - goto Done; + goto Done; } if (OutToFile && !EFI_ERROR(ShellFileExists(FileName))) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_EXIST), gShellDriver1HiiHandle, L"drvcfg", FileName); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_EXIST), gShellDriver1HiiHandle, L"drvcfg", FileName); ShellStatus = SHELL_INVALID_PARAMETER; - goto Done; + goto Done; } if (Force && ForceTypeString == NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDriver1HiiHandle, L"drvcfg", L"-f"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDriver1HiiHandle, L"drvcfg", L"-f"); ShellStatus = SHELL_INVALID_PARAMETER; goto Done; - } + } if (Force) { Status = ShellConvertStringToUint64(ForceTypeString, &Intermediate, FALSE, FALSE); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM_VAL), gShellDriver1HiiHandle, L"drvcfg", ForceTypeString, L"-f"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM_VAL), gShellDriver1HiiHandle, L"drvcfg", ForceTypeString, L"-f"); ShellStatus = SHELL_INVALID_PARAMETER; goto Done; } @@ -1266,7 +1266,7 @@ ShellCommandRunDrvCfg ( if (HandleIndex1 != NULL && !EFI_ERROR(ShellConvertStringToUint64(HandleIndex1, &Intermediate, TRUE, FALSE))) { Handle1 = ConvertHandleIndexToHandle((UINTN)Intermediate); if (Handle1 == NULL || (UINT64)(UINTN)Intermediate != Intermediate) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"drvcfg", HandleIndex1); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"drvcfg", HandleIndex1); ShellStatus = SHELL_INVALID_PARAMETER; goto Done; } @@ -1276,7 +1276,7 @@ ShellCommandRunDrvCfg ( if (HandleIndex2 != NULL && !EFI_ERROR(ShellConvertStringToUint64(HandleIndex2, &Intermediate, TRUE, FALSE))) { Handle2 = ConvertHandleIndexToHandle((UINTN)Intermediate); if (Handle2 == NULL || (UINT64)(UINTN)Intermediate != Intermediate) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"drvcfg", HandleIndex2); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"drvcfg", HandleIndex2); ShellStatus = SHELL_INVALID_PARAMETER; goto Done; } @@ -1286,7 +1286,7 @@ ShellCommandRunDrvCfg ( if (HandleIndex3 != NULL && !EFI_ERROR(ShellConvertStringToUint64(HandleIndex3, &Intermediate, TRUE, FALSE))) { Handle3 = ConvertHandleIndexToHandle((UINTN)Intermediate); if (Handle3 == NULL || (UINT64)(UINTN)Intermediate != Intermediate) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"drvcfg", HandleIndex3); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"drvcfg", HandleIndex3); ShellStatus = SHELL_INVALID_PARAMETER; goto Done; } @@ -1294,42 +1294,42 @@ ShellCommandRunDrvCfg ( if ((InFromFile || OutToFile) && (FileName == NULL)) { if (FileName == NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDriver1HiiHandle, L"drvcfg", InFromFile?L"-i":L"-o"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDriver1HiiHandle, L"drvcfg", InFromFile?L"-i":L"-o"); } else { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_HANDLE_REQ), gShellDriver1HiiHandle, L"drvcfg"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_HANDLE_REQ), gShellDriver1HiiHandle, L"drvcfg"); } ShellStatus = SHELL_INVALID_PARAMETER; goto Done; } if (!UseHii && (InFromFile || OutToFile)) { if (InFromFile) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDriver1HiiHandle, L"drvcfg", L"-i"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDriver1HiiHandle, L"drvcfg", L"-i"); ShellStatus = SHELL_INVALID_PARAMETER; goto Done; - } + } if (OutToFile) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDriver1HiiHandle, L"drvcfg", L"-o"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDriver1HiiHandle, L"drvcfg", L"-o"); ShellStatus = SHELL_INVALID_PARAMETER; goto Done; } } if (Validate && Force) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDriver1HiiHandle, L"drvcfg", L"-v", L"-f"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDriver1HiiHandle, L"drvcfg", L"-v", L"-f"); ShellStatus = SHELL_INVALID_PARAMETER; goto Done; - } + } if (Validate && Set) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDriver1HiiHandle, L"drvcfg", L"-v", L"-s"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDriver1HiiHandle, L"drvcfg", L"-v", L"-s"); ShellStatus = SHELL_INVALID_PARAMETER; goto Done; - } + } if (Set && Force) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDriver1HiiHandle, L"drvcfg", L"-s", L"-f"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDriver1HiiHandle, L"drvcfg", L"-s", L"-f"); ShellStatus = SHELL_INVALID_PARAMETER; goto Done; } if (OutToFile && InFromFile) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDriver1HiiHandle, L"drvcfg", L"-i", L"-o"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDriver1HiiHandle, L"drvcfg", L"-i", L"-o"); ShellStatus = SHELL_INVALID_PARAMETER; goto Done; } @@ -1365,11 +1365,11 @@ ShellCommandRunDrvCfg ( } else { if (!EFI_ERROR(gBS->OpenProtocol(Handle1, &gEfiHiiConfigAccessProtocolGuid, NULL, gImageHandle, NULL, EFI_OPEN_PROTOCOL_TEST_PROTOCOL))) { ShellPrintHiiEx( - -1, - -1, - NULL, - STRING_TOKEN (STR_DRVCFG_LINE_HII), - gShellDriver1HiiHandle, + -1, + -1, + NULL, + STRING_TOKEN (STR_DRVCFG_LINE_HII), + gShellDriver1HiiHandle, ConvertHandleToHandleIndex(Handle1) ); goto Done; @@ -1399,7 +1399,7 @@ ShellCommandRunDrvCfg ( -1, NULL, STRING_TOKEN (STR_DRVCFG_NOT_SUPPORT), - gShellDriver1HiiHandle, + gShellDriver1HiiHandle, ConvertHandleToHandleIndex(Handle1) ); } diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvDiag.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvDiag.c index cc1099f68f..b42e8c7bb2 100644 --- a/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvDiag.c +++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvDiag.c @@ -2,7 +2,7 @@ Main file for DrvDiag shell Driver1 function. (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -101,10 +101,10 @@ DoDiagnostics ( } else { DriverHandleList = GetHandleListByProtocolList(DiagGuidList); if (DriverHandleList == NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROTOCOL_NF), gShellDriver1HiiHandle, L"drvdiag", L"gEfiDriverDiagnosticsProtocolGuid", &gEfiDriverDiagnosticsProtocolGuid); - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROTOCOL_NF), gShellDriver1HiiHandle, L"drvdiag", L"gEfiDriverDiagnostics2ProtocolGuid", &gEfiDriverDiagnostics2ProtocolGuid); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROTOCOL_NF), gShellDriver1HiiHandle, L"drvdiag", L"gEfiDriverDiagnosticsProtocolGuid", &gEfiDriverDiagnosticsProtocolGuid); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROTOCOL_NF), gShellDriver1HiiHandle, L"drvdiag", L"gEfiDriverDiagnostics2ProtocolGuid", &gEfiDriverDiagnostics2ProtocolGuid); return (EFI_NOT_FOUND); - } + } for (Walker = DriverHandleList ; Walker != NULL && *Walker != NULL ; DriverHandleListCount++, Walker++); } @@ -150,7 +150,7 @@ DoDiagnostics ( } if (ControllerHandle == NULL) { PARSE_HANDLE_DATABASE_DEVICES(DriverHandleList[DriverHandleListLoop], &ControllerHandleListCount, &ControllerHandleList); - } + } if (ControllerHandleListCount == 0) { if (Mode == TestModeList) { ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DRVDIAG_DRIVER_NO_HANDLES), gShellDriver1HiiHandle); @@ -166,7 +166,7 @@ DoDiagnostics ( if (AllChilds) { ASSERT(ChildHandleList == NULL); PARSE_HANDLE_DATABASE_MANAGED_CHILDREN( - DriverHandleList[DriverHandleListLoop], + DriverHandleList[DriverHandleListLoop], ControllerHandleList[ControllerHandleListLoop], &ChildHandleListCount, &ChildHandleList); @@ -202,7 +202,7 @@ DoDiagnostics ( &OutBuffer); FreePool(Language); } - } + } if (!Found && (Lang == NULL||(Lang!=NULL&&(Lang[2]!='-')))){ Status = gBS->OpenProtocol( DriverHandleList[DriverHandleListLoop], @@ -357,7 +357,7 @@ ShellCommandRunDrvDiag ( Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, L"drvdiag", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, L"drvdiag", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -375,7 +375,7 @@ ShellCommandRunDrvDiag ( // // error for too many parameters // - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"drvdiag"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"drvdiag"); ShellStatus = SHELL_INVALID_PARAMETER; } else if ((ShellCommandLineGetFlag(Package, L"-s")) || (ShellCommandLineGetFlag(Package, L"-e")) @@ -403,7 +403,7 @@ ShellCommandRunDrvDiag ( Lang = ShellCommandLineGetValue(Package, L"-l"); if (ShellCommandLineGetFlag(Package, L"-l") && Lang == NULL) { ASSERT(Language == NULL); - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDriver1HiiHandle, L"drvdiag", L"-l"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDriver1HiiHandle, L"drvdiag", L"-l"); ShellCommandLineFreeVarList (Package); return (SHELL_INVALID_PARAMETER); } else if (Lang != NULL) { @@ -438,8 +438,8 @@ ShellCommandRunDrvDiag ( Mode, Language, ShellCommandLineGetFlag(Package, L"-c"), - Handle1, - Handle2, + Handle1, + Handle2, Handle3 ); diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/OpenInfo.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/OpenInfo.c index 2a1748c514..7c817a47c8 100644 --- a/ShellPkg/Library/UefiShellDriver1CommandsLib/OpenInfo.c +++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/OpenInfo.c @@ -2,7 +2,7 @@ Main file for OpenInfo shell Driver1 function. (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -126,7 +126,7 @@ TraverseHandleDatabase ( OpenInfo[OpenInfoIndex].OpenCount, OpenTypeString, Name - ); + ); } } FreePool (OpenInfo); @@ -176,7 +176,7 @@ ShellCommandRunOpenInfo ( Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, L"openinfo", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, L"openinfo", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -187,16 +187,16 @@ ShellCommandRunOpenInfo ( // // error for too many parameters // - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"openinfo"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"openinfo"); ShellStatus = SHELL_INVALID_PARAMETER; } else if (ShellCommandLineGetCount(Package) == 0) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDriver1HiiHandle, L"openinfo"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDriver1HiiHandle, L"openinfo"); ShellStatus = SHELL_INVALID_PARAMETER; } else { Param1 = ShellCommandLineGetRawValue(Package, 1); Status = ShellConvertStringToUint64(Param1, &Intermediate, TRUE, FALSE); if (EFI_ERROR(Status) || Param1 == NULL || ConvertHandleIndexToHandle((UINTN)Intermediate) == NULL){ - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"openinfo", Param1); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"openinfo", Param1); ShellStatus = SHELL_INVALID_PARAMETER; } else { TheHandle = ConvertHandleIndexToHandle((UINTN)Intermediate); @@ -206,7 +206,7 @@ ShellCommandRunOpenInfo ( Status = TraverseHandleDatabase (TheHandle); if (!EFI_ERROR(Status)) { } else { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"openinfo", Param1); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"openinfo", Param1); ShellStatus = SHELL_NOT_FOUND; } } diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/Reconnect.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/Reconnect.c index d2ae8e8271..67de000c6f 100644 --- a/ShellPkg/Library/UefiShellDriver1CommandsLib/Reconnect.c +++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/Reconnect.c @@ -1,9 +1,9 @@ /** @file Main file for Reconnect shell Driver1 function. - Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.
- (C) Copyright 2015 Hewlett Packard Enterprise Development LP
+ (C) Copyright 2015 Hewlett Packard Enterprise Development LP
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -29,11 +29,11 @@ VOID ConnectAllConsoles ( VOID ) -{ +{ ShellConnectFromDevPaths(L"ConInDev"); ShellConnectFromDevPaths(L"ConOutDev"); ShellConnectFromDevPaths(L"ErrOutDev"); - + ShellConnectFromDevPaths(L"ErrOut"); ShellConnectFromDevPaths(L"ConIn"); ShellConnectFromDevPaths(L"ConOut"); @@ -60,7 +60,7 @@ ShellCommandRunReconnect ( gInReconnect = TRUE; ShellStatus = SHELL_SUCCESS; - + // // initialize the shell lib (we must be in non-auto-init...) // @@ -90,7 +90,7 @@ ShellCommandRunReconnect ( } ShellStatus = ShellCommandRunConnect(ImageHandle, SystemTable); } - } + } gInReconnect = FALSE; diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.uni b/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.uni index 0120e4e065..d382021e95 100644 --- a/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.uni +++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.uni @@ -2,7 +2,7 @@ // // (C) Copyright 2016-2017 Hewlett Packard Enterprise Development LP
// (C) Copyright 2012-2015 Hewlett-Packard Development Company, L.P.
-// Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
+// Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
// This program and the accompanying materials // are licensed and made available under the terms and conditions of the BSD License // which accompanies this distribution. The full text of the license may be found at @@ -469,7 +469,7 @@ " CTRL - The handle number of the UEFI device\r\n" " TYPE - The device type:\r\n" " [R] - Root Controller\r\n" -" [B] - Bus Controller\r\n" +" [B] - Bus Controller\r\n" " [D] - Device Controller\r\n" " CFG - A managing driver supports the Driver Configuration\r\n" " Protocol. Yes if 'Y' or 'X'; No if 'N' or '-'.\r\n" @@ -522,7 +522,7 @@ " 6. If only a single handle is specified and the handle has an\r\n" " EFI_DRIVER_BINDING_PROTOCOL on it, then the handle is assumed to be a\r\n" " driver handle. Otherwise, it is assumed to be a device handle.\r\n" -" 7. If no parameters are specified, then the command will attempt to bind\r\n" +" 7. If no parameters are specified, then the command will attempt to bind\r\n" " all proper drivers to all devices without recursion. Each connection\r\n" " status will be displayed.\r\n" " 8. Output redirection is not supported for 'connect -r' usage.\r\n" diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/Unload.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/Unload.c index b5f085a750..64cb60ea1f 100644 --- a/ShellPkg/Library/UefiShellDriver1CommandsLib/Unload.c +++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/Unload.c @@ -2,7 +2,7 @@ Main file for Unload shell Driver1 function. (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -31,11 +31,11 @@ DumpLoadedImageProtocolInfo ( CHAR16 *TheString; TheString = GetProtocolInformationDump(TheHandle, &gEfiLoadedImageProtocolGuid, TRUE); - + ShellPrintEx(-1, -1, L"%s", TheString); SHELL_FREE_NON_NULL(TheString); - + return (EFI_SUCCESS); } @@ -86,7 +86,7 @@ ShellCommandRunUnload ( Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle,L"unload", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle,L"unload", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -97,10 +97,10 @@ ShellCommandRunUnload ( // // error for too many parameters // - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"unload"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"unload"); ShellStatus = SHELL_INVALID_PARAMETER; } else if (ShellCommandLineGetCount(Package) < 2) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDriver1HiiHandle, L"unload"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDriver1HiiHandle, L"unload"); ShellStatus = SHELL_INVALID_PARAMETER; } else { Param1 = ShellCommandLineGetRawValue(Package, 1); @@ -110,14 +110,14 @@ ShellCommandRunUnload ( } if (EFI_ERROR(Status) || Param1 == NULL || TheHandle == NULL){ - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"unload", Param1); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"unload", Param1); ShellStatus = SHELL_INVALID_PARAMETER; } else { ASSERT(TheHandle != NULL); if (ShellCommandLineGetFlag(Package, L"-v") || ShellCommandLineGetFlag(Package, L"-verbose")) { DumpLoadedImageProtocolInfo(TheHandle); } - + if (!ShellCommandLineGetFlag(Package, L"-n")) { Status = ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_UNLOAD_CONF), gShellDriver1HiiHandle, (UINTN)TheHandle); Status = ShellPromptForResponse(ShellPromptResponseTypeYesNo, NULL, (VOID**)&Resp); diff --git a/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf b/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf index dc1b6223e7..06bcf358fa 100644 --- a/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf +++ b/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf @@ -1,7 +1,7 @@ ## @file # Provides shell install1 functions # -# Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.
+# Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -48,4 +48,4 @@ gEfiShellPkgTokenSpaceGuid.PcdShellProfileMask ## CONSUMES [Guids] - gShellInstall1HiiGuid ## UNDEFINED + gShellInstall1HiiGuid ## UNDEFINED diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/For.c b/ShellPkg/Library/UefiShellLevel1CommandsLib/For.c index 9824977149..8da07825f6 100644 --- a/ShellPkg/Library/UefiShellLevel1CommandsLib/For.c +++ b/ShellPkg/Library/UefiShellLevel1CommandsLib/For.c @@ -89,13 +89,13 @@ ShellCommandRunEndFor ( if (!Found) { CurrentScriptFile = ShellCommandGetCurrentScriptFile(); ShellPrintHiiEx( - -1, - -1, - NULL, - STRING_TOKEN (STR_SYNTAX_NO_MATCHING), - gShellLevel1HiiHandle, - L"For", - L"EndFor", + -1, + -1, + NULL, + STRING_TOKEN (STR_SYNTAX_NO_MATCHING), + gShellLevel1HiiHandle, + L"For", + L"EndFor", CurrentScriptFile!=NULL && CurrentScriptFile->CurrentCommand!=NULL ? CurrentScriptFile->CurrentCommand->Line:0); @@ -339,13 +339,13 @@ ShellCommandRunFor ( // if (!MoveToTag(GetNextNode, L"endfor", L"for", NULL, CurrentScriptFile, TRUE, TRUE, FALSE)) { ShellPrintHiiEx( - -1, - -1, - NULL, - STRING_TOKEN (STR_SYNTAX_NO_MATCHING), - gShellLevel1HiiHandle, - L"EndFor", - L"For", + -1, + -1, + NULL, + STRING_TOKEN (STR_SYNTAX_NO_MATCHING), + gShellLevel1HiiHandle, + L"EndFor", + L"For", CurrentScriptFile->CurrentCommand->Line); return (SHELL_DEVICE_ERROR); } @@ -467,12 +467,12 @@ ShellCommandRunFor ( ArgSetWalker = ArgSet; if (ArgSetWalker[0] != L'(') { ShellPrintHiiEx( - -1, - -1, - NULL, - STRING_TOKEN (STR_GEN_PROBLEM_SCRIPT), - gShellLevel1HiiHandle, - ArgSet, + -1, + -1, + NULL, + STRING_TOKEN (STR_GEN_PROBLEM_SCRIPT), + gShellLevel1HiiHandle, + ArgSet, CurrentScriptFile->CurrentCommand->Line); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -490,11 +490,11 @@ ShellCommandRunFor ( } if (TempSpot == NULL) { ShellPrintHiiEx( - -1, - -1, - NULL, - STRING_TOKEN (STR_GEN_PROBLEM_SCRIPT), - gShellLevel1HiiHandle, + -1, + -1, + NULL, + STRING_TOKEN (STR_GEN_PROBLEM_SCRIPT), + gShellLevel1HiiHandle, CurrentScriptFile->CurrentCommand->Line); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -505,12 +505,12 @@ ShellCommandRunFor ( } if (!ShellIsValidForNumber(ArgSetWalker)) { ShellPrintHiiEx( - -1, - -1, - NULL, - STRING_TOKEN (STR_GEN_PROBLEM_SCRIPT), - gShellLevel1HiiHandle, - ArgSet, + -1, + -1, + NULL, + STRING_TOKEN (STR_GEN_PROBLEM_SCRIPT), + gShellLevel1HiiHandle, + ArgSet, CurrentScriptFile->CurrentCommand->Line); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -525,12 +525,12 @@ ShellCommandRunFor ( } if (ArgSetWalker == NULL || *ArgSetWalker == CHAR_NULL || !ShellIsValidForNumber(ArgSetWalker)){ ShellPrintHiiEx( - -1, - -1, - NULL, - STRING_TOKEN (STR_GEN_PROBLEM_SCRIPT), - gShellLevel1HiiHandle, - ArgSet, + -1, + -1, + NULL, + STRING_TOKEN (STR_GEN_PROBLEM_SCRIPT), + gShellLevel1HiiHandle, + ArgSet, CurrentScriptFile->CurrentCommand->Line); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -552,12 +552,12 @@ ShellCommandRunFor ( if (ArgSetWalker != NULL && *ArgSetWalker != CHAR_NULL) { if (ArgSetWalker == NULL || *ArgSetWalker == CHAR_NULL || !ShellIsValidForNumber(ArgSetWalker)){ ShellPrintHiiEx( - -1, - -1, - NULL, - STRING_TOKEN (STR_GEN_PROBLEM_SCRIPT), - gShellLevel1HiiHandle, - ArgSet, + -1, + -1, + NULL, + STRING_TOKEN (STR_GEN_PROBLEM_SCRIPT), + gShellLevel1HiiHandle, + ArgSet, CurrentScriptFile->CurrentCommand->Line); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -572,18 +572,18 @@ ShellCommandRunFor ( if (StrStr(ArgSetWalker, L" ") != NULL) { ShellPrintHiiEx( - -1, - -1, - NULL, - STRING_TOKEN (STR_GEN_PROBLEM_SCRIPT), - gShellLevel1HiiHandle, - ArgSet, + -1, + -1, + NULL, + STRING_TOKEN (STR_GEN_PROBLEM_SCRIPT), + gShellLevel1HiiHandle, + ArgSet, CurrentScriptFile->CurrentCommand->Line); ShellStatus = SHELL_INVALID_PARAMETER; } } } - + } } } @@ -602,13 +602,13 @@ ShellCommandRunFor ( } } else { ShellPrintHiiEx( - -1, - -1, - NULL, - STRING_TOKEN (STR_GEN_PROBLEM_SCRIPT), - gShellLevel1HiiHandle, - ArgSet, - CurrentScriptFile!=NULL + -1, + -1, + NULL, + STRING_TOKEN (STR_GEN_PROBLEM_SCRIPT), + gShellLevel1HiiHandle, + ArgSet, + CurrentScriptFile!=NULL && CurrentScriptFile->CurrentCommand!=NULL ? CurrentScriptFile->CurrentCommand->Line:0); ShellStatus = SHELL_INVALID_PARAMETER; @@ -659,14 +659,14 @@ ShellCommandRunFor ( // if (!MoveToTag(GetNextNode, L"endfor", L"for", NULL, CurrentScriptFile, TRUE, FALSE, FALSE)) { ShellPrintHiiEx( - -1, - -1, - NULL, - STRING_TOKEN (STR_SYNTAX_NO_MATCHING), - gShellLevel1HiiHandle, - L"EndFor", - L"For", - CurrentScriptFile!=NULL + -1, + -1, + NULL, + STRING_TOKEN (STR_SYNTAX_NO_MATCHING), + gShellLevel1HiiHandle, + L"EndFor", + L"For", + CurrentScriptFile!=NULL && CurrentScriptFile->CurrentCommand!=NULL ? CurrentScriptFile->CurrentCommand->Line:0); ShellStatus = SHELL_DEVICE_ERROR; @@ -721,14 +721,14 @@ ShellCommandRunFor ( // if (!MoveToTag(GetNextNode, L"endfor", L"for", NULL, CurrentScriptFile, TRUE, FALSE, FALSE)) { ShellPrintHiiEx( - -1, - -1, - NULL, - STRING_TOKEN (STR_SYNTAX_NO_MATCHING), - gShellLevel1HiiHandle, - L"EndFor", - L"For", - CurrentScriptFile!=NULL + -1, + -1, + NULL, + STRING_TOKEN (STR_SYNTAX_NO_MATCHING), + gShellLevel1HiiHandle, + L"EndFor", + L"For", + CurrentScriptFile!=NULL && CurrentScriptFile->CurrentCommand!=NULL ? CurrentScriptFile->CurrentCommand->Line:0); ShellStatus = SHELL_DEVICE_ERROR; diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/Goto.c b/ShellPkg/Library/UefiShellLevel1CommandsLib/Goto.c index 88e290daa7..04083bbc1c 100644 --- a/ShellPkg/Library/UefiShellLevel1CommandsLib/Goto.c +++ b/ShellPkg/Library/UefiShellLevel1CommandsLib/Goto.c @@ -2,7 +2,7 @@ Main file for goto shell level 1 function. (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -83,14 +83,14 @@ ShellCommandRunGoto ( if (!MoveToTag(GetNextNode, L"endfor", L"for", CompareString, ShellCommandGetCurrentScriptFile(), FALSE, FALSE, TRUE)) { CurrentScriptFile = ShellCommandGetCurrentScriptFile(); ShellPrintHiiEx( - -1, - -1, - NULL, - STRING_TOKEN (STR_SYNTAX_NO_MATCHING), - gShellLevel1HiiHandle, - CompareString, - L"Goto", - CurrentScriptFile!=NULL + -1, + -1, + NULL, + STRING_TOKEN (STR_SYNTAX_NO_MATCHING), + gShellLevel1HiiHandle, + CompareString, + L"Goto", + CurrentScriptFile!=NULL && CurrentScriptFile->CurrentCommand!=NULL ? CurrentScriptFile->CurrentCommand->Line:0); ShellStatus = SHELL_NOT_FOUND; diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/If.c b/ShellPkg/Library/UefiShellLevel1CommandsLib/If.c index 35c5ca6835..14380601ca 100644 --- a/ShellPkg/Library/UefiShellLevel1CommandsLib/If.c +++ b/ShellPkg/Library/UefiShellLevel1CommandsLib/If.c @@ -2,7 +2,7 @@ Main file for If and else shell level 1 function. (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -335,7 +335,7 @@ TestOperation ( /** Process an if statement and determine if its is valid or not. - @param[in, out] PassingState Opon entry, the current state. Upon exit, + @param[in, out] PassingState Opon entry, the current state. Upon exit, the new state. @param[in] StartParameterNumber The number of the first parameter of this statement. @@ -346,7 +346,7 @@ TestOperation ( @param[in] ForceStringCompare TRUE for all string based, FALSE otherwise. @retval EFI_INVALID_PARAMETER A parameter was invalid. - @retval EFI_SUCCESS The operation was successful. + @retval EFI_SUCCESS The operation was successful. **/ EFI_STATUS ProcessStatement ( @@ -649,9 +649,9 @@ ProcessStatement ( Break up the next part of the if statement (until the next 'and', 'or', or 'then'). @param[in] ParameterNumber The current parameter number. - @param[out] EndParameter Upon successful return, will point to the + @param[out] EndParameter Upon successful return, will point to the parameter to start the next iteration with. - @param[out] EndTag Upon successful return, will point to the + @param[out] EndTag Upon successful return, will point to the type that was found at the end of this statement. @retval TRUE A valid statement was found. @@ -837,12 +837,12 @@ ShellCommandRunIf ( ASSERT_EFI_ERROR(Status); if (!gEfiShellProtocol->BatchIsActive()) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_NO_SCRIPT), gShellLevel1HiiHandle, L"if"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_NO_SCRIPT), gShellLevel1HiiHandle, L"if"); return (SHELL_UNSUPPORTED); } if (gEfiShellParametersProtocol->Argc < 3) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel1HiiHandle, L"if"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel1HiiHandle, L"if"); return (SHELL_INVALID_PARAMETER); } @@ -852,14 +852,14 @@ ShellCommandRunIf ( CurrentScriptFile = ShellCommandGetCurrentScriptFile(); if (!MoveToTag(GetNextNode, L"endif", L"if", NULL, CurrentScriptFile, TRUE, TRUE, FALSE)) { ShellPrintHiiEx( - -1, - -1, - NULL, - STRING_TOKEN (STR_SYNTAX_NO_MATCHING), - gShellLevel1HiiHandle, - L"EndIf", - L"If", - CurrentScriptFile!=NULL + -1, + -1, + NULL, + STRING_TOKEN (STR_SYNTAX_NO_MATCHING), + gShellLevel1HiiHandle, + L"EndIf", + L"If", + CurrentScriptFile!=NULL && CurrentScriptFile->CurrentCommand!=NULL ? CurrentScriptFile->CurrentCommand->Line:0); return (SHELL_DEVICE_ERROR); @@ -920,12 +920,12 @@ ShellCommandRunIf ( // we are at the then // if (CurrentParameter+1 != gEfiShellParametersProtocol->Argc) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_TEXT_AFTER_THEN), gShellLevel1HiiHandle, L"if"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_TEXT_AFTER_THEN), gShellLevel1HiiHandle, L"if"); ShellStatus = SHELL_INVALID_PARAMETER; } else { Status = PerformResultOperation(CurrentValue); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SYNTAX_AFTER_BAD), gShellLevel1HiiHandle, L"if", gEfiShellParametersProtocol->Argv[CurrentParameter]); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SYNTAX_AFTER_BAD), gShellLevel1HiiHandle, L"if", gEfiShellParametersProtocol->Argv[CurrentParameter]); ShellStatus = SHELL_INVALID_PARAMETER; } } @@ -937,14 +937,14 @@ ShellCommandRunIf ( if (!BuildNextStatement(CurrentParameter, &EndParameter, &Ending)) { CurrentScriptFile = ShellCommandGetCurrentScriptFile(); ShellPrintHiiEx( - -1, - -1, - NULL, - STRING_TOKEN (STR_SYNTAX_NO_MATCHING), - gShellLevel1HiiHandle, - L"Then", + -1, + -1, + NULL, + STRING_TOKEN (STR_SYNTAX_NO_MATCHING), + gShellLevel1HiiHandle, + L"Then", L"If", - CurrentScriptFile!=NULL + CurrentScriptFile!=NULL && CurrentScriptFile->CurrentCommand!=NULL ? CurrentScriptFile->CurrentCommand->Line:0); ShellStatus = SHELL_INVALID_PARAMETER; @@ -963,7 +963,7 @@ ShellCommandRunIf ( if ((Ending == EndTagOr && CurrentValue) || (Ending == EndTagAnd && !CurrentValue)) { Status = PerformResultOperation(CurrentValue); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SYNTAX_AFTER_BAD), gShellLevel1HiiHandle, L"if", gEfiShellParametersProtocol->Argv[CurrentParameter]); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SYNTAX_AFTER_BAD), gShellLevel1HiiHandle, L"if", gEfiShellParametersProtocol->Argv[CurrentParameter]); ShellStatus = SHELL_INVALID_PARAMETER; } break; @@ -1004,7 +1004,7 @@ ShellCommandRunElse ( ASSERT_EFI_ERROR (Status); if (gEfiShellParametersProtocol->Argc > 1) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel1HiiHandle, L"if"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel1HiiHandle, L"if"); return (SHELL_INVALID_PARAMETER); } @@ -1017,28 +1017,28 @@ ShellCommandRunElse ( if (!MoveToTag(GetPreviousNode, L"if", L"endif", NULL, CurrentScriptFile, FALSE, TRUE, FALSE)) { ShellPrintHiiEx( - -1, - -1, - NULL, - STRING_TOKEN (STR_SYNTAX_NO_MATCHING), - gShellLevel1HiiHandle, - L"If", - L"Else", - CurrentScriptFile!=NULL + -1, + -1, + NULL, + STRING_TOKEN (STR_SYNTAX_NO_MATCHING), + gShellLevel1HiiHandle, + L"If", + L"Else", + CurrentScriptFile!=NULL && CurrentScriptFile->CurrentCommand!=NULL ? CurrentScriptFile->CurrentCommand->Line:0); return (SHELL_DEVICE_ERROR); } if (!MoveToTag(GetPreviousNode, L"if", L"else", NULL, CurrentScriptFile, FALSE, TRUE, FALSE)) { ShellPrintHiiEx( - -1, - -1, - NULL, - STRING_TOKEN (STR_SYNTAX_NO_MATCHING), - gShellLevel1HiiHandle, - L"If", - L"Else", - CurrentScriptFile!=NULL + -1, + -1, + NULL, + STRING_TOKEN (STR_SYNTAX_NO_MATCHING), + gShellLevel1HiiHandle, + L"If", + L"Else", + CurrentScriptFile!=NULL && CurrentScriptFile->CurrentCommand!=NULL ? CurrentScriptFile->CurrentCommand->Line:0); return (SHELL_DEVICE_ERROR); @@ -1046,14 +1046,14 @@ ShellCommandRunElse ( if (!MoveToTag(GetNextNode, L"endif", L"if", NULL, CurrentScriptFile, FALSE, FALSE, FALSE)) { ShellPrintHiiEx( - -1, - -1, - NULL, - STRING_TOKEN (STR_SYNTAX_NO_MATCHING), - gShellLevel1HiiHandle, - L"EndIf", - "Else", - CurrentScriptFile!=NULL + -1, + -1, + NULL, + STRING_TOKEN (STR_SYNTAX_NO_MATCHING), + gShellLevel1HiiHandle, + L"EndIf", + "Else", + CurrentScriptFile!=NULL && CurrentScriptFile->CurrentCommand!=NULL ? CurrentScriptFile->CurrentCommand->Line:0); return (SHELL_DEVICE_ERROR); @@ -1082,7 +1082,7 @@ ShellCommandRunEndIf ( ASSERT_EFI_ERROR (Status); if (gEfiShellParametersProtocol->Argc > 1) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel1HiiHandle, L"if"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel1HiiHandle, L"if"); return (SHELL_INVALID_PARAMETER); } @@ -1094,14 +1094,14 @@ ShellCommandRunEndIf ( CurrentScriptFile = ShellCommandGetCurrentScriptFile(); if (!MoveToTag(GetPreviousNode, L"if", L"endif", NULL, CurrentScriptFile, FALSE, TRUE, FALSE)) { ShellPrintHiiEx( - -1, - -1, - NULL, - STRING_TOKEN (STR_SYNTAX_NO_MATCHING), - gShellLevel1HiiHandle, - L"If", - L"EndIf", - CurrentScriptFile!=NULL + -1, + -1, + NULL, + STRING_TOKEN (STR_SYNTAX_NO_MATCHING), + gShellLevel1HiiHandle, + L"If", + L"EndIf", + CurrentScriptFile!=NULL && CurrentScriptFile->CurrentCommand!=NULL ? CurrentScriptFile->CurrentCommand->Line:0); return (SHELL_DEVICE_ERROR); diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/Shift.c b/ShellPkg/Library/UefiShellLevel1CommandsLib/Shift.c index 08c54f8f7a..a6f59f668c 100644 --- a/ShellPkg/Library/UefiShellLevel1CommandsLib/Shift.c +++ b/ShellPkg/Library/UefiShellLevel1CommandsLib/Shift.c @@ -2,7 +2,7 @@ Main file for Shift shell level 1 function. (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -36,7 +36,7 @@ ShellCommandRunShift ( ASSERT_EFI_ERROR(Status); if (!gEfiShellProtocol->BatchIsActive()) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_NO_SCRIPT), gShellLevel1HiiHandle, L"shift"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_NO_SCRIPT), gShellLevel1HiiHandle, L"shift"); return (SHELL_UNSUPPORTED); } @@ -44,7 +44,7 @@ ShellCommandRunShift ( ASSERT(CurrentScriptFile != NULL); if (CurrentScriptFile->Argc < 2) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel1HiiHandle, L"shift"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel1HiiHandle, L"shift"); return (SHELL_UNSUPPORTED); } diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/Stall.c b/ShellPkg/Library/UefiShellLevel1CommandsLib/Stall.c index 476b1bc47f..4306d7fca7 100644 --- a/ShellPkg/Library/UefiShellLevel1CommandsLib/Stall.c +++ b/ShellPkg/Library/UefiShellLevel1CommandsLib/Stall.c @@ -2,7 +2,7 @@ Main file for stall shell level 1 function. (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -51,7 +51,7 @@ ShellCommandRunStall ( Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel1HiiHandle, L"stall", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel1HiiHandle, L"stall", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -59,20 +59,20 @@ ShellCommandRunStall ( } } else { if (ShellCommandLineGetRawValue(Package, 2) != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel1HiiHandle, L"stall"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel1HiiHandle, L"stall"); ShellStatus = SHELL_INVALID_PARAMETER; } else if (ShellCommandLineGetRawValue(Package, 1) == NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel1HiiHandle, L"stall"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel1HiiHandle, L"stall"); ShellStatus = SHELL_INVALID_PARAMETER; } else { Status = ShellConvertStringToUint64(ShellCommandLineGetRawValue(Package, 1), &Intermediate, FALSE, FALSE); if (EFI_ERROR(Status) || ((UINT64)(UINTN)(Intermediate)) != Intermediate) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellLevel1HiiHandle, L"stall", ShellCommandLineGetRawValue(Package, 1)); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellLevel1HiiHandle, L"stall", ShellCommandLineGetRawValue(Package, 1)); ShellStatus = SHELL_INVALID_PARAMETER; } else { Status = gBS->Stall((UINTN)Intermediate); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_STALL_FAILED), gShellLevel1HiiHandle, L"stall"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_STALL_FAILED), gShellLevel1HiiHandle, L"stall"); ShellStatus = SHELL_DEVICE_ERROR; } } diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.c b/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.c index 2b8a104da3..c6c2e9787e 100644 --- a/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.c +++ b/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.c @@ -2,7 +2,7 @@ Main file for NULL named library for level 1 shell command functions. (C) Copyright 2013 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -103,18 +103,18 @@ ShellLevel1CommandsLibDestructor ( It functions so that count starts at 1 and it increases or decreases when it hits the specified tags. when it hits zero the location has been found. - DecrementerTag and IncrementerTag are used to get around for/endfor and + DecrementerTag and IncrementerTag are used to get around for/endfor and similar paired types where the entire middle should be ignored. If label is used it will be used instead of the count. - @param[in] Function The function to use to enumerate through the + @param[in] Function The function to use to enumerate through the list. Normally GetNextNode or GetPreviousNode. @param[in] DecrementerTag The tag to decrement the count at. @param[in] IncrementerTag The tag to increment the count at. @param[in] Label A label to look for. @param[in, out] ScriptFile The pointer to the current script file structure. - @param[in] MovePast TRUE makes function return 1 past the found + @param[in] MovePast TRUE makes function return 1 past the found location. @param[in] FindOnly TRUE to not change the ScriptFile. @param[in] CommandNode The pointer to the Node to test. @@ -227,21 +227,21 @@ TestNodeForMove ( It functions so that count starts at 1 and it increases or decreases when it hits the specified tags. when it hits zero the location has been found. - DecrementerTag and IncrementerTag are used to get around for/endfor and + DecrementerTag and IncrementerTag are used to get around for/endfor and similar paired types where the entire middle should be ignored. If label is used it will be used instead of the count. - @param[in] Function The function to use to enumerate through the + @param[in] Function The function to use to enumerate through the list. Normally GetNextNode or GetPreviousNode. @param[in] DecrementerTag The tag to decrement the count at. @param[in] IncrementerTag The tag to increment the count at. @param[in] Label A label to look for. @param[in, out] ScriptFile The pointer to the current script file structure. - @param[in] MovePast TRUE makes function return 1 past the found + @param[in] MovePast TRUE makes function return 1 past the found location. @param[in] FindOnly TRUE to not change the ScriptFile. - @param[in] WrapAroundScript TRUE to wrap end-to-begining or vise versa in + @param[in] WrapAroundScript TRUE to wrap end-to-begining or vise versa in searching. **/ BOOLEAN diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.h b/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.h index 04892a6f01..9106082ab7 100644 --- a/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.h +++ b/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.h @@ -1,7 +1,7 @@ /** @file Main file for NULL named library for level 1 shell command functions. - Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -176,21 +176,21 @@ LIST_ENTRY * It functions so that count starts at 1 and it increases or decreases when it hits the specified tags. when it hits zero the location has been found. - DecrementerTag and IncrementerTag are used to get around for/endfor and + DecrementerTag and IncrementerTag are used to get around for/endfor and similar paired types where the entire middle should be ignored. If label is used it will be used instead of the count. - @param[in] Function The function to use to enumerate through the + @param[in] Function The function to use to enumerate through the list. Normally GetNextNode or GetPreviousNode. @param[in] DecrementerTag The tag to decrement the count at. @param[in] IncrementerTag The tag to increment the count at. @param[in] Label A label to look for. @param[in, out] ScriptFile The pointer to the current script file structure. - @param[in] MovePast TRUE makes function return 1 past the found + @param[in] MovePast TRUE makes function return 1 past the found location. @param[in] FindOnly TRUE to not change the ScriptFile. - @param[in] WrapAroundScript TRUE to wrap end-to-begining or vise versa in + @param[in] WrapAroundScript TRUE to wrap end-to-begining or vise versa in searching. **/ BOOLEAN diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Attrib.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Attrib.c index 30d643431f..03a99591aa 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Attrib.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Attrib.c @@ -2,7 +2,7 @@ Main file for attrib shell level 2 function. (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -70,7 +70,7 @@ ShellCommandRunAttrib ( Status = ShellCommandLineParse (AttribParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, L"attrib", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, L"attrib", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -133,7 +133,7 @@ ShellCommandRunAttrib ( ASSERT(ListOfFiles == NULL); Status = ShellOpenFileMetaArg((CHAR16*)FileName, EFI_FILE_MODE_READ, &ListOfFiles); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellLevel2HiiHandle, L"attrib", ShellCommandLineGetRawValue(Package, ParamNumberCount)); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellLevel2HiiHandle, L"attrib", ShellCommandLineGetRawValue(Package, ParamNumberCount)); ShellStatus = SHELL_NOT_FOUND; } else { for (FileNode = (EFI_SHELL_FILE_INFO*)GetFirstNode(&ListOfFiles->Link) @@ -153,7 +153,7 @@ ShellCommandRunAttrib ( FileNode->Info->Attribute&EFI_FILE_READ_ONLY? L'R':L' ', FileNode->FileName ); - + if (ShellGetExecutionBreakFlag()) { ShellStatus = SHELL_ABORTED; break; @@ -162,7 +162,7 @@ ShellCommandRunAttrib ( Status = ShellCloseFileMetaArg(&ListOfFiles); ListOfFiles = NULL; if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_CLOSE_FAIL), gShellLevel2HiiHandle, L"attrib", ShellCommandLineGetRawValue(Package, ParamNumberCount)); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_CLOSE_FAIL), gShellLevel2HiiHandle, L"attrib", ShellCommandLineGetRawValue(Package, ParamNumberCount)); ShellStatus = SHELL_NOT_FOUND; } } // for loop for handling wildcard filenames @@ -171,7 +171,7 @@ ShellCommandRunAttrib ( // // fail as we have conflcting params. // - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CON), gShellLevel2HiiHandle, L"attrib"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CON), gShellLevel2HiiHandle, L"attrib"); ShellStatus = SHELL_INVALID_PARAMETER; } else { // @@ -188,7 +188,7 @@ ShellCommandRunAttrib ( // make sure we are not failing on the first one we do... if yes that's an error... // if (ParamNumberCount == 1) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel2HiiHandle, L"attrib"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel2HiiHandle, L"attrib"); ShellStatus = SHELL_INVALID_PARAMETER; } break; @@ -205,7 +205,7 @@ ShellCommandRunAttrib ( ASSERT(ListOfFiles == NULL); Status = ShellOpenFileMetaArg((CHAR16*)FileName, EFI_FILE_MODE_READ, &ListOfFiles); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellLevel2HiiHandle, L"attrib", ShellCommandLineGetRawValue(Package, ParamNumberCount)); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellLevel2HiiHandle, L"attrib", ShellCommandLineGetRawValue(Package, ParamNumberCount)); ShellStatus = SHELL_NOT_FOUND; } else { for (FileNode = (EFI_SHELL_FILE_INFO*)GetFirstNode(&ListOfFiles->Link) @@ -231,7 +231,7 @@ ShellCommandRunAttrib ( // Status = ShellSetFileInfo(FileNode->Handle, FileInfo); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_AD), gShellLevel2HiiHandle, L"attrib", ShellCommandLineGetRawValue(Package, ParamNumberCount)); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_AD), gShellLevel2HiiHandle, L"attrib", ShellCommandLineGetRawValue(Package, ParamNumberCount)); ShellStatus = SHELL_ACCESS_DENIED; } } @@ -247,7 +247,7 @@ ShellCommandRunAttrib ( // Status = ShellSetFileInfo(FileNode->Handle, FileInfo); if (EFI_ERROR(Status)) {; - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_AD), gShellLevel2HiiHandle, L"attrib", ShellCommandLineGetRawValue(Package, ParamNumberCount)); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_AD), gShellLevel2HiiHandle, L"attrib", ShellCommandLineGetRawValue(Package, ParamNumberCount)); ShellStatus = SHELL_ACCESS_DENIED; } @@ -256,7 +256,7 @@ ShellCommandRunAttrib ( Status = ShellCloseFileMetaArg(&ListOfFiles); ListOfFiles = NULL; if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_CLOSE_FAIL), gShellLevel2HiiHandle, L"attrib", ShellCommandLineGetRawValue(Package, ParamNumberCount)); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_CLOSE_FAIL), gShellLevel2HiiHandle, L"attrib", ShellCommandLineGetRawValue(Package, ParamNumberCount)); ShellStatus = SHELL_NOT_FOUND; } } // for loop for handling wildcard filenames diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Cd.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Cd.c index d5dc9804d4..79dd2096f4 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Cd.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Cd.c @@ -217,7 +217,7 @@ ShellCommandRunCd ( Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, L"cd", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, L"cd", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -231,7 +231,7 @@ ShellCommandRunCd ( if (ShellCommandLineGetFlag(Package, L"-?")) { ASSERT(FALSE); } else if (ShellCommandLineGetRawValue(Package, 2) != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle, L"cd"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle, L"cd"); ShellStatus = SHELL_INVALID_PARAMETER; } else { // diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c index ae7528ddcf..1c48824664 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c @@ -132,7 +132,7 @@ CopySingleFile( if (ShellIsDirectory(Source) == EFI_SUCCESS) { Status = ShellCreateDirectory(Dest, &DestHandle); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CP_DEST_DIR_FAIL), gShellLevel2HiiHandle, CmdName, Dest); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CP_DEST_DIR_FAIL), gShellLevel2HiiHandle, CmdName, Dest); return (SHELL_ACCESS_DENIED); } @@ -161,7 +161,7 @@ CopySingleFile( // Status = ShellOpenFileByName(Dest, &DestHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE|EFI_FILE_MODE_CREATE, 0); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CP_DEST_OPEN_FAIL), gShellLevel2HiiHandle, CmdName, Dest); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CP_DEST_OPEN_FAIL), gShellLevel2HiiHandle, CmdName, Dest); return (SHELL_ACCESS_DENIED); } @@ -220,7 +220,7 @@ CopySingleFile( //not enough space on destination directory to copy file // SHELL_FREE_NON_NULL(DestVolumeInfo); - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_CPY_FAIL), gShellLevel2HiiHandle, CmdName); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_CPY_FAIL), gShellLevel2HiiHandle, CmdName); return(SHELL_VOLUME_FULL); } else { // @@ -237,19 +237,19 @@ CopySingleFile( Status = ShellWriteFile(DestHandle, &ReadSize, Buffer); if (EFI_ERROR(Status)) { ShellStatus = (SHELL_STATUS) (Status & (~MAX_BIT)); - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_CPY_WRITE_ERROR), gShellLevel2HiiHandle, CmdName, Dest); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_CPY_WRITE_ERROR), gShellLevel2HiiHandle, CmdName, Dest); break; } } else { ShellStatus = (SHELL_STATUS) (Status & (~MAX_BIT)); - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_CPY_READ_ERROR), gShellLevel2HiiHandle, CmdName, Source); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_CPY_READ_ERROR), gShellLevel2HiiHandle, CmdName, Source); break; } } } SHELL_FREE_NON_NULL(DestVolumeInfo); } - + // // close files // @@ -324,7 +324,7 @@ ValidateAndCopyFiles( ASSERT(FileList != NULL); ASSERT(DestDir != NULL); - + Status = ShellLevel2StripQuotes (DestDir, &CleanFilePathStr); if (EFI_ERROR (Status)) { if (Status == EFI_OUT_OF_RESOURCES) { @@ -333,7 +333,7 @@ ValidateAndCopyFiles( return SHELL_INVALID_PARAMETER; } } - + ASSERT (CleanFilePathStr != NULL); // @@ -343,7 +343,7 @@ ValidateAndCopyFiles( // // Error for destination not a directory // - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NOT_DIR), gShellLevel2HiiHandle, L"cp", CleanFilePathStr); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NOT_DIR), gShellLevel2HiiHandle, L"cp", CleanFilePathStr); FreePool (CleanFilePathStr); return (SHELL_INVALID_PARAMETER); } @@ -369,7 +369,7 @@ ValidateAndCopyFiles( // Make sure got -r if required // if (!RecursiveMode && !EFI_ERROR(ShellIsDirectory(Node->FullName))) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CP_DIR_REQ), gShellLevel2HiiHandle, L"cp"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CP_DIR_REQ), gShellLevel2HiiHandle, L"cp"); FreePool (CleanFilePathStr); return (SHELL_INVALID_PARAMETER); } @@ -381,7 +381,7 @@ ValidateAndCopyFiles( // // Error for destination not a directory // - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NOT_DIR), gShellLevel2HiiHandle, L"cp", CleanFilePathStr); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NOT_DIR), gShellLevel2HiiHandle, L"cp", CleanFilePathStr); FreePool (CleanFilePathStr); return (SHELL_INVALID_PARAMETER); } @@ -430,7 +430,7 @@ ValidateAndCopyFiles( StrCpyS(DestPath, PathSize / sizeof(CHAR16), Cwd); StrCatS(DestPath, PathSize / sizeof(CHAR16), L"\\"); } else { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_DIR_NF), gShellLevel2HiiHandle, L"cp", CleanFilePathStr); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_DIR_NF), gShellLevel2HiiHandle, L"cp", CleanFilePathStr); FreePool (CleanFilePathStr); return (SHELL_INVALID_PARAMETER); } @@ -447,7 +447,7 @@ ValidateAndCopyFiles( // // we have multiple files or a directory in the DestDir // - + // // Check for leading slash // @@ -459,7 +459,7 @@ ValidateAndCopyFiles( StrCpyS(DestPath, PathSize/sizeof(CHAR16), Cwd); StrCatS(DestPath, PathSize/sizeof(CHAR16), L"\\"); } else { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_DIR_NF), gShellLevel2HiiHandle, L"cp", CleanFilePathStr); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_DIR_NF), gShellLevel2HiiHandle, L"cp", CleanFilePathStr); FreePool(CleanFilePathStr); return (SHELL_INVALID_PARAMETER); } @@ -471,7 +471,7 @@ ValidateAndCopyFiles( StrCpyS(DestPath, PathSize/sizeof(CHAR16), Cwd); StrCatS(DestPath, PathSize/sizeof(CHAR16), L"\\"); } else { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_DIR_NF), gShellLevel2HiiHandle, L"cp", CleanFilePathStr); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_DIR_NF), gShellLevel2HiiHandle, L"cp", CleanFilePathStr); FreePool(CleanFilePathStr); return (SHELL_INVALID_PARAMETER); } @@ -498,12 +498,12 @@ ValidateAndCopyFiles( StrCatS(DestPath, PathSize/sizeof(CHAR16), Node->FileName); } } - + // // Make sure the path exists // if (EFI_ERROR(VerifyIntermediateDirectories(DestPath))) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CP_DIR_WNF), gShellLevel2HiiHandle, L"cp", DestPath); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CP_DIR_WNF), gShellLevel2HiiHandle, L"cp", DestPath); ShellStatus = SHELL_DEVICE_ERROR; break; } @@ -512,12 +512,12 @@ ValidateAndCopyFiles( && !EFI_ERROR(ShellIsDirectory(DestPath)) && StrniCmp(Node->FullName, DestPath, StrLen(DestPath)) == 0 ){ - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CP_SD_PARENT), gShellLevel2HiiHandle, L"cp"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CP_SD_PARENT), gShellLevel2HiiHandle, L"cp"); ShellStatus = SHELL_INVALID_PARAMETER; break; } if (StringNoCaseCompare(&Node->FullName, &DestPath) == 0) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CP_SD_SAME), gShellLevel2HiiHandle, L"cp"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CP_SD_SAME), gShellLevel2HiiHandle, L"cp"); ShellStatus = SHELL_INVALID_PARAMETER; break; } @@ -525,7 +525,7 @@ ValidateAndCopyFiles( if ((StrniCmp(Node->FullName, DestPath, StrLen(Node->FullName)) == 0) && (DestPath[StrLen(Node->FullName)] == CHAR_NULL || DestPath[StrLen(Node->FullName)] == L'\\') ) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CP_SD_SAME), gShellLevel2HiiHandle, L"cp"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CP_SD_SAME), gShellLevel2HiiHandle, L"cp"); ShellStatus = SHELL_INVALID_PARAMETER; break; } @@ -561,7 +561,7 @@ ValidateAndCopyFiles( } /** - Validate and if successful copy all the files from the list into + Validate and if successful copy all the files from the list into destination directory. @param[in] FileList The list of files to copy. @@ -591,7 +591,7 @@ ProcessValidateAndCopyFiles( ShellOpenFileMetaArg((CHAR16*)DestDir, EFI_FILE_MODE_READ, &List); if (List != NULL && List->Link.ForwardLink != List->Link.BackLink) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_MARG_ERROR), gShellLevel2HiiHandle, L"cp", DestDir); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_MARG_ERROR), gShellLevel2HiiHandle, L"cp", DestDir); ShellStatus = SHELL_INVALID_PARAMETER; ShellCloseFileMetaArg(&List); } else if (List != NULL) { @@ -604,7 +604,7 @@ ProcessValidateAndCopyFiles( if ((FileInfo->Attribute & EFI_FILE_READ_ONLY) == 0) { ShellStatus = ValidateAndCopyFiles(FileList, FullName, SilentMode, RecursiveMode, NULL); } else { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CP_DEST_ERROR), gShellLevel2HiiHandle, L"cp"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CP_DEST_ERROR), gShellLevel2HiiHandle, L"cp"); ShellStatus = SHELL_ACCESS_DENIED; } } else { @@ -668,7 +668,7 @@ ShellCommandRunCp ( Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, L"cp", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, L"cp", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -698,7 +698,7 @@ ShellCommandRunCp ( // // we have insufficient parameters // - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel2HiiHandle, L"cp"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel2HiiHandle, L"cp"); ShellStatus = SHELL_INVALID_PARAMETER; break; case 2: @@ -707,12 +707,12 @@ ShellCommandRunCp ( // Cwd = ShellGetCurrentDir(NULL); if (Cwd == NULL){ - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_CWD), gShellLevel2HiiHandle, L"cp"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_CWD), gShellLevel2HiiHandle, L"cp"); ShellStatus = SHELL_INVALID_PARAMETER; } else { Status = ShellOpenFileMetaArg((CHAR16*)ShellCommandLineGetRawValue(Package, 1), EFI_FILE_MODE_WRITE|EFI_FILE_MODE_READ, &FileList); if (FileList == NULL || IsListEmpty(&FileList->Link) || EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NF), gShellLevel2HiiHandle, L"cp", ShellCommandLineGetRawValue(Package, 1)); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NF), gShellLevel2HiiHandle, L"cp", ShellCommandLineGetRawValue(Package, 1)); ShellStatus = SHELL_NOT_FOUND; } else { FullCwd = AllocateZeroPool(StrSize(Cwd) + sizeof(CHAR16)); @@ -738,7 +738,7 @@ ShellCommandRunCp ( } Status = ShellOpenFileMetaArg((CHAR16*)ShellCommandLineGetRawValue(Package, LoopCounter), EFI_FILE_MODE_WRITE|EFI_FILE_MODE_READ, &FileList); if (EFI_ERROR(Status) || FileList == NULL || IsListEmpty(&FileList->Link)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NF), gShellLevel2HiiHandle, L"cp", ShellCommandLineGetRawValue(Package, LoopCounter)); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NF), gShellLevel2HiiHandle, L"cp", ShellCommandLineGetRawValue(Package, LoopCounter)); ShellStatus = SHELL_NOT_FOUND; } } @@ -752,7 +752,7 @@ ShellCommandRunCp ( ShellStatus = ProcessValidateAndCopyFiles(FileList, PathCleanUpDirectories((CHAR16*)ShellCommandLineGetRawValue(Package, ParamCount)), SilentMode, RecursiveMode); Status = ShellCloseFileMetaArg(&FileList); if (EFI_ERROR(Status) && ShellStatus == SHELL_SUCCESS) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_FILE), gShellLevel2HiiHandle, L"cp", ShellCommandLineGetRawValue(Package, ParamCount), ShellStatus|MAX_BIT); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_FILE), gShellLevel2HiiHandle, L"cp", ShellCommandLineGetRawValue(Package, ParamCount), ShellStatus|MAX_BIT); ShellStatus = SHELL_ACCESS_DENIED; } } diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Load.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Load.c index 322d510eac..151df00071 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Load.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Load.c @@ -2,7 +2,7 @@ Main file for attrib shell level 2 function. (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -212,7 +212,7 @@ ShellCommandRunLoad ( Status = ShellCommandLineParse (LoadParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, L"load", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, L"load", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -228,7 +228,7 @@ ShellCommandRunLoad ( // // we didnt get a single file to load parameter // - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel2HiiHandle, L"load"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel2HiiHandle, L"load"); ShellStatus = SHELL_INVALID_PARAMETER; } else { for ( ParamCount = 1 @@ -259,7 +259,7 @@ ShellCommandRunLoad ( // // no files found. // - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NF), gShellLevel2HiiHandle, L"load", (CHAR16*)ShellCommandLineGetRawValue(Package, ParamCount)); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NF), gShellLevel2HiiHandle, L"load", (CHAR16*)ShellCommandLineGetRawValue(Package, ParamCount)); ShellStatus = SHELL_NOT_FOUND; } } // for loop for params diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c index 7d2e15f520..3c8ec78135 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c @@ -2,7 +2,7 @@ Main file for ls shell level 2 function. (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -154,10 +154,10 @@ PrintSfoVolumeInfoTableEntry( **/ VOID PrintFileInformation( - IN CONST BOOLEAN Sfo, - IN CONST EFI_SHELL_FILE_INFO *TheNode, - IN UINT64 *Files, - IN UINT64 *Size, + IN CONST BOOLEAN Sfo, + IN CONST EFI_SHELL_FILE_INFO *TheNode, + IN UINT64 *Files, + IN UINT64 *Size, IN UINT64 *Dirs ) { @@ -300,8 +300,8 @@ PrintNonSfoHeader( **/ VOID PrintNonSfoFooter( - IN UINT64 Files, - IN UINT64 Size, + IN UINT64 Files, + IN UINT64 Size, IN UINT64 Dirs ) { @@ -370,7 +370,7 @@ FileTimeToLocalTime ( // HourNumberOfTempMinute = TempMinute / 60; if(TempMinute < 0) { - HourNumberOfTempMinute --; + HourNumberOfTempMinute --; } TempHour = Time->Hour + HourNumberOfTempMinute; Time->Minute = (UINT8)(TempMinute - 60 * HourNumberOfTempMinute); @@ -582,7 +582,7 @@ PrintLsOutput( } CorrectedPath = StrnCatGrow(&CorrectedPath, &LongestPath, L"*", 0); Status = ShellOpenFileMetaArg((CHAR16*)CorrectedPath, EFI_FILE_MODE_READ, &ListHead); - + if (!EFI_ERROR(Status)) { for ( Node = (EFI_SHELL_FILE_INFO *)GetFirstNode(&ListHead->Link) ; !IsNull(&ListHead->Link, &Node->Link) && ShellStatus == SHELL_SUCCESS @@ -609,7 +609,7 @@ PrintLsOutput( &FoundOne, Count, TimeZone); - + // // Since it's running recursively, we have to break immediately when returned SHELL_ABORTED // @@ -698,7 +698,7 @@ ShellCommandRunLs ( Status = ShellCommandLineParse (LsParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, L"ls", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, L"ls", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -713,7 +713,7 @@ ShellCommandRunLs ( } if (ShellCommandLineGetCount(Package) > 2) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle, L"ls"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle, L"ls"); ShellStatus = SHELL_INVALID_PARAMETER; } else { // @@ -751,7 +751,7 @@ ShellCommandRunLs ( Count++; continue; default: - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ATTRIBUTE), gShellLevel2HiiHandle, L"ls", ShellCommandLineGetValue(Package, L"-a")); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ATTRIBUTE), gShellLevel2HiiHandle, L"ls", ShellCommandLineGetValue(Package, L"-a")); ShellStatus = SHELL_INVALID_PARAMETER; break; } // switch @@ -772,7 +772,7 @@ ShellCommandRunLs ( CurDir = gEfiShellProtocol->GetCurDir(NULL); if (CurDir == NULL) { ShellStatus = SHELL_NOT_FOUND; - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_CWD), gShellLevel2HiiHandle, L"ls"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_CWD), gShellLevel2HiiHandle, L"ls"); } // // Copy to the 2 strings for starting path and file search string @@ -789,7 +789,7 @@ ShellCommandRunLs ( // If we got something and it doesnt have a fully qualified path, then we needed to have a CWD. // ShellStatus = SHELL_NOT_FOUND; - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_CWD), gShellLevel2HiiHandle, L"ls"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_CWD), gShellLevel2HiiHandle, L"ls"); } else { // // We got a valid fully qualified path or we have a CWD @@ -809,7 +809,7 @@ ShellCommandRunLs ( ShellCommandLineFreeVarList (Package); return SHELL_OUT_OF_RESOURCES; } - + if (ShellIsDirectory(PathName) == EFI_SUCCESS) { // // is listing ends with a directory, then we list all files in that directory @@ -832,7 +832,7 @@ ShellCommandRunLs ( } Status = gRT->GetTime(&TheTime, NULL); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_UEFI_FUNC_WARN), gShellLevel2HiiHandle, L"ls", L"gRT->GetTime", Status); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_UEFI_FUNC_WARN), gShellLevel2HiiHandle, L"ls", L"gRT->GetTime", Status); TheTime.TimeZone = EFI_UNSPECIFIED_TIMEZONE; } @@ -848,15 +848,15 @@ ShellCommandRunLs ( TheTime.TimeZone ); if (ShellStatus == SHELL_NOT_FOUND) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_LS_FILE_NOT_FOUND), gShellLevel2HiiHandle, L"ls", FullPath); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_LS_FILE_NOT_FOUND), gShellLevel2HiiHandle, L"ls", FullPath); } else if (ShellStatus == SHELL_INVALID_PARAMETER) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellLevel2HiiHandle, L"ls", FullPath); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellLevel2HiiHandle, L"ls", FullPath); } else if (ShellStatus == SHELL_ABORTED) { // // Ignore aborting. // } else if (ShellStatus != SHELL_SUCCESS) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellLevel2HiiHandle, L"ls", FullPath); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellLevel2HiiHandle, L"ls", FullPath); } } } diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c index 9166ca2205..9cc6014805 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c @@ -4,7 +4,7 @@ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
(C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
(C) Copyright 2016 Hewlett Packard Enterprise Development LP
- + This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -56,12 +56,12 @@ IsNumberLetterOnly( @param[in] List The list to seatch in. @param[in] MetaTarget The item to search for. MetaMatching supported. - @param[out] FullName Optional pointer to an allocated buffer containing + @param[out] FullName Optional pointer to an allocated buffer containing the match. @param[in] Meta TRUE to use MetaMatching. @param[in] SkipTrailingNumbers TRUE to allow for numbers after the MetaTarget. - @param[in] Target The single character that delimits list - items (";" normally). + @param[in] Target The single character that delimits list + items (";" normally). **/ BOOLEAN SearchList( @@ -119,7 +119,7 @@ SearchList( } /** - Determine what type of device is represented and return it's string. The + Determine what type of device is represented and return it's string. The string is in allocated memory and must be callee freed. The HII is is listed below. The actual string cannot be determined. @@ -223,7 +223,7 @@ MappingListHasType( CHAR16 *NewSpecific; RETURN_STATUS Status; UINTN Length; - + // // specific has priority // @@ -529,7 +529,7 @@ PerformMappingDisplay( BOOLEAN Found; if (!Consist && !Normal && Specific == NULL && TypeString == NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel2HiiHandle, L"map"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel2HiiHandle, L"map"); return (SHELL_INVALID_PARAMETER); } @@ -540,7 +540,7 @@ PerformMappingDisplay( if (StrnCmp(TypeString, Test, StrLen(Test)-1) != 0) { Test = (CHAR16*)Fp; if (StrnCmp(TypeString, Test, StrLen(Test)-1) != 0) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellLevel2HiiHandle, L"map", TypeString); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellLevel2HiiHandle, L"map", TypeString); return (SHELL_INVALID_PARAMETER); } } else if (Test == NULL) { @@ -665,9 +665,9 @@ PerformMappingDisplay( } if (!Found) { if (Specific != NULL) { - ShellPrintHiiEx(gST->ConOut->Mode->CursorColumn, gST->ConOut->Mode->CursorRow-1, NULL, STRING_TOKEN (STR_MAP_NF), gShellLevel2HiiHandle, L"map", Specific); + ShellPrintHiiEx(gST->ConOut->Mode->CursorColumn, gST->ConOut->Mode->CursorRow-1, NULL, STRING_TOKEN (STR_MAP_NF), gShellLevel2HiiHandle, L"map", Specific); } else { - ShellPrintHiiEx(gST->ConOut->Mode->CursorColumn, gST->ConOut->Mode->CursorRow-1, NULL, STRING_TOKEN (STR_CD_NF), gShellLevel2HiiHandle, L"map"); + ShellPrintHiiEx(gST->ConOut->Mode->CursorColumn, gST->ConOut->Mode->CursorRow-1, NULL, STRING_TOKEN (STR_CD_NF), gShellLevel2HiiHandle, L"map"); } } return (SHELL_SUCCESS); @@ -879,7 +879,7 @@ AddMappingFromMapping( EFI_STATUS Status; CHAR16 *NewSName; RETURN_STATUS StrRetStatus; - + NewSName = AllocateCopyPool(StrSize(SName) + sizeof(CHAR16), SName); if (NewSName == NULL) { return (SHELL_OUT_OF_RESOURCES); @@ -935,7 +935,7 @@ AddMappingFromHandle( EFI_STATUS Status; CHAR16 *NewSName; RETURN_STATUS StrRetStatus; - + NewSName = AllocateCopyPool(StrSize(SName) + sizeof(CHAR16), SName); if (NewSName == NULL) { return (SHELL_OUT_OF_RESOURCES); @@ -1084,7 +1084,7 @@ ShellCommandRunMap ( Status = ShellCommandLineParse (MapParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, L"map", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, L"map", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -1100,7 +1100,7 @@ ShellCommandRunMap ( if (ShellCommandLineGetFlag(Package, L"-?")) { ASSERT(FALSE); } else if (ShellCommandLineGetRawValue(Package, 3) != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle, L"map"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle, L"map"); ShellStatus = SHELL_INVALID_PARAMETER; } else { // @@ -1114,7 +1114,7 @@ ShellCommandRunMap ( || ShellCommandLineGetFlag(Package, L"-u") || ShellCommandLineGetFlag(Package, L"-t") ){ - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CON), gShellLevel2HiiHandle, L"map"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CON), gShellLevel2HiiHandle, L"map"); ShellStatus = SHELL_INVALID_PARAMETER; } else { SName = ShellCommandLineGetValue(Package, L"-d"); @@ -1122,18 +1122,18 @@ ShellCommandRunMap ( Status = PerformMappingDelete(SName); if (EFI_ERROR(Status)) { if (Status == EFI_ACCESS_DENIED) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD), gShellLevel2HiiHandle, L"map"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD), gShellLevel2HiiHandle, L"map"); ShellStatus = SHELL_ACCESS_DENIED; } else if (Status == EFI_NOT_FOUND) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MAP_NF), gShellLevel2HiiHandle, L"map", SName); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MAP_NF), gShellLevel2HiiHandle, L"map", SName); ShellStatus = SHELL_INVALID_PARAMETER; } else { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK), gShellLevel2HiiHandle, L"map", Status); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK), gShellLevel2HiiHandle, L"map", Status); ShellStatus = SHELL_UNSUPPORTED; } } } else { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel2HiiHandle, L"map"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel2HiiHandle, L"map"); ShellStatus = SHELL_INVALID_PARAMETER; } } @@ -1151,7 +1151,7 @@ ShellCommandRunMap ( // Status = ShellCommandCreateInitialMappingsAndPaths(); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK), gShellLevel2HiiHandle, L"map", Status); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK), gShellLevel2HiiHandle, L"map", Status); ShellStatus = SHELL_UNSUPPORTED; } } @@ -1161,7 +1161,7 @@ ShellCommandRunMap ( // Status = ShellCommandUpdateMapping (); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK), gShellLevel2HiiHandle, L"map", Status); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK), gShellLevel2HiiHandle, L"map", Status); ShellStatus = SHELL_UNSUPPORTED; } } @@ -1241,7 +1241,7 @@ ShellCommandRunMap ( MapAsHandle = NULL; } if (MapAsHandle == NULL && Mapping[StrLen(Mapping)-1] != L':') { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellLevel2HiiHandle, L"map", Mapping); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellLevel2HiiHandle, L"map", Mapping); ShellStatus = SHELL_INVALID_PARAMETER; } else { TempStringLength = StrLen(SName); diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/MkDir.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/MkDir.c index 3a9e037d0e..21165c0ca7 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/MkDir.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/MkDir.c @@ -2,7 +2,7 @@ Main file for attrib shell level 2 function. (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -55,7 +55,7 @@ ShellCommandRunMkDir ( Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, L"mkdir", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, L"mkdir", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -76,7 +76,7 @@ ShellCommandRunMkDir ( // // we didnt get a single parameter // - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel2HiiHandle, L"mkdir"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel2HiiHandle, L"mkdir"); ShellStatus = SHELL_INVALID_PARAMETER; } else { for ( DirCreateCount = 1 @@ -108,7 +108,7 @@ ShellCommandRunMkDir ( ASSERT(FileHandle == NULL); // // create the nested directory from parent to child. - // if NewDirName = test1\test2\test3, first create "test1\" directory, then "test1\test2\", finally "test1\test2\test3". + // if NewDirName = test1\test2\test3, first create "test1\" directory, then "test1\test2\", finally "test1\test2\test3". // NewDirNameCopy = AllocateCopyPool (StrSize(NewDirName), NewDirName); NewDirNameCopy = PathCleanUpDirectories (NewDirNameCopy); diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c index 71e43367c6..43cd20e1bf 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c @@ -2,7 +2,7 @@ Main file for mv shell level 2 function. (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -17,7 +17,7 @@ /** function to determine if a move is between file systems. - + @param FullName [in] The name of the file to move. @param Cwd [in] The current working directory @param DestPath [in] The target location to move to @@ -170,14 +170,14 @@ IsValidMove( // // invalid to move read only or move to a read only destination // - if (((Attribute & EFI_FILE_READ_ONLY) != 0) + if (((Attribute & EFI_FILE_READ_ONLY) != 0) || (FileStatus == EFI_WRITE_PROTECTED) || ((DestAttr & EFI_FILE_READ_ONLY) != 0) ) { ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MV_INV_RO), gShellLevel2HiiHandle, SourcePath); return (FALSE); - } - + } + DestPathCopy = AllocateCopyPool(StrSize(DestPath), DestPath); if (DestPathCopy == NULL) { return (FALSE); @@ -196,7 +196,7 @@ IsValidMove( // If they're the same, or if source is "above" dest on file path tree // if ( StringNoCaseCompare (&DestPathWalker, &SourcePath) == 0 || - ((StrStr(DestPathWalker, SourcePath) == DestPathWalker) && + ((StrStr(DestPathWalker, SourcePath) == DestPathWalker) && (DestPathWalker[StrLen(SourcePath)] == '\\') ) ) { @@ -311,7 +311,7 @@ GetDestinationLocation( // if (!IsNodeAtEnd(&DestList->Link, &Node->Link)) { ShellCloseFileMetaArg(&DestList); - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_MARG_ERROR), gShellLevel2HiiHandle, L"mv", DestParameter); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_MARG_ERROR), gShellLevel2HiiHandle, L"mv", DestParameter); return (SHELL_INVALID_PARAMETER); } @@ -331,7 +331,7 @@ GetDestinationLocation( // cant move multiple files onto a single file. // ShellCloseFileMetaArg(&DestList); - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_ERROR), gShellLevel2HiiHandle, L"mv", DestParameter); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_ERROR), gShellLevel2HiiHandle, L"mv", DestParameter); return (SHELL_INVALID_PARAMETER); } } @@ -401,7 +401,7 @@ MoveBetweenFileSystems( EFI_STATUS CreateFullDestPath( IN CONST CHAR16 **DestPath, - OUT CHAR16 **FullDestPath, + OUT CHAR16 **FullDestPath, IN CONST CHAR16 *FileName ) { @@ -555,7 +555,7 @@ ValidateAndMoveFiles( StrCpyS(FullCwd, StrSize(Cwd)/sizeof(CHAR16)+1, Cwd); StrCatS(FullCwd, StrSize(Cwd)/sizeof(CHAR16)+1, L"\\"); } - } + } Status = ShellLevel2StripQuotes (DestParameter, &CleanFilePathStr); if (EFI_ERROR (Status)) { @@ -757,7 +757,7 @@ ShellCommandRunMv ( Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, L"mv", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, L"mv", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -777,7 +777,7 @@ ShellCommandRunMv ( // // we have insufficient parameters // - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel2HiiHandle, L"mv"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel2HiiHandle, L"mv"); ShellStatus = SHELL_INVALID_PARAMETER; break; case 2: @@ -785,12 +785,12 @@ ShellCommandRunMv ( // must have valid CWD for single parameter... // if (ShellGetCurrentDir(NULL) == NULL){ - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_CWD), gShellLevel2HiiHandle, L"mv"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_CWD), gShellLevel2HiiHandle, L"mv"); ShellStatus = SHELL_INVALID_PARAMETER; } else { Status = ShellOpenFileMetaArg((CHAR16*)ShellCommandLineGetRawValue(Package, 1), EFI_FILE_MODE_WRITE|EFI_FILE_MODE_READ, &FileList); if (FileList == NULL || IsListEmpty(&FileList->Link) || EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NF), gShellLevel2HiiHandle, L"mv", ShellCommandLineGetRawValue(Package, 1)); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NF), gShellLevel2HiiHandle, L"mv", ShellCommandLineGetRawValue(Package, 1)); ShellStatus = SHELL_NOT_FOUND; } else { // @@ -819,7 +819,7 @@ ShellCommandRunMv ( } Status = ShellOpenFileMetaArg((CHAR16*)ShellCommandLineGetRawValue(Package, LoopCounter), EFI_FILE_MODE_WRITE|EFI_FILE_MODE_READ, &FileList); if (FileList == NULL || IsListEmpty(&FileList->Link) || EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NF), gShellLevel2HiiHandle, L"mv", ShellCommandLineGetRawValue(Package, LoopCounter)); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NF), gShellLevel2HiiHandle, L"mv", ShellCommandLineGetRawValue(Package, LoopCounter)); ShellStatus = SHELL_NOT_FOUND; } else { // @@ -836,7 +836,7 @@ ShellCommandRunMv ( Status = ShellCloseFileMetaArg(&FileList); if (EFI_ERROR(Status) && ShellStatus == SHELL_SUCCESS) { ShellStatus = SHELL_ACCESS_DENIED; - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_FILE), gShellLevel2HiiHandle, L"mv", ShellCommandLineGetRawValue(Package, 1), ShellStatus|MAX_BIT); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_FILE), gShellLevel2HiiHandle, L"mv", ShellCommandLineGetRawValue(Package, 1), ShellStatus|MAX_BIT); } } } diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Parse.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Parse.c index 85c39ba78f..798b28983d 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Parse.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Parse.c @@ -2,7 +2,7 @@ Main file for Parse shell level 2 function. (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -19,9 +19,9 @@ Check if data is coming from StdIn output. @param[in] None - - @retval TRUE StdIn stream data available to parse - @retval FALSE StdIn stream data is not available to parse. + + @retval TRUE StdIn stream data available to parse + @retval FALSE StdIn stream data is not available to parse. **/ BOOLEAN IsStdInDataAvailable ( @@ -30,11 +30,11 @@ IsStdInDataAvailable ( { SHELL_FILE_HANDLE FileHandle; EFI_STATUS Status; - CHAR16 CharBuffer; + CHAR16 CharBuffer; UINTN CharSize; UINT64 OriginalFilePosition; - Status = EFI_SUCCESS; + Status = EFI_SUCCESS; FileHandle = NULL; OriginalFilePosition = 0; @@ -57,11 +57,11 @@ IsStdInDataAvailable ( /** Handle stings for SFO Output with escape character ^ in a string - 1. Quotation marks in the string must be escaped by using a ^ character (i.e. ^"). + 1. Quotation marks in the string must be escaped by using a ^ character (i.e. ^"). 2. The ^ character may be inserted using ^^. @param[in] String The Unicode NULL-terminated string. - + @retval NewString The new string handled for SFO. **/ EFI_STRING @@ -76,7 +76,7 @@ HandleStringWithEscapeCharForParse ( if (String == NULL) { return NULL; } - + // // start to parse the input string. // @@ -96,13 +96,13 @@ HandleStringWithEscapeCharForParse ( StrWalker++; NewStr++; } - + return ReturnStr; } /** - Do the actual parsing of the file. the file should be SFO output from a + Do the actual parsing of the file. the file should be SFO output from a shell command or a similar format. @param[in] FileName The filename to open. @@ -143,14 +143,14 @@ PerformParsing( Status = ShellOpenFileByName(FileName, &FileHandle, EFI_FILE_MODE_READ, 0); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellLevel2HiiHandle, L"parse", FileName); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellLevel2HiiHandle, L"parse", FileName); ShellStatus = SHELL_NOT_FOUND; } else if (!EFI_ERROR (FileHandleIsDirectory (FileHandle))) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_NOT_FILE), gShellLevel2HiiHandle, L"parse", FileName); + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_NOT_FILE), gShellLevel2HiiHandle, L"parse", FileName); ShellStatus = SHELL_NOT_FOUND; } else { for (LoopVariable = 0 ; LoopVariable < ShellCommandInstance && !ShellFileHandleEof(FileHandle);) { - TempLine = ShellFileHandleReturnLine (FileHandle, &Ascii); + TempLine = ShellFileHandleReturnLine (FileHandle, &Ascii); if ((TempLine == NULL) || (*TempLine == CHAR_NULL && StreamingUnicode)) { break; @@ -169,7 +169,7 @@ PerformParsing( if (LoopVariable == ShellCommandInstance) { LoopVariable = 0; while(1) { - TempLine = ShellFileHandleReturnLine (FileHandle, &Ascii); + TempLine = ShellFileHandleReturnLine (FileHandle, &Ascii); if (TempLine == NULL || *TempLine == CHAR_NULL || StrStr (TempLine, L"ShellCommand,") == TempLine) { @@ -188,7 +188,7 @@ PerformParsing( } if (ColumnLoop == ColumnIndex) { if (ColumnPointer == NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellLevel2HiiHandle, L"parse", L"Column Index"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellLevel2HiiHandle, L"parse", L"Column Index"); ShellStatus = SHELL_INVALID_PARAMETER; } else { TempSpot = StrStr (ColumnPointer, L",\""); @@ -266,7 +266,7 @@ ShellCommandRunParse ( Status = ShellCommandLineParseEx (ParamList, &Package, &ProblemParam, TRUE, FALSE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, L"parse", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, L"parse", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -276,11 +276,11 @@ ShellCommandRunParse ( StreamingUnicode = IsStdInDataAvailable (); if ((!StreamingUnicode && (ShellCommandLineGetCount(Package) < 4)) || (ShellCommandLineGetCount(Package) < 3)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel2HiiHandle, L"parse"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel2HiiHandle, L"parse"); ShellStatus = SHELL_INVALID_PARAMETER; } else if ((StreamingUnicode && (ShellCommandLineGetCount(Package) > 3)) || (ShellCommandLineGetCount(Package) > 4)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle, L"parse"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle, L"parse"); ShellStatus = SHELL_INVALID_PARAMETER; } else { if (StreamingUnicode) { diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Reset.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Reset.c index 40ad8d9c4e..59fa6f5acd 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Reset.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Reset.c @@ -2,7 +2,7 @@ Main file for attrib shell level 2 function. (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -60,7 +60,7 @@ ShellCommandRunReset ( Status = ShellCommandLineParse (ResetParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, L"reset", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, L"reset", ProblemParam); FreePool(ProblemParam); return (SHELL_INVALID_PARAMETER); } else { @@ -73,7 +73,7 @@ ShellCommandRunReset ( if (ShellCommandLineGetFlag(Package, L"-?")) { ASSERT(FALSE); } else if (ShellCommandLineGetRawValue(Package, 1) != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle, L"reset"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle, L"reset"); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -114,7 +114,7 @@ ShellCommandRunReset ( // if (ShellCommandLineGetFlag(Package, L"-w")) { if (ShellCommandLineGetFlag(Package, L"-s") || ShellCommandLineGetFlag(Package, L"-c")) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle, L"reset"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle, L"reset"); ShellStatus = SHELL_INVALID_PARAMETER; } else { String = ShellCommandLineGetValue(Package, L"-w"); @@ -126,7 +126,7 @@ ShellCommandRunReset ( } } else if (ShellCommandLineGetFlag(Package, L"-s")) { if (ShellCommandLineGetFlag(Package, L"-c")) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle, L"reset"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle, L"reset"); ShellStatus = SHELL_INVALID_PARAMETER; } else { String = ShellCommandLineGetValue(Package, L"-s"); diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Rm.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Rm.c index 288e7666a8..3986b36e7c 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Rm.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Rm.c @@ -24,7 +24,7 @@ STATIC CONST SHELL_PARAM_ITEM ParamList[] = { Determine if a directory has no files in it. @param[in] FileHandle The EFI_HANDLE to the directory. - + @retval TRUE The directory has no files (or directories). @retval FALSE The directory has at least 1 file or directory in it. **/ @@ -85,7 +85,7 @@ CascadeDelete( Status = EFI_SUCCESS; if ((Node->Info->Attribute & EFI_FILE_READ_ONLY) == EFI_FILE_READ_ONLY) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_RM_LOG_DETELE_RO), gShellLevel2HiiHandle, L"rm", Node->FullName); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_RM_LOG_DETELE_RO), gShellLevel2HiiHandle, L"rm", Node->FullName); return (SHELL_ACCESS_DENIED); } @@ -292,7 +292,7 @@ ShellCommandRunRm ( Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, L"rm", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, L"rm", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -309,7 +309,7 @@ ShellCommandRunRm ( // // we insufficient parameters // - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel2HiiHandle, L"rm"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel2HiiHandle, L"rm"); ShellStatus = SHELL_INVALID_PARAMETER; } else { // @@ -322,7 +322,7 @@ ShellCommandRunRm ( ){ Status = ShellOpenFileMetaArg((CHAR16*)Param, EFI_FILE_MODE_WRITE|EFI_FILE_MODE_READ, &FileList); if (EFI_ERROR(Status) || FileList == NULL || IsListEmpty(&FileList->Link)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NF), gShellLevel2HiiHandle, L"rm", (CHAR16*)Param); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NF), gShellLevel2HiiHandle, L"rm", (CHAR16*)Param); ShellStatus = SHELL_NOT_FOUND; break; } diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Set.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Set.c index 7ca19427d5..dbec6460be 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Set.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Set.c @@ -2,7 +2,7 @@ Main file for attrib shell level 2 function. (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -91,7 +91,7 @@ ShellCommandRunSet ( Status = ShellCommandLineParse (SetParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, L"set", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, L"set", ProblemParam); FreePool(ProblemParam); return (SHELL_INVALID_PARAMETER); } else { @@ -104,10 +104,10 @@ ShellCommandRunSet ( if (ShellCommandLineGetFlag(Package, L"-?")) { ASSERT(FALSE); } else if (ShellCommandLineGetRawValue(Package, 3) != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle, L"set"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle, L"set"); ShellStatus = SHELL_INVALID_PARAMETER; } else if (ShellCommandLineGetRawValue(Package, 1) != NULL && ShellCommandLineGetFlag(Package, L"-d")) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle, L"set"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle, L"set"); ShellStatus = SHELL_INVALID_PARAMETER; } else if (ShellCommandLineGetFlag(Package, L"-d")) { // @@ -115,12 +115,12 @@ ShellCommandRunSet ( // KeyName = ShellCommandLineGetValue(Package, L"-d"); if (KeyName == NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellLevel2HiiHandle, L"set", L"-d"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellLevel2HiiHandle, L"set", L"-d"); ShellStatus = SHELL_INVALID_PARAMETER; } else { Status = ShellSetEnvironmentVariable(KeyName, L"", ShellCommandLineGetFlag(Package, L"-v")); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SET_ND), gShellLevel2HiiHandle, L"set", KeyName); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SET_ND), gShellLevel2HiiHandle, L"set", KeyName); ShellStatus = SHELL_DEVICE_ERROR; } } @@ -144,7 +144,7 @@ ShellCommandRunSet ( ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SET_ERROR_SET), gShellLevel2HiiHandle, L"set", KeyName); ShellStatus = (SHELL_STATUS) (Status & (~MAX_BIT)); } - + } else { if (KeyName != NULL) { // @@ -152,7 +152,7 @@ ShellCommandRunSet ( // Value = ShellGetEnvironmentVariable(KeyName); if (Value == NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SET_NF), gShellLevel2HiiHandle, L"set", KeyName); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SET_NF), gShellLevel2HiiHandle, L"set", KeyName); ShellStatus = SHELL_SUCCESS; } else { ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SET_DISP), gShellLevel2HiiHandle, KeyName, Value); diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/TimeDate.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/TimeDate.c index 0b7551a239..0e948e3b0a 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/TimeDate.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/TimeDate.c @@ -76,7 +76,7 @@ InternalIsTimeLikeString ( } /** - Verify that the DateString is valid and if so set that as the current + Verify that the DateString is valid and if so set that as the current date. @param[in] DateString The pointer to a string representation of the date. @@ -102,7 +102,7 @@ CheckAndSetDate ( Status = gRT->GetTime(&TheTime, NULL); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_UEFI_FUNC_WARN), gShellLevel2HiiHandle, L"date", L"gRT->GetTime", Status); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_UEFI_FUNC_WARN), gShellLevel2HiiHandle, L"date", L"gRT->GetTime", Status); return (SHELL_DEVICE_ERROR); } @@ -195,7 +195,7 @@ ShellCommandRunDate ( Status = ShellCommandLineParse (SfoParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, L"date", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, L"date", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -208,7 +208,7 @@ ShellCommandRunDate ( if (ShellCommandLineGetFlag(Package, L"-?")) { ASSERT(FALSE); } else if (ShellCommandLineGetRawValue(Package, 2) != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle, L"date"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle, L"date"); ShellStatus = SHELL_INVALID_PARAMETER; } else { // @@ -221,7 +221,7 @@ ShellCommandRunDate ( // Status = gRT->GetTime(&TheTime, NULL); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_UEFI_FUNC_WARN), gShellLevel2HiiHandle, L"date", L"gRT->GetTime", Status); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_UEFI_FUNC_WARN), gShellLevel2HiiHandle, L"date", L"gRT->GetTime", Status); return (SHELL_DEVICE_ERROR); } @@ -241,7 +241,7 @@ ShellCommandRunDate ( } } else { if (PcdGet8(PcdShellSupportLevel) == 2) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle, L"date"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle, L"date"); ShellStatus = SHELL_INVALID_PARAMETER; } else { // @@ -254,7 +254,7 @@ ShellCommandRunDate ( ShellStatus = CheckAndSetDate(Param1); } if (ShellStatus != SHELL_SUCCESS) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellLevel2HiiHandle, L"date", Param1); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellLevel2HiiHandle, L"date", Param1); ShellStatus = SHELL_INVALID_PARAMETER; } } @@ -287,7 +287,7 @@ STATIC CONST SHELL_PARAM_ITEM TimeParamList3[] = { }; /** - Verify that the TimeString is valid and if so set that as the current + Verify that the TimeString is valid and if so set that as the current time. @param[in] TimeString The pointer to a string representation of the time. @@ -320,7 +320,7 @@ CheckAndSetTime ( Status = gRT->GetTime(&TheTime, NULL); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_UEFI_FUNC_WARN), gShellLevel2HiiHandle, L"time", L"gRT->GetTime", Status); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_UEFI_FUNC_WARN), gShellLevel2HiiHandle, L"time", L"gRT->GetTime", Status); return (SHELL_DEVICE_ERROR); } @@ -433,7 +433,7 @@ ShellCommandRunTime ( } if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, L"time", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, L"time", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -445,14 +445,14 @@ ShellCommandRunTime ( // Status = gRT->GetTime(&TheTime, NULL); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_UEFI_FUNC_WARN), gShellLevel2HiiHandle, L"time", L"gRT->GetTime", Status); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_UEFI_FUNC_WARN), gShellLevel2HiiHandle, L"time", L"gRT->GetTime", Status); return (SHELL_DEVICE_ERROR); } if (ShellCommandLineGetFlag(Package, L"-?")) { ASSERT(FALSE); } else if (ShellCommandLineGetRawValue(Package, 2) != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle, L"time"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle, L"time"); ShellStatus = SHELL_INVALID_PARAMETER; } else { // @@ -539,11 +539,11 @@ ShellCommandRunTime ( ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_TIME_DST3), gShellLevel2HiiHandle); break; default: - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_UEFI_FUNC_ERROR), gShellLevel2HiiHandle, L"time", L"gRT->GetTime", L"TheTime.Daylight", TheTime.Daylight); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_UEFI_FUNC_ERROR), gShellLevel2HiiHandle, L"time", L"gRT->GetTime", L"TheTime.Daylight", TheTime.Daylight); } } else { if (PcdGet8(PcdShellSupportLevel) == 2) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle, L"time"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle, L"time"); ShellStatus = SHELL_INVALID_PARAMETER; } else { // @@ -578,7 +578,7 @@ ShellCommandRunTime ( } } if (!(Tz >= -1440 && Tz <= 1440) && Tz != EFI_UNSPECIFIED_TIMEZONE) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM_VAL), gShellLevel2HiiHandle, L"time", TempLocation, L"-tz"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM_VAL), gShellLevel2HiiHandle, L"time", TempLocation, L"-tz"); ShellStatus = SHELL_INVALID_PARAMETER; } } else { @@ -599,7 +599,7 @@ ShellCommandRunTime ( Daylight = 0xff; //make it invalid = will not use } if (Daylight != 0 && Daylight != 1 && Daylight != 3) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM_VAL), gShellLevel2HiiHandle, L"time", TempLocation, L"-d"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM_VAL), gShellLevel2HiiHandle, L"time", TempLocation, L"-d"); ShellStatus = SHELL_INVALID_PARAMETER; } } else { @@ -611,7 +611,7 @@ ShellCommandRunTime ( if (ShellStatus == SHELL_SUCCESS) { ShellStatus = CheckAndSetTime(ShellCommandLineGetRawValue(Package, 1), Tz, Daylight); if (ShellStatus != SHELL_SUCCESS) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellLevel2HiiHandle, L"time", ShellCommandLineGetRawValue(Package, 1)); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellLevel2HiiHandle, L"time", ShellCommandLineGetRawValue(Package, 1)); ShellStatus = SHELL_INVALID_PARAMETER; } } @@ -688,7 +688,7 @@ STATIC CONST SHELL_PARAM_ITEM TimeZoneParamList3[] = { }; /** - Verify that the TimeZoneString is valid and if so set that as the current + Verify that the TimeZoneString is valid and if so set that as the current timezone. @param[in] TimeZoneString The pointer to a string representation of the timezone. @@ -733,7 +733,7 @@ CheckAndSetTimeZone ( Status = gRT->GetTime(&TheTime, NULL); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_UEFI_FUNC_WARN), gShellLevel2HiiHandle, L"timezone", L"gRT->GetTime", Status); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_UEFI_FUNC_WARN), gShellLevel2HiiHandle, L"timezone", L"gRT->GetTime", Status); return (SHELL_DEVICE_ERROR); } @@ -829,7 +829,7 @@ ShellCommandRunTimeZone ( } if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, L"timezone", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, L"timezone", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -840,18 +840,18 @@ ShellCommandRunTimeZone ( // check for "-?" // if (ShellCommandLineGetCount(Package) > 1) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle, L"timezone"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle, L"timezone"); ShellStatus = SHELL_INVALID_PARAMETER; } else if (ShellCommandLineGetFlag(Package, L"-?")) { ASSERT(FALSE); } else if (ShellCommandLineGetFlag(Package, L"-s")) { if ((ShellCommandLineGetFlag(Package, L"-l")) || (ShellCommandLineGetFlag(Package, L"-f"))) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellLevel2HiiHandle, L"timezone", L"-l or -f"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellLevel2HiiHandle, L"timezone", L"-l or -f"); ShellStatus = SHELL_INVALID_PARAMETER; } else { ASSERT(PcdGet8(PcdShellSupportLevel) == 3); if (ShellCommandLineGetValue(Package, L"-s") == NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellLevel2HiiHandle, L"timezone", L"-s"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellLevel2HiiHandle, L"timezone", L"-s"); ShellStatus = SHELL_INVALID_PARAMETER; } else { // @@ -859,7 +859,7 @@ ShellCommandRunTimeZone ( // ShellStatus = CheckAndSetTimeZone(ShellCommandLineGetValue(Package, L"-s")); if (ShellStatus != SHELL_SUCCESS) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellLevel2HiiHandle, L"timezone", ShellCommandLineGetValue(Package, L"-s")); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellLevel2HiiHandle, L"timezone", ShellCommandLineGetValue(Package, L"-s")); ShellStatus = SHELL_INVALID_PARAMETER; } } @@ -880,7 +880,7 @@ ShellCommandRunTimeZone ( // Status = gRT->GetTime(&TheTime, NULL); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_UEFI_FUNC_WARN), gShellLevel2HiiHandle, L"timezone", L"gRT->GetTime", Status); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_UEFI_FUNC_WARN), gShellLevel2HiiHandle, L"timezone", L"gRT->GetTime", Status); return (SHELL_DEVICE_ERROR); } @@ -951,7 +951,7 @@ ShellCommandRunTimeZone ( // ShellPrintHiiEx (-1, -1, NULL, TimeZoneList[LoopVar].StringId, gShellLevel2HiiHandle); break; - } + } } } else { // diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c index 36bc3552b5..cfad808193 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c @@ -269,7 +269,7 @@ VerifyIntermediateDirectories ( @retval 0 Source and Target are identical strings without regard to case. @retval !=0 Source is not identical to Target. - + **/ INTN StrniCmp( @@ -301,7 +301,7 @@ StrniCmp( FreePool (SourceCopy); return -1; } - + SourceCopy[SourceLength] = L'\0'; TargetCopy[TargetLength] = L'\0'; Result = gUnicodeCollation->StriColl (gUnicodeCollation, SourceCopy, TargetCopy); @@ -315,8 +315,8 @@ StrniCmp( Cleans off all the quotes in the string. @param[in] OriginalString pointer to the string to be cleaned. - @param[out] CleanString The new string with all quotes removed. - Memory allocated in the function and free + @param[out] CleanString The new string with all quotes removed. + Memory allocated in the function and free by caller. @retval EFI_SUCCESS The operation was successful. @@ -328,7 +328,7 @@ ShellLevel2StripQuotes ( ) { CHAR16 *Walker; - + if (OriginalString == NULL || CleanString == NULL) { return EFI_INVALID_PARAMETER; } diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.h b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.h index fef6adc3e1..fc61054cdc 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.h +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.h @@ -9,7 +9,7 @@ * functions are non-interactive only - Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -288,7 +288,7 @@ VerifyIntermediateDirectories ( @retval 0 Source and Target are identical strings without regard to case. @retval !=0 Source is not identical to Target. - + **/ INTN StrniCmp( @@ -301,8 +301,8 @@ StrniCmp( Cleans off all the quotes in the string. @param[in] OriginalString pointer to the string to be cleaned. - @param[out] CleanString The new string with all quotes removed. - Memory allocated in the function and free + @param[out] CleanString The new string with all quotes removed. + Memory allocated in the function and free by caller. @retval EFI_SUCCESS The operation was successful. diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.uni b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.uni index f9c647a035..7b16f3bfb8 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.uni +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.uni @@ -1,7 +1,7 @@ // /** // // (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
-// Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
+// Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
// This program and the accompanying materials // are licensed and made available under the terms and conditions of the BSD License // which accompanies this distribution. The full text of the license may be found at @@ -271,7 +271,7 @@ " variable %cwd%.\r\n" ".SH EXAMPLES\r\n" " \r\n" -"EXAMPLES:\r\n" +"EXAMPLES:\r\n" " * To change the current file system to the mapped fs0 file system:\r\n" " Shell> fs0:\r\n" " \r\n" @@ -294,7 +294,7 @@ " fs1:\> cd Tmp\r\n" ".SH RETURNVALUES\r\n" " \r\n" -"RETURN VALUES:\r\n" +"RETURN VALUES:\r\n" " SHELL_SUCCESS The action was completed as requested.\r\n" " SHELL_SECURITY_VIOLATION This function was not performed due to a security\r\n" " violation.\r\n" @@ -723,7 +723,7 @@ " is specified by sname is deleted.\r\n" ".SH EXAMPLES\r\n" " \r\n" -"EXAMPLES:\r\n" +"EXAMPLES:\r\n" " * To add an environment variable:\r\n" " Shell> set DiagnosticPath fs0:\efi\diag;fs1:\efi\diag\r\n" " \r\n" diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Vol.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Vol.c index f911c7eae8..e6f4a1993f 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Vol.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Vol.c @@ -2,7 +2,7 @@ Main file for vol shell level 2 function. (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.
+ Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -63,7 +63,7 @@ HandleVol( StrStr(Name, L"/") != NULL || StrStr(Name, L" ") != NULL ) ){ - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellLevel2HiiHandle, L"vol", Name); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellLevel2HiiHandle, L"vol", Name); return (SHELL_INVALID_PARAMETER); } @@ -73,7 +73,7 @@ HandleVol( Name != NULL?EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE:EFI_FILE_MODE_READ); if (EFI_ERROR(Status) || ShellFileHandle == NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellLevel2HiiHandle, L"vol", Path); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellLevel2HiiHandle, L"vol", Path); return (SHELL_ACCESS_DENIED); } @@ -114,13 +114,13 @@ HandleVol( if (Size1 > Size2) { SysInfo = ReallocatePool((UINTN)SysInfo->Size, (UINTN)SysInfo->Size + Size1 - Size2, SysInfo); if (SysInfo == NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellLevel2HiiHandle, L"vol"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellLevel2HiiHandle, L"vol"); ShellStatus = SHELL_OUT_OF_RESOURCES; - } + } } if (SysInfo != NULL) { - StrCpyS ( (CHAR16 *) SysInfo->VolumeLabel, - (Size1>Size2? Size1/sizeof(CHAR16) : Size2/sizeof(CHAR16)), + StrCpyS ( (CHAR16 *) SysInfo->VolumeLabel, + (Size1>Size2? Size1/sizeof(CHAR16) : Size2/sizeof(CHAR16)), Name ); SysInfo->Size = SIZE_OF_EFI_FILE_SYSTEM_INFO + Size1; @@ -130,13 +130,13 @@ HandleVol( (UINTN)SysInfo->Size, SysInfo); } - } + } FreePool(SysInfo); if (Delete || Name != NULL) { if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_AD), gShellLevel2HiiHandle, L"vol", Path); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_AD), gShellLevel2HiiHandle, L"vol", Path); ShellStatus = SHELL_ACCESS_DENIED; } } @@ -160,7 +160,7 @@ HandleVol( } gEfiShellProtocol->CloseFile(ShellFileHandle); - + ASSERT(SysInfo != NULL); if (SysInfo != NULL) { @@ -241,7 +241,7 @@ ShellCommandRunVol ( Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, L"vol", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, L"vol", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -256,7 +256,7 @@ ShellCommandRunVol ( } if (ShellCommandLineGetCount(Package) > 2) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle, L"vol"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle, L"vol"); ShellStatus = SHELL_INVALID_PARAMETER; } else { PathName = ShellCommandLineGetRawValue(Package, 1); @@ -264,7 +264,7 @@ ShellCommandRunVol ( CurDir = gEfiShellProtocol->GetCurDir(NULL); if (CurDir == NULL) { ShellStatus = SHELL_NOT_FOUND; - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_CWD), gShellLevel2HiiHandle, L"vol"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_CWD), gShellLevel2HiiHandle, L"vol"); } else { PathName = CurDir; } @@ -283,13 +283,13 @@ ShellCommandRunVol ( DeleteMode = ShellCommandLineGetFlag(Package, L"-d"); NewName = ShellCommandLineGetValue(Package, L"-n"); if (DeleteMode && ShellCommandLineGetFlag(Package, L"-n")) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellLevel2HiiHandle, L"vol", L"-d", L"-n"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellLevel2HiiHandle, L"vol", L"-d", L"-n"); ShellStatus = SHELL_INVALID_PARAMETER; } else if (ShellCommandLineGetFlag(Package, L"-n") && NewName == NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellLevel2HiiHandle, L"vol", L"-n"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellLevel2HiiHandle, L"vol", L"-n"); ShellStatus = SHELL_INVALID_PARAMETER; } else if (NewName != NULL && StrLen(NewName) > 11) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM_VAL), gShellLevel2HiiHandle, L"vol", NewName, L"-n"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM_VAL), gShellLevel2HiiHandle, L"vol", NewName, L"-n"); ShellStatus = SHELL_INVALID_PARAMETER; } else if (ShellStatus == SHELL_SUCCESS) { ShellStatus = HandleVol( diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/Alias.c b/ShellPkg/Library/UefiShellLevel3CommandsLib/Alias.c index 3e00eb1d55..abc1ebe234 100644 --- a/ShellPkg/Library/UefiShellLevel3CommandsLib/Alias.c +++ b/ShellPkg/Library/UefiShellLevel3CommandsLib/Alias.c @@ -2,7 +2,7 @@ Main file for Alias shell level 3 function. (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -186,7 +186,7 @@ ShellCommandRunAlias ( Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, L"alias", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, L"alias", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -257,7 +257,7 @@ ShellCommandRunAlias ( // Set volatile alias. // ASSERT (VolatileFlag); - ASSERT (!DeleteFlag); + ASSERT (!DeleteFlag); switch (ShellCommandLineGetCount (Package)) { case 1: case 2: diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/Cls.c b/ShellPkg/Library/UefiShellLevel3CommandsLib/Cls.c index 7e7d58d16c..459e08bc9b 100644 --- a/ShellPkg/Library/UefiShellLevel3CommandsLib/Cls.c +++ b/ShellPkg/Library/UefiShellLevel3CommandsLib/Cls.c @@ -3,7 +3,7 @@ (C) Copyright 2016 Hewlett Packard Enterprise Development LP
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -63,7 +63,7 @@ ShellCommandRunCls ( Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, L"cls", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, L"cls", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/Echo.c b/ShellPkg/Library/UefiShellLevel3CommandsLib/Echo.c index a638de8ce2..a10edb2abd 100644 --- a/ShellPkg/Library/UefiShellLevel3CommandsLib/Echo.c +++ b/ShellPkg/Library/UefiShellLevel3CommandsLib/Echo.c @@ -2,7 +2,7 @@ Main file for Echo shell level 3 function. (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -61,7 +61,7 @@ ShellCommandRunEcho ( Status = ShellCommandLineParseEx (ParamList, &Package, &ProblemParam, TRUE, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, L"echo", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, L"echo", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -104,7 +104,7 @@ ShellCommandRunEcho ( StrnCatGrow(&PrintString, &Size, ShellCommandLineGetRawValue(Package, ParamCount), 0); if (ShellCommandLineGetRawValue(Package, ParamCount+1) != NULL) { StrnCatGrow(&PrintString, &Size, L" ", 0); - } + } } ShellPrintEx(-1, -1, L"%s\r\n", PrintString); SHELL_FREE_NON_NULL(PrintString); diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/GetMtc.c b/ShellPkg/Library/UefiShellLevel3CommandsLib/GetMtc.c index 21c5bc81eb..6917fdce13 100644 --- a/ShellPkg/Library/UefiShellLevel3CommandsLib/GetMtc.c +++ b/ShellPkg/Library/UefiShellLevel3CommandsLib/GetMtc.c @@ -2,7 +2,7 @@ Main file for GetMtc shell level 3 function. (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -51,7 +51,7 @@ ShellCommandRunGetMtc ( Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, L"getmtc", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, L"getmtc", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -64,7 +64,7 @@ ShellCommandRunGetMtc ( if (ShellCommandLineGetFlag(Package, L"-?")) { ASSERT(FALSE); } else if (ShellCommandLineGetRawValue(Package, 1) != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel3HiiHandle, L"getmtc"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel3HiiHandle, L"getmtc"); ShellStatus = SHELL_INVALID_PARAMETER; } else { // diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/Help.c b/ShellPkg/Library/UefiShellLevel3CommandsLib/Help.c index f6159c1335..3740357a70 100644 --- a/ShellPkg/Library/UefiShellLevel3CommandsLib/Help.c +++ b/ShellPkg/Library/UefiShellLevel3CommandsLib/Help.c @@ -1,7 +1,7 @@ /** @file Main file for Help shell level 3 function. - Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
Copyright (c) 2014, ARM Limited. All rights reserved.
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.
@@ -27,7 +27,7 @@ the resultant list is a double NULL terminated list of NULL terminated strings. - upon successful return the memory must be caller freed (unless passed back in + upon successful return the memory must be caller freed (unless passed back in via a loop where it will get reallocated). @param[in,out] DestList double pointer to the list. may be NULL. @@ -38,7 +38,7 @@ **/ EFI_STATUS LexicalInsertIntoList( - IN OUT CHAR16 **DestList, + IN OUT CHAR16 **DestList, IN OUT UINTN *DestSize, IN CONST CHAR16 *Item ) @@ -116,7 +116,7 @@ LexicalInsertIntoList( **/ EFI_STATUS CopyListOfCommandNames( - IN OUT CHAR16 **DestList, + IN OUT CHAR16 **DestList, IN OUT UINTN *DestSize, IN CONST COMMAND_LIST *SourceList ) @@ -146,7 +146,7 @@ CopyListOfCommandNames( STATIC EFI_STATUS CopyListOfCommandNamesWithDynamic( - IN OUT CHAR16** DestList, + IN OUT CHAR16** DestList, IN OUT UINTN *DestSize ) { @@ -325,7 +325,7 @@ ShellCommandRunHelp ( Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, L"help", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, L"help", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -339,10 +339,10 @@ ShellCommandRunHelp ( &&ShellCommandLineGetFlag(Package, L"-section") &&(ShellCommandLineGetFlag(Package, L"-verbose") || ShellCommandLineGetFlag(Package, L"-v")) ){ - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CON), gShellLevel3HiiHandle, L"help"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CON), gShellLevel3HiiHandle, L"help"); ShellStatus = SHELL_INVALID_PARAMETER; } else if (ShellCommandLineGetRawValue(Package, 2) != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel3HiiHandle, L"help"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel3HiiHandle, L"help"); ShellStatus = SHELL_INVALID_PARAMETER; } else { // @@ -396,7 +396,7 @@ ShellCommandRunHelp ( CopyListOfCommandNames(&SortedCommandList, &SortedCommandListSize, ShellCommandGetCommandList(TRUE)); CopyListOfCommandNamesWithDynamic(&SortedCommandList, &SortedCommandListSize); - for (CurrentCommand = SortedCommandList + for (CurrentCommand = SortedCommandList ; CurrentCommand != NULL && CurrentCommand < SortedCommandList + SortedCommandListSize/sizeof(CHAR16) && *CurrentCommand != CHAR_NULL ; CurrentCommand += StrLen(CurrentCommand) + 1 ) { @@ -405,7 +405,7 @@ ShellCommandRunHelp ( // if (ShellGetExecutionBreakFlag ()) { break; - } + } if ((gUnicodeCollation->MetaiMatch(gUnicodeCollation, (CHAR16*)CurrentCommand, CommandToGetHelpOn)) || (gEfiShellProtocol->GetAlias(CommandToGetHelpOn, NULL) != NULL && (gUnicodeCollation->MetaiMatch(gUnicodeCollation, (CHAR16*)CurrentCommand, (CHAR16*)(gEfiShellProtocol->GetAlias(CommandToGetHelpOn, NULL)))))) { diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/Pause.c b/ShellPkg/Library/UefiShellLevel3CommandsLib/Pause.c index ab597060e2..7a24e50104 100644 --- a/ShellPkg/Library/UefiShellLevel3CommandsLib/Pause.c +++ b/ShellPkg/Library/UefiShellLevel3CommandsLib/Pause.c @@ -2,7 +2,7 @@ Main file for Pause shell level 3 function. (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -53,7 +53,7 @@ ShellCommandRunPause ( ASSERT_EFI_ERROR(Status); if (!gEfiShellProtocol->BatchIsActive()) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_NO_SCRIPT), gShellLevel3HiiHandle, L"pause"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_NO_SCRIPT), gShellLevel3HiiHandle, L"pause"); return (SHELL_UNSUPPORTED); } @@ -63,7 +63,7 @@ ShellCommandRunPause ( Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, L"pause", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, L"pause", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -76,7 +76,7 @@ ShellCommandRunPause ( if (ShellCommandLineGetFlag(Package, L"-?")) { ASSERT(FALSE); } else if (ShellCommandLineGetRawValue(Package, 1) != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel3HiiHandle, L"pause"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel3HiiHandle, L"pause"); ShellStatus = SHELL_INVALID_PARAMETER; } else { if (!ShellCommandLineGetFlag(Package, L"-q")) { diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/Touch.c b/ShellPkg/Library/UefiShellLevel3CommandsLib/Touch.c index 639346fb31..1e8f4bdb35 100644 --- a/ShellPkg/Library/UefiShellLevel3CommandsLib/Touch.c +++ b/ShellPkg/Library/UefiShellLevel3CommandsLib/Touch.c @@ -2,7 +2,7 @@ Main file for Touch shell level 3 function. (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -98,7 +98,7 @@ DoTouchByHandle ( // Status = TouchFileByHandle(Handle); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellLevel3HiiHandle, L"touch", Name); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellLevel3HiiHandle, L"touch", Name); return (Status); } @@ -128,7 +128,7 @@ DoTouchByHandle ( // Status = gEfiShellProtocol->OpenFileByName (Walker->FullName, &Walker->Handle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellLevel3HiiHandle, L"touch", Walker->FullName); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellLevel3HiiHandle, L"touch", Walker->FullName); Status = EFI_ACCESS_DENIED; } else { Status = DoTouchByHandle(Walker->FullName, FS, Walker->Handle, TRUE); @@ -196,7 +196,7 @@ ShellCommandRunTouch ( Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, L"touch", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, L"touch", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -213,7 +213,7 @@ ShellCommandRunTouch ( // // we insufficient parameters // - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel3HiiHandle, L"touch"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel3HiiHandle, L"touch"); ShellStatus = SHELL_INVALID_PARAMETER; } else { // @@ -226,7 +226,7 @@ ShellCommandRunTouch ( ){ Status = ShellOpenFileMetaArg((CHAR16*)Param, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE, &FileList); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellLevel3HiiHandle, L"touch", (CHAR16*)Param); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellLevel3HiiHandle, L"touch", (CHAR16*)Param); ShellStatus = SHELL_NOT_FOUND; break; } @@ -239,7 +239,7 @@ ShellCommandRunTouch ( // check that we have at least 1 file // if (FileList == NULL || IsListEmpty(&FileList->Link)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NF), gShellLevel3HiiHandle, L"touch", Param); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NF), gShellLevel3HiiHandle, L"touch", Param); continue; } else { // @@ -253,14 +253,14 @@ ShellCommandRunTouch ( // make sure the file opened ok // if (EFI_ERROR(Node->Status)){ - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellLevel3HiiHandle, L"touch", Node->FileName); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellLevel3HiiHandle, L"touch", Node->FileName); ShellStatus = SHELL_NOT_FOUND; continue; } Status = DoTouchByHandle(Node->FullName, NULL, Node->Handle, ShellCommandLineGetFlag(Package, L"-r")); if (EFI_ERROR(Status) && Status != EFI_ACCESS_DENIED) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellLevel3HiiHandle, L"touch", Node->FileName); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellLevel3HiiHandle, L"touch", Node->FileName); ShellStatus = SHELL_NOT_FOUND; } } diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/Type.c b/ShellPkg/Library/UefiShellLevel3CommandsLib/Type.c index 50d18e45aa..854c25a103 100644 --- a/ShellPkg/Library/UefiShellLevel3CommandsLib/Type.c +++ b/ShellPkg/Library/UefiShellLevel3CommandsLib/Type.c @@ -2,7 +2,7 @@ Main file for Type shell level 3 function. (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -83,7 +83,7 @@ TypeFileByHandle ( // // Allow Line Feed (LF) (0xA) & Carriage Return (CR) (0xD) // characters to be displayed as is. - // + // if (AsciiChar == '\n' && ((CHAR8*)Buffer)[LoopVar-1] != '\r') { // // In case Line Feed (0xA) is encountered & Carriage Return (0xD) @@ -114,7 +114,7 @@ TypeFileByHandle ( } else { LoopSize = ReadSize / (sizeof (CHAR16)); } - + for (LoopVar = 0 ; LoopVar < LoopSize ; LoopVar++) { // // An invalid range of characters is 0x0-0x1F. @@ -126,7 +126,7 @@ TypeFileByHandle ( // // Allow Line Feed (LF) (0xA) & Carriage Return (CR) (0xD) // characters to be displayed as is. - // + // if (Ucs2Char == '\n' && ((CHAR16*)Buffer)[LoopVar-1] != '\r') { // // In case Line Feed (0xA) is encountered & Carriage Return (0xD) @@ -137,7 +137,7 @@ TypeFileByHandle ( ShellPrintEx (-1, -1, L"\r\n"); continue; } - } + } else if (Ucs2Char < 0x20) { // // For all other characters which are not printable, display '.' @@ -207,7 +207,7 @@ ShellCommandRunType ( Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, L"type", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, L"type", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -224,13 +224,13 @@ ShellCommandRunType ( UnicodeMode = ShellCommandLineGetFlag(Package, L"-u"); if (AsciiMode && UnicodeMode) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellLevel3HiiHandle, L"type", L"-a & -u"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellLevel3HiiHandle, L"type", L"-a & -u"); ShellStatus = SHELL_INVALID_PARAMETER; } else if (ShellCommandLineGetRawValue(Package, 1) == NULL) { // // we insufficient parameters // - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel3HiiHandle, L"type"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel3HiiHandle, L"type"); ShellStatus = SHELL_INVALID_PARAMETER; } else { // @@ -243,7 +243,7 @@ ShellCommandRunType ( ){ Status = ShellOpenFileMetaArg((CHAR16*)Param, EFI_FILE_MODE_READ, &FileList); if (EFI_ERROR(Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellLevel3HiiHandle, L"type", (CHAR16*)Param); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellLevel3HiiHandle, L"type", (CHAR16*)Param); ShellStatus = SHELL_NOT_FOUND; break; } @@ -256,7 +256,7 @@ ShellCommandRunType ( // check that we have at least 1 file // if (FileList == NULL || IsListEmpty(&FileList->Link)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NF), gShellLevel3HiiHandle, L"type", Param); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NF), gShellLevel3HiiHandle, L"type", Param); continue; } else { // @@ -275,7 +275,7 @@ ShellCommandRunType ( // make sure the file opened ok // if (EFI_ERROR(Node->Status)){ - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellLevel3HiiHandle, L"type", Node->FileName); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellLevel3HiiHandle, L"type", Node->FileName); ShellStatus = SHELL_NOT_FOUND; continue; } @@ -284,7 +284,7 @@ ShellCommandRunType ( // make sure its not a directory // if (FileHandleIsDirectory(Node->Handle) == EFI_SUCCESS) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_IS_DIR), gShellLevel3HiiHandle, L"type", Node->FileName); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_IS_DIR), gShellLevel3HiiHandle, L"type", Node->FileName); ShellStatus = SHELL_NOT_FOUND; continue; } diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/Ver.c b/ShellPkg/Library/UefiShellLevel3CommandsLib/Ver.c index d0e2b5cb24..0bf79432fd 100644 --- a/ShellPkg/Library/UefiShellLevel3CommandsLib/Ver.c +++ b/ShellPkg/Library/UefiShellLevel3CommandsLib/Ver.c @@ -3,7 +3,7 @@ (C) Copyright 2016 Hewlett Packard Enterprise Development LP
(C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -64,7 +64,7 @@ ShellCommandRunVer ( Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, L"ver", ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, L"ver", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -81,7 +81,7 @@ ShellCommandRunVer ( // // we have too many parameters // - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel3HiiHandle, L"ver"); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel3HiiHandle, L"ver"); ShellStatus = SHELL_INVALID_PARAMETER; } else { if (ShellCommandLineGetFlag(Package, L"-s")) { diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c b/ShellPkg/Library/UefiShellLib/UefiShellLib.c index e53985e2d7..3c24ba1742 100644 --- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c +++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c @@ -2158,22 +2158,22 @@ InternalCommandLineParse ( } CurrentItemPackage->Value = NewValue; if (ValueSize == 0) { - StrCpyS( CurrentItemPackage->Value, - CurrentValueSize/sizeof(CHAR16), + StrCpyS( CurrentItemPackage->Value, + CurrentValueSize/sizeof(CHAR16), Argv[LoopCounter] ); } else { - StrCatS( CurrentItemPackage->Value, - CurrentValueSize/sizeof(CHAR16), + StrCatS( CurrentItemPackage->Value, + CurrentValueSize/sizeof(CHAR16), L" " ); - StrCatS( CurrentItemPackage->Value, - CurrentValueSize/sizeof(CHAR16), + StrCatS( CurrentItemPackage->Value, + CurrentValueSize/sizeof(CHAR16), Argv[LoopCounter] ); } ValueSize += StrSize(Argv[LoopCounter]) + sizeof(CHAR16); - + GetItemValue--; if (GetItemValue == 0) { InsertHeadList(*CheckPackage, &CurrentItemPackage->Link); @@ -2732,10 +2732,10 @@ InternalPrintTo ( return (gEfiShellProtocol->WriteFile(gEfiShellParametersProtocol->StdOut, &Size, (VOID*)String)); } if (mEfiShellInterface != NULL) { - if (mEfiShellInterface->RedirArgc == 0) { + if (mEfiShellInterface->RedirArgc == 0) { // // Divide in half for old shell. Must be string length not size. - // + // Size /=2; // Divide in half only when no redirection. } return (mEfiShellInterface->StdOut->Write(mEfiShellInterface->StdOut, &Size, (VOID*)String)); @@ -3173,7 +3173,7 @@ ShellHexStrToUintn( if (!EFI_ERROR(ShellConvertStringToUint64(String, &RetVal, TRUE, TRUE))) { return ((UINTN)RetVal); } - + return ((UINTN)(-1)); } @@ -3312,7 +3312,7 @@ StrnCatGrow ( if (*Destination == NULL) { return (NULL); } - + StrnCatS(*Destination, NewSize/sizeof(CHAR16), Source, Count); return *Destination; } @@ -3944,7 +3944,7 @@ InternalShellStrDecimalToUint64 ( Result = 0; // - // Stop upon space if requested + // Stop upon space if requested // (if the whole value was 0) // if (StopAtSpace && *String == L' ') { @@ -4255,7 +4255,7 @@ ShellFileHandleReadLine( @param[in] CommandToGetHelpOn Pointer to a string containing the command name of help file to be printed. @param[in] SectionToGetHelpOn Pointer to the section specifier(s). - @param[in] PrintCommandText If TRUE, prints the command followed by the help content, otherwise prints + @param[in] PrintCommandText If TRUE, prints the command followed by the help content, otherwise prints the help content only. @retval EFI_DEVICE_ERROR The help data format was incorrect. @retval EFI_NOT_FOUND The help data could not be found. @@ -4269,33 +4269,33 @@ ShellPrintHelp ( IN BOOLEAN PrintCommandText ) { - EFI_STATUS Status; - CHAR16 *OutText; - - OutText = NULL; - + EFI_STATUS Status; + CHAR16 *OutText; + + OutText = NULL; + // // Get the string to print based // - Status = gEfiShellProtocol->GetHelpText (CommandToGetHelpOn, SectionToGetHelpOn, &OutText); - + Status = gEfiShellProtocol->GetHelpText (CommandToGetHelpOn, SectionToGetHelpOn, &OutText); + // // make sure we got a valid string // if (EFI_ERROR(Status)){ return Status; - } + } if (OutText == NULL || StrLen(OutText) == 0) { - return EFI_NOT_FOUND; - } - + return EFI_NOT_FOUND; + } + // // Chop off trailing stuff we dont need // while (OutText[StrLen(OutText)-1] == L'\r' || OutText[StrLen(OutText)-1] == L'\n' || OutText[StrLen(OutText)-1] == L' ') { OutText[StrLen(OutText)-1] = CHAR_NULL; } - + // // Print this out to the console // @@ -4304,17 +4304,17 @@ ShellPrintHelp ( } else { ShellPrintEx(-1, -1, L"%N%s\r\n", OutText); } - + SHELL_FREE_NON_NULL(OutText); - return EFI_SUCCESS; + return EFI_SUCCESS; } /** Function to delete a file by name - + @param[in] FileName Pointer to file name to delete. - + @retval EFI_SUCCESS the file was deleted sucessfully @retval EFI_WARN_DELETE_FAILURE the handle was closed, but the file was not deleted @@ -4341,26 +4341,26 @@ ShellDeleteFileByName( { EFI_STATUS Status; SHELL_FILE_HANDLE FileHandle; - + Status = ShellFileExists(FileName); - + if (Status == EFI_SUCCESS){ Status = ShellOpenFileByName(FileName, &FileHandle, EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE | EFI_FILE_MODE_CREATE, 0x0); if (Status == EFI_SUCCESS){ Status = ShellDeleteFile(&FileHandle); } - } + } return(Status); - + } /** Cleans off all the quotes in the string. @param[in] OriginalString pointer to the string to be cleaned. - @param[out] CleanString The new string with all quotes removed. - Memory allocated in the function and free + @param[out] CleanString The new string with all quotes removed. + Memory allocated in the function and free by caller. @retval EFI_SUCCESS The operation was successful. @@ -4372,7 +4372,7 @@ InternalShellStripQuotes ( ) { CHAR16 *Walker; - + if (OriginalString == NULL || CleanString == NULL) { return EFI_INVALID_PARAMETER; } diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.h b/ShellPkg/Library/UefiShellLib/UefiShellLib.h index fca6b7b7e2..97ea1db57a 100644 --- a/ShellPkg/Library/UefiShellLib/UefiShellLib.h +++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.h @@ -2,7 +2,7 @@ Provides interface to shell functionality for shell commands and applications. (C) Copyright 2016 Hewlett Packard Enterprise Development LP
- Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -79,8 +79,8 @@ InternalShellIsHexOrDecimalNumber ( Cleans off all the quotes in the string. @param[in] OriginalString pointer to the string to be cleaned. - @param[out] CleanString The new string with all quotes removed. - Memory allocated in the function and free + @param[out] CleanString The new string with all quotes removed. + Memory allocated in the function and free by caller. @retval EFI_SUCCESS The operation was successful. diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c index ab6ab8b57e..52415e0ad0 100644 --- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c +++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c @@ -2,7 +2,7 @@ The implementation for Shell command ifconfig based on IP4Config2 protocol. (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
+ Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -45,7 +45,7 @@ typedef struct _IFCONFIG_INTERFACE_CB { EFI_HANDLE NicHandle; LIST_ENTRY Link; EFI_IP4_CONFIG2_PROTOCOL *IfCfg; - EFI_IP4_CONFIG2_INTERFACE_INFO *IfInfo; + EFI_IP4_CONFIG2_INTERFACE_INFO *IfInfo; EFI_IP4_CONFIG2_POLICY Policy; UINT32 DnsCnt; EFI_IPv4_ADDRESS DnsAddr[1]; @@ -399,7 +399,7 @@ IfConfigGetInterfaceInfo ( if (EFI_ERROR (Status)) { goto ON_ERROR; } - + // // Get the interface information size. // @@ -420,7 +420,7 @@ IfConfigGetInterfaceInfo ( Status = EFI_OUT_OF_RESOURCES; goto ON_ERROR; } - + // // Get the interface info. // @@ -434,7 +434,7 @@ IfConfigGetInterfaceInfo ( if (EFI_ERROR (Status)) { goto ON_ERROR; } - + // // Check the interface name if required. // @@ -444,7 +444,7 @@ IfConfigGetInterfaceInfo ( } DataSize = 0; - + // // Get the size of dns server list. // @@ -553,7 +553,7 @@ IfConfigShowInterfaceInfo ( EFI_STATUS MediaStatus; EFI_IPv4_ADDRESS Gateway; UINT32 Index; - + MediaStatus = EFI_SUCCESS; if (IsListEmpty (IfList)) { @@ -571,7 +571,7 @@ IfConfigShowInterfaceInfo ( // // Print interface name. // - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG_INFO_IF_NAME), gShellNetwork1HiiHandle, IfCb->IfInfo->Name); + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG_INFO_IF_NAME), gShellNetwork1HiiHandle, IfCb->IfInfo->Name); // // Get Media State. @@ -611,10 +611,10 @@ IfConfigShowInterfaceInfo ( ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG_INFO_IP_ADDR_HEAD), gShellNetwork1HiiHandle); ShellPrintHiiEx( - -1, - -1, + -1, + -1, NULL, - STRING_TOKEN (STR_IFCONFIG_INFO_IP_ADDR_BODY), + STRING_TOKEN (STR_IFCONFIG_INFO_IP_ADDR_BODY), gShellNetwork1HiiHandle, (UINTN)IfCb->IfInfo->StationAddress.Addr[0], (UINTN)IfCb->IfInfo->StationAddress.Addr[1], @@ -628,10 +628,10 @@ IfConfigShowInterfaceInfo ( ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG_INFO_SUBNET_MASK_HEAD), gShellNetwork1HiiHandle); ShellPrintHiiEx( - -1, - -1, + -1, + -1, NULL, - STRING_TOKEN (STR_IFCONFIG_INFO_IP_ADDR_BODY), + STRING_TOKEN (STR_IFCONFIG_INFO_IP_ADDR_BODY), gShellNetwork1HiiHandle, (UINTN)IfCb->IfInfo->SubnetMask.Addr[0], (UINTN)IfCb->IfInfo->SubnetMask.Addr[1], @@ -645,26 +645,26 @@ IfConfigShowInterfaceInfo ( ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG_INFO_GATEWAY_HEAD), gShellNetwork1HiiHandle); ZeroMem (&Gateway, sizeof (EFI_IPv4_ADDRESS)); - + for (Index = 0; Index < IfCb->IfInfo->RouteTableSize; Index++) { if ((CompareMem (&IfCb->IfInfo->RouteTable[Index].SubnetAddress, &mZeroIp4Addr, sizeof (EFI_IPv4_ADDRESS)) == 0) && (CompareMem (&IfCb->IfInfo->RouteTable[Index].SubnetMask , &mZeroIp4Addr, sizeof (EFI_IPv4_ADDRESS)) == 0) ){ CopyMem (&Gateway, &IfCb->IfInfo->RouteTable[Index].GatewayAddress, sizeof (EFI_IPv4_ADDRESS)); } - } + } ShellPrintHiiEx( - -1, - -1, + -1, + -1, NULL, - STRING_TOKEN (STR_IFCONFIG_INFO_IP_ADDR_BODY), + STRING_TOKEN (STR_IFCONFIG_INFO_IP_ADDR_BODY), gShellNetwork1HiiHandle, (UINTN)Gateway.Addr[0], (UINTN)Gateway.Addr[1], (UINTN)Gateway.Addr[2], (UINTN)Gateway.Addr[3] ); - + // // Print route table entry. // @@ -674,11 +674,11 @@ IfConfigShowInterfaceInfo ( ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_IFCONFIG_ROUTES_ENTRY_INDEX), gShellNetwork1HiiHandle, Index); ShellPrintHiiEx( - -1, - -1, + -1, + -1, NULL, - STRING_TOKEN (STR_IFCONFIG_SHOW_IP_ADDR), - gShellNetwork1HiiHandle, + STRING_TOKEN (STR_IFCONFIG_SHOW_IP_ADDR), + gShellNetwork1HiiHandle, L"Subnet ", (UINTN)IfCb->IfInfo->RouteTable[Index].SubnetAddress.Addr[0], (UINTN)IfCb->IfInfo->RouteTable[Index].SubnetAddress.Addr[1], @@ -687,11 +687,11 @@ IfConfigShowInterfaceInfo ( ); ShellPrintHiiEx( - -1, - -1, + -1, + -1, NULL, - STRING_TOKEN (STR_IFCONFIG_SHOW_IP_ADDR), - gShellNetwork1HiiHandle, + STRING_TOKEN (STR_IFCONFIG_SHOW_IP_ADDR), + gShellNetwork1HiiHandle, L"Netmask", (UINTN)IfCb->IfInfo->RouteTable[Index].SubnetMask.Addr[0], (UINTN)IfCb->IfInfo->RouteTable[Index].SubnetMask.Addr[1], @@ -700,11 +700,11 @@ IfConfigShowInterfaceInfo ( ); ShellPrintHiiEx( - -1, - -1, + -1, + -1, NULL, - STRING_TOKEN (STR_IFCONFIG_SHOW_IP_ADDR), - gShellNetwork1HiiHandle, + STRING_TOKEN (STR_IFCONFIG_SHOW_IP_ADDR), + gShellNetwork1HiiHandle, L"Gateway", (UINTN)IfCb->IfInfo->RouteTable[Index].GatewayAddress.Addr[0], (UINTN)IfCb->IfInfo->RouteTable[Index].GatewayAddress.Addr[1], @@ -720,10 +720,10 @@ IfConfigShowInterfaceInfo ( for (Index = 0; Index < IfCb->DnsCnt; Index++) { ShellPrintHiiEx( - -1, - -1, + -1, + -1, NULL, - STRING_TOKEN (STR_IFCONFIG_INFO_DNS_ADDR_BODY), + STRING_TOKEN (STR_IFCONFIG_INFO_DNS_ADDR_BODY), gShellNetwork1HiiHandle, (UINTN) IfCb->DnsAddr[Index].Addr[0], (UINTN) IfCb->DnsAddr[Index].Addr[1], @@ -734,7 +734,7 @@ IfConfigShowInterfaceInfo ( ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG_INFO_NEWLINE), gShellNetwork1HiiHandle); } } - + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG_INFO_BREAK), gShellNetwork1HiiHandle); return SHELL_SUCCESS; @@ -756,13 +756,13 @@ IfConfigClearInterfaceInfo ( IN CHAR16 *IfName ) { - EFI_STATUS Status; + EFI_STATUS Status; SHELL_STATUS ShellStatus; LIST_ENTRY *Entry; LIST_ENTRY *Next; IFCONFIG_INTERFACE_CB *IfCb; EFI_IP4_CONFIG2_POLICY Policy; - + Status = EFI_SUCCESS; ShellStatus = SHELL_SUCCESS; @@ -772,7 +772,7 @@ IfConfigClearInterfaceInfo ( // // Go through the interface list. - // If the interface name is specified, DHCP DORA process will be + // If the interface name is specified, DHCP DORA process will be // triggered by the policy transition (static -> dhcp). // NET_LIST_FOR_EACH_SAFE (Entry, Next, IfList) { @@ -780,7 +780,7 @@ IfConfigClearInterfaceInfo ( if ((IfName != NULL) && (StrCmp (IfName, IfCb->IfInfo->Name) == 0)) { Policy = Ip4Config2PolicyStatic; - + Status = IfCb->IfCfg->SetData ( IfCb->IfCfg, Ip4Config2DataTypePolicy, @@ -791,11 +791,11 @@ IfConfigClearInterfaceInfo ( ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD), gShellNetwork1HiiHandle, L"ifconfig"); ShellStatus = SHELL_ACCESS_DENIED; break; - } + } } Policy = Ip4Config2PolicyDhcp; - + Status = IfCb->IfCfg->SetData ( IfCb->IfCfg, Ip4Config2DataTypePolicy, @@ -854,7 +854,7 @@ IfConfigSetInterfaceInfo ( ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG_INVALID_INTERFACE), gShellNetwork1HiiHandle); return SHELL_INVALID_PARAMETER; } - + // // Make sure to set only one interface each time. // @@ -944,7 +944,7 @@ IfConfigSetInterfaceInfo ( } VarArg = VarArg->Next; - continue; + continue; } // @@ -966,8 +966,8 @@ IfConfigSetInterfaceInfo ( ShellStatus = SHELL_ACCESS_DENIED; goto ON_EXIT; } - - VarArg= VarArg->Next; + + VarArg= VarArg->Next; } else if (StrCmp (VarArg->Arg, L"static") == 0) { VarArg= VarArg->Next; @@ -978,7 +978,7 @@ IfConfigSetInterfaceInfo ( } ZeroMem (&ManualAddress, sizeof (ManualAddress)); - + // // Get manual IP address. // @@ -991,14 +991,14 @@ IfConfigSetInterfaceInfo ( // // Get subnetmask. - // + // VarArg = VarArg->Next; if (VarArg == NULL) { ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG_LACK_COMMAND), gShellNetwork1HiiHandle); ShellStatus = SHELL_INVALID_PARAMETER; goto ON_EXIT; } - + Status = NetLibStrToIp4 (VarArg->Arg, &ManualAddress.SubnetMask); if (EFI_ERROR(Status)) { ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_IFCONFIG_INVALID_IPADDRESS), gShellNetwork1HiiHandle, VarArg->Arg); @@ -1015,7 +1015,7 @@ IfConfigSetInterfaceInfo ( ShellStatus = SHELL_INVALID_PARAMETER; goto ON_EXIT; } - + Status = NetLibStrToIp4 (VarArg->Arg, &Gateway); if (EFI_ERROR(Status)) { ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_IFCONFIG_INVALID_IPADDRESS), gShellNetwork1HiiHandle, VarArg->Arg); @@ -1053,7 +1053,7 @@ IfConfigSetInterfaceInfo ( ShellStatus = SHELL_ACCESS_DENIED; goto ON_EXIT; } - + // // Set Manual Address. // @@ -1095,7 +1095,7 @@ IfConfigSetInterfaceInfo ( Ip4Config2DataTypeManualAddress, MappedEvt ); - + if (EFI_ERROR (Status)) { ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG_SET_ADDR_FAILED), gShellNetwork1HiiHandle, Status); ShellStatus = SHELL_ACCESS_DENIED; @@ -1118,9 +1118,9 @@ IfConfigSetInterfaceInfo ( ShellStatus = SHELL_ACCESS_DENIED; goto ON_EXIT; } - + VarArg = VarArg->Next; - + } else if (StrCmp (VarArg->Arg, L"dns") == 0) { // // Get DNS addresses. @@ -1151,7 +1151,7 @@ IfConfigSetInterfaceInfo ( Index ++; Tmp = Tmp->Next; } - + VarArg = Tmp; // @@ -1177,7 +1177,7 @@ ON_EXIT: if (Dns != NULL) { FreePool (Dns); } - + return ShellStatus; } @@ -1209,7 +1209,7 @@ IfConfig ( &Private->IfList ); if (EFI_ERROR (Status)) { - ShellStatus = SHELL_NOT_FOUND; + ShellStatus = SHELL_NOT_FOUND; goto ON_EXIT; } @@ -1289,7 +1289,7 @@ IfConfigCleanup ( @retval EFI_SUCCESS ifconfig command processed successfully. @retval others The ifconfig command process failed. - + **/ SHELL_STATUS EFIAPI @@ -1306,7 +1306,7 @@ ShellCommandRunIfconfig ( ARG_LIST *ArgList; CHAR16 *ProblemParam; CHAR16 *Str; - + Status = EFI_INVALID_PARAMETER; Private = NULL; ShellStatus = SHELL_SUCCESS; @@ -1320,7 +1320,7 @@ ShellCommandRunIfconfig ( } else { ASSERT(FALSE); } - + goto ON_EXIT; } @@ -1395,7 +1395,7 @@ ShellCommandRunIfconfig ( Private->IfName = Str; } } - + // // To get interface name and corresponding Args for the set option. // @@ -1406,7 +1406,7 @@ ShellCommandRunIfconfig ( ShellStatus = SHELL_INVALID_PARAMETER; goto ON_EXIT; } - + // // To split the configuration into multi-section. // @@ -1428,7 +1428,7 @@ ShellCommandRunIfconfig ( goto ON_EXIT; } } - + // // Main process of ifconfig. // @@ -1437,7 +1437,7 @@ ShellCommandRunIfconfig ( ON_EXIT: ShellCommandLineFreeVarList (ParamPackage); - + if (Private != NULL) { IfConfigCleanup (Private); } diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c index 46ba701fc5..af7cadeb6f 100644 --- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c +++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c @@ -2,7 +2,7 @@ The implementation for Ping shell command. (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
(C) Copyright 2016 Hewlett Packard Enterprise Development LP
This program and the accompanying materials @@ -24,25 +24,25 @@ UINT64 mCurrentTick = 0; // // Function templates to match the IPv4 and IPv6 commands that we use. // -typedef +typedef EFI_STATUS (EFIAPI *PING_IPX_POLL)( IN VOID *This - ); + ); -typedef +typedef EFI_STATUS (EFIAPI *PING_IPX_TRANSMIT)( IN VOID *This, IN VOID *Token ); -typedef +typedef EFI_STATUS (EFIAPI *PING_IPX_RECEIVE)( IN VOID *This, IN VOID *Token - ); + ); typedef EFI_STATUS @@ -52,7 +52,7 @@ EFI_STATUS ); /// -/// A set of pointers to either IPv6 or IPv4 functions. +/// A set of pointers to either IPv6 or IPv4 functions. /// Unknown which one to the ping command. /// typedef struct { @@ -70,7 +70,7 @@ typedef union { // // PING_IPX_COMPLETION_TOKEN -// structures are used for both transmit and receive operations. +// structures are used for both transmit and receive operations. // This version is IP-unaware. // typedef struct { @@ -119,7 +119,7 @@ typedef struct _PING_PRIVATE_DATA { EFI_EVENT Timer; UINT32 TimerPeriod; - UINT32 RttTimerTick; + UINT32 RttTimerTick; EFI_EVENT RttTimer; EFI_STATUS Status; @@ -149,7 +149,7 @@ typedef struct _PING_PRIVATE_DATA { @param[in] Packet Buffer which contains the data to be checksummed. @param[in] Length Length to be checksummed. - @retval Checksum Returns the 16 bit ones complement of + @retval Checksum Returns the 16 bit ones complement of ones complement sum of 16 bit words **/ UINT16 @@ -325,7 +325,7 @@ PingInitRttTimer ( if (Private->TimerPeriod == 0) { return EFI_ABORTED; } - + Private->RttTimerTick = 0; Status = gBS->CreateEvent ( EVT_TIMER | EVT_NOTIFY_SIGNAL, @@ -370,7 +370,7 @@ PingFreeRttTimer ( /** Read the current time. - + @param[in] Private The pointer to PING_PRIVATE_DATA. @retval the current tick value. @@ -563,7 +563,7 @@ Ping6OnEchoReplyReceived ( if (((EFI_IP6_RECEIVE_DATA*)Private->RxToken.Packet.RxData)->Header->NextHeader != IP6_ICMP) { goto ON_EXIT; } - if (!IP6_IS_MULTICAST ((EFI_IPv6_ADDRESS*)&Private->DstAddress) && + if (!IP6_IS_MULTICAST ((EFI_IPv6_ADDRESS*)&Private->DstAddress) && !EFI_IP6_EQUAL (&((EFI_IP6_RECEIVE_DATA*)Private->RxToken.Packet.RxData)->Header->SourceAddress, (EFI_IPv6_ADDRESS*)&Private->DstAddress)) { goto ON_EXIT; } @@ -574,7 +574,7 @@ Ping6OnEchoReplyReceived ( } else { Reply = ((EFI_IP4_RECEIVE_DATA*)Private->RxToken.Packet.RxData)->FragmentTable[0].FragmentBuffer; PayLoad = ((EFI_IP4_RECEIVE_DATA*)Private->RxToken.Packet.RxData)->DataLength; - if (!IP4_IS_MULTICAST (EFI_IP4(*(EFI_IPv4_ADDRESS*)Private->DstAddress)) && + if (!IP4_IS_MULTICAST (EFI_IP4(*(EFI_IPv4_ADDRESS*)Private->DstAddress)) && !EFI_IP4_EQUAL (&((EFI_IP4_RECEIVE_DATA*)Private->RxToken.Packet.RxData)->Header->SourceAddress, (EFI_IPv4_ADDRESS*)&Private->DstAddress)) { goto ON_EXIT; } @@ -583,7 +583,7 @@ Ping6OnEchoReplyReceived ( goto ON_EXIT; } } - + if (PayLoad != Private->BufferSize) { goto ON_EXIT; @@ -689,7 +689,7 @@ PingGenerateToken ( // Request->Type = (UINT8)(Private->IpChoice==PING_IP_CHOICE_IP6?ICMP_V6_ECHO_REQUEST:ICMP_V4_ECHO_REQUEST); Request->Code = 0; - Request->SequenceNum = SequenceNum; + Request->SequenceNum = SequenceNum; Request->Identifier = 0; Request->Checksum = 0; @@ -1003,11 +1003,11 @@ PingCreateIpInstance ( if (Private->IpChoice == PING_IP_CHOICE_IP6 ? NetIp6IsUnspecifiedAddr ((EFI_IPv6_ADDRESS*)&Private->SrcAddress) : \ PingNetIp4IsUnspecifiedAddr ((EFI_IPv4_ADDRESS*)&Private->SrcAddress)) { // - // SrcAddress is unspecified. So, both connected and configured interface will be automatic selected. + // SrcAddress is unspecified. So, both connected and configured interface will be automatic selected. // UnspecifiedSrc = TRUE; } - + // // Source address is required when pinging a link-local address. // @@ -1020,12 +1020,12 @@ PingCreateIpInstance ( } else { ASSERT(Private->IpChoice == PING_IP_CHOICE_IP4); if (PingNetIp4IsLinkLocalAddr ((EFI_IPv4_ADDRESS*)&Private->DstAddress) && UnspecifiedSrc) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING_INVALID_SOURCE), gShellNetwork1HiiHandle); + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING_INVALID_SOURCE), gShellNetwork1HiiHandle); Status = EFI_INVALID_PARAMETER; goto ON_ERROR; } } - + // // For each ip6 protocol, check interface addresses list. // @@ -1087,7 +1087,7 @@ PingCreateIpInstance ( NULL ); } - + // // Skip the ones not in current use. // @@ -1160,7 +1160,7 @@ PingCreateIpInstance ( } } else { if (UnspecifiedSrc) { - if (!PingNetIp4IsUnspecifiedAddr (&((EFI_IP4_CONFIG2_INTERFACE_INFO*)IpXInterfaceInfo)->StationAddress) && + if (!PingNetIp4IsUnspecifiedAddr (&((EFI_IP4_CONFIG2_INTERFACE_INFO*)IpXInterfaceInfo)->StationAddress) && !PingNetIp4IsLinkLocalAddr (&((EFI_IP4_CONFIG2_INTERFACE_INFO*)IpXInterfaceInfo)->StationAddress)) { // // Select the interface automatically. @@ -1183,7 +1183,7 @@ PingCreateIpInstance ( // if (HandleIndex == HandleNum) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING_CONFIGD_NIC_NF), gShellNetwork1HiiHandle, L"ping"); + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING_CONFIGD_NIC_NF), gShellNetwork1HiiHandle, L"ping"); Status = EFI_NOT_FOUND; goto ON_ERROR; } @@ -1281,7 +1281,7 @@ PingCreateIpInstance ( Private->ProtocolPointers.Transmit = (PING_IPX_TRANSMIT )((EFI_IP4_PROTOCOL*)Private->IpProtocol)->Transmit; Private->ProtocolPointers.Receive = (PING_IPX_RECEIVE )((EFI_IP4_PROTOCOL*)Private->IpProtocol)->Receive; Private->ProtocolPointers.Cancel = (PING_IPX_CANCEL )((EFI_IP4_PROTOCOL*)Private->IpProtocol)->Cancel; - Private->ProtocolPointers.Poll = (PING_IPX_POLL )((EFI_IP4_PROTOCOL*)Private->IpProtocol)->Poll; + Private->ProtocolPointers.Poll = (PING_IPX_POLL )((EFI_IP4_PROTOCOL*)Private->IpProtocol)->Poll; } if (HandleBuffer != NULL) { @@ -1432,7 +1432,7 @@ ShellPing ( ShellStatus = SHELL_ACCESS_DENIED; goto ON_EXIT; } - + // // Create a ipv6 token to send the first icmp6 echo request packet. // @@ -1447,7 +1447,7 @@ ShellPing ( } else if (Status == RETURN_NO_MAPPING) { ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING_NOROUTE_FOUND), gShellNetwork1HiiHandle, mDstString, mSrcString); } else { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING_NETWORK_ERROR), gShellNetwork1HiiHandle, L"ping", Status); + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING_NETWORK_ERROR), gShellNetwork1HiiHandle, L"ping", Status); } goto ON_EXIT; @@ -1562,7 +1562,7 @@ ON_EXIT: @retval SHELL_SUCCESS The ping processed successfullly. @retval others The ping processed unsuccessfully. - + **/ SHELL_STATUS EFIAPI @@ -1584,7 +1584,7 @@ ShellCommandRunPing ( CHAR16 *ProblemParam; // - // we use IPv6 buffers to hold items... + // we use IPv6 buffers to hold items... // make sure this is enough space! // ASSERT(sizeof(EFI_IPv4_ADDRESS ) <= sizeof(EFI_IPv6_ADDRESS )); @@ -1617,7 +1617,7 @@ ShellCommandRunPing ( // ShellStrToUintn will return 0 when input is 0 or an invalid input string. // if ((SendNumber == 0) || (SendNumber > MAX_SEND_NUMBER)) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellNetwork1HiiHandle, L"ping", ValueStr); + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellNetwork1HiiHandle, L"ping", ValueStr); ShellStatus = SHELL_INVALID_PARAMETER; goto ON_EXIT; } @@ -1635,7 +1635,7 @@ ShellCommandRunPing ( // ShellStrToUintn will return 0 when input is 0 or an invalid input string. // if ((BufferSize < 16) || (BufferSize > MAX_BUFFER_SIZE)) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellNetwork1HiiHandle, L"ping", ValueStr); + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellNetwork1HiiHandle, L"ping", ValueStr); ShellStatus = SHELL_INVALID_PARAMETER; goto ON_EXIT; } @@ -1653,7 +1653,7 @@ ShellCommandRunPing ( if (ValueStr == NULL) { ValueStr = ShellCommandLineGetValue (ParamPackage, L"-_s"); } - + if (ValueStr != NULL) { mSrcString = ValueStr; if (IpChoice == PING_IP_CHOICE_IP6) { @@ -1662,7 +1662,7 @@ ShellCommandRunPing ( Status = NetLibStrToIp4 (ValueStr, (EFI_IPv4_ADDRESS*)&SrcAddress); } if (EFI_ERROR (Status)) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellNetwork1HiiHandle, L"ping", ValueStr); + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellNetwork1HiiHandle, L"ping", ValueStr); ShellStatus = SHELL_INVALID_PARAMETER; goto ON_EXIT; } @@ -1672,12 +1672,12 @@ ShellCommandRunPing ( // NonOptionCount = ShellCommandLineGetCount(ParamPackage); if (NonOptionCount < 2) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellNetwork1HiiHandle, L"ping"); + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellNetwork1HiiHandle, L"ping"); ShellStatus = SHELL_INVALID_PARAMETER; goto ON_EXIT; } if (NonOptionCount > 2) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellNetwork1HiiHandle, L"ping"); + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellNetwork1HiiHandle, L"ping"); ShellStatus = SHELL_INVALID_PARAMETER; goto ON_EXIT; } @@ -1690,7 +1690,7 @@ ShellCommandRunPing ( Status = NetLibStrToIp4 (ValueStr, (EFI_IPv4_ADDRESS*)&DstAddress); } if (EFI_ERROR (Status)) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellNetwork1HiiHandle, L"ping", ValueStr); + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellNetwork1HiiHandle, L"ping", ValueStr); ShellStatus = SHELL_INVALID_PARAMETER; goto ON_EXIT; } diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf b/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf index ffa6778848..5914068d72 100644 --- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf +++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf @@ -1,7 +1,7 @@ ## @file # Provides shell network1 functions # -# Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
+# Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -63,6 +63,6 @@ gEfiIp4ProtocolGuid ## SOMETIMES_CONSUMES gEfiIp4ServiceBindingProtocolGuid ## SOMETIMES_CONSUMES gEfiIp4Config2ProtocolGuid ## SOMETIMES_CONSUMES - + [Guids] - gShellNetwork1HiiGuid ## SOMETIMES_CONSUMES ## HII \ No newline at end of file + gShellNetwork1HiiGuid ## SOMETIMES_CONSUMES ## HII diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.uni b/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.uni index 7a43ad510a..ba549d36c8 100644 --- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.uni +++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.uni @@ -1,7 +1,7 @@ // /** // // (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
-// Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
+// Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
// (C) Copyright 2017 Hewlett Packard Enterprise Development LP
// This program and the accompanying materials // are licensed and made available under the terms and conditions of the BSD License @@ -73,7 +73,7 @@ #string STR_IFCONFIG_CONFLICT_COMMAND #language en-US "Conflict commands. Bad command %H%s%N is skipped.\n" #string STR_IFCONFIG_UNKNOWN_COMMAND #language en-US "Unknown commands. Bad command %H%s%N is skipped.\n" #string STR_IFCONFIG_SET_ADDR_FAILED #language en-US "Failed to set address.\n" -#string STR_IFCONFIG_ROUTES_SIZE #language en-US "\n%H Routes (%d entries):\n" +#string STR_IFCONFIG_ROUTES_SIZE #language en-US "\n%H Routes (%d entries):\n" #string STR_IFCONFIG_ROUTES_ENTRY_INDEX #language en-US "%H Entry[%d]\n" #string STR_IFCONFIG_SHOW_IP_ADDR #language en-US "%12s: %N%d.%d.%d.%d\n" #string STR_IFCONFIG_INFO_NEWLINE #language en-US "\n" @@ -177,6 +177,6 @@ " \r\n" " * To configure DNS server address for the eth0 interface:\r\n" " fs0:\> ifconfig -s eth0 dns 192.168.0.8 192.168.0.9\r\n" - + diff --git a/ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c b/ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c index 2cdf484c06..27713cf127 100644 --- a/ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c +++ b/ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c @@ -1,7 +1,7 @@ /** @file The implementation for Ping6 application. - Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.
+ Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -50,7 +50,7 @@ typedef struct _PING6_PRIVATE_DATA { EFI_EVENT Timer; UINT32 TimerPeriod; - UINT32 RttTimerTick; + UINT32 RttTimerTick; EFI_EVENT RttTimer; EFI_STATUS Status; @@ -199,7 +199,7 @@ Ping6InitRttTimer ( if (Private->TimerPeriod == 0) { return EFI_ABORTED; } - + Private->RttTimerTick = 0; Status = gBS->CreateEvent ( EVT_TIMER | EVT_NOTIFY_SIGNAL, @@ -245,7 +245,7 @@ Ping6FreeRttTimer ( /** Read the current time. - + @param[in] Private The pointer to PING6_PRIVATE_DATA. @retval the current tick value. @@ -787,11 +787,11 @@ Ping6CreateIpInstance ( if (NetIp6IsUnspecifiedAddr (&Private->SrcAddress)) { // - // SrcAddress is unspecified. So, both connected and configured interface will be automatic selected. + // SrcAddress is unspecified. So, both connected and configured interface will be automatic selected. // UnspecifiedSrc = TRUE; } - + // // Source address is required when pinging a link-local address. // @@ -800,7 +800,7 @@ Ping6CreateIpInstance ( Status = EFI_INVALID_PARAMETER; goto ON_ERROR; } - + // // For each ip6 protocol, check interface addresses list. // @@ -899,7 +899,7 @@ Ping6CreateIpInstance ( // Match a certain interface address. // break; - } + } } if (AddrIndex < IfInfo->AddressInfoCount) { diff --git a/ShellPkg/ShellPkg.dec b/ShellPkg/ShellPkg.dec index c090aa4d08..57e0a64825 100644 --- a/ShellPkg/ShellPkg.dec +++ b/ShellPkg/ShellPkg.dec @@ -105,7 +105,7 @@ ## This determines how many bytes are read out of files at a time for file operations (type, copy, etc...) gEfiShellPkgTokenSpaceGuid.PcdShellFileOperationSize|0x1000|UINT32|0x0000000A - + ## This determines the max count of history commands gEfiShellPkgTokenSpaceGuid.PcdShellMaxHistoryCommandCount|0x0020|UINT16|0x00000014