Changeset 80721 in vbox for trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell
- Timestamp:
- Sep 11, 2019 8:46:37 AM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 133262
- Location:
- trunk/src/VBox/Devices/EFI/FirmwareNew
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/FirmwareNew
-
Property svn:mergeinfo
changed from (toggle deleted branches)
to (toggle deleted branches)/vendor/edk2/current 103735-103757,103769-103776,129194-129237 /vendor/edk2/current 103735-103757,103769-103776,129194-133213
-
Property svn:mergeinfo
changed from (toggle deleted branches)
-
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/ConsoleLogger.c
r77662 r80721 5 5 Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR> 6 6 (C) Copyright 2016 Hewlett-Packard Development Company, L.P.<BR> 7 This program and the accompanying materials 8 are licensed and made available under the terms and conditions of the BSD License 9 which accompanies this distribution. The full text of the license may be found at 10 http://opensource.org/licenses/bsd-license.php 11 12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 7 SPDX-License-Identifier: BSD-2-Clause-Patent 14 8 **/ 15 9 -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/ConsoleLogger.h
r77662 r80721 3 3 4 4 Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR> 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 5 SPDX-License-Identifier: BSD-2-Clause-Patent 12 6 **/ 13 7 -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/ConsoleWrappers.c
r77662 r80721 3 3 4 4 (C) Copyright 2013 Hewlett-Packard Development Company, L.P.<BR> 5 Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR> 6 This program and the accompanying materials 7 are licensed and made available under the terms and conditions of the BSD License 8 which accompanies this distribution. The full text of the license may be found at 9 http://opensource.org/licenses/bsd-license.php 10 11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 5 Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR> 6 SPDX-License-Identifier: BSD-2-Clause-Patent 13 7 14 8 **/ -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/ConsoleWrappers.h
r77662 r80721 3 3 4 4 (C) Copyright 2013 Hewlett-Packard Development Company, L.P.<BR> 5 Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR> 6 This program and the accompanying materials 7 are licensed and made available under the terms and conditions of the BSD License 8 which accompanies this distribution. The full text of the license may be found at 9 http://opensource.org/licenses/bsd-license.php 10 11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 5 Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR> 6 SPDX-License-Identifier: BSD-2-Clause-Patent 13 7 14 8 **/ -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/FileHandleInternal.h
r77662 r80721 3 3 4 4 Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR> 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 5 SPDX-License-Identifier: BSD-2-Clause-Patent 12 6 13 7 **/ -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/FileHandleWrappers.c
r77662 r80721 6 6 Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR> 7 7 (C) Copyright 2013 Hewlett-Packard Development Company, L.P.<BR> 8 This program and the accompanying materials 9 are licensed and made available under the terms and conditions of the BSD License 10 which accompanies this distribution. The full text of the license may be found at 11 http://opensource.org/licenses/bsd-license.php 12 13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 8 SPDX-License-Identifier: BSD-2-Clause-Patent 15 9 16 10 **/ … … 1149 1143 EFIAPI 1150 1144 FileInterfaceEnvRead( 1151 IN EFI_FILE_PROTOCOL *This, 1152 IN OUT UINTN *BufferSize, 1153 OUT VOID *Buffer 1154 ) 1155 { 1156 return (SHELL_GET_ENVIRONMENT_VARIABLE( 1157 ((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name, 1158 BufferSize, 1159 Buffer)); 1145 IN EFI_FILE_PROTOCOL *This, 1146 IN OUT UINTN *BufferSize, 1147 OUT VOID *Buffer 1148 ) 1149 { 1150 EFI_STATUS Status; 1151 1152 *BufferSize = *BufferSize / sizeof (CHAR16) * sizeof (CHAR16); 1153 if (*BufferSize != 0) { 1154 // 1155 // Make sure the first unicode character is \xFEFF 1156 // 1157 *(CHAR16 *)Buffer = gUnicodeFileTag; 1158 Buffer = (CHAR16 *)Buffer + 1; 1159 *BufferSize -= sizeof (gUnicodeFileTag); 1160 } 1161 1162 Status = SHELL_GET_ENVIRONMENT_VARIABLE ( 1163 ((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name, 1164 BufferSize, 1165 Buffer 1166 ); 1167 if (!EFI_ERROR (Status) || (Status == EFI_BUFFER_TOO_SMALL)) { 1168 // 1169 // BufferSize is valid and needs update when Status is Success or BufferTooSmall. 1170 // 1171 *BufferSize += sizeof (gUnicodeFileTag); 1172 } 1173 return Status; 1160 1174 } 1161 1175 … … 1925 1939 ) 1926 1940 { 1941 EFI_STATUS Status; 1942 UINT64 Position; 1927 1943 CHAR8 *AsciiStrBuffer; 1928 1944 CHAR16 *UscStrBuffer; 1929 1945 UINTN Size; 1930 UINTN CharNum;1931 EFI_STATUS Status;1932 1946 if (((EFI_FILE_PROTOCOL_FILE*)This)->Unicode) { 1933 1947 // 1934 1948 // Unicode 1949 // There might be different file tag for the Unicode file. We cannot unconditionally insert the \xFEFF. 1950 // So we choose to leave the file content as is. 1935 1951 // 1936 1952 return (((EFI_FILE_PROTOCOL_FILE*)This)->Orig->Read(((EFI_FILE_PROTOCOL_FILE*)This)->Orig, BufferSize, Buffer)); … … 1939 1955 // Ascii 1940 1956 // 1941 Size = (*BufferSize) / sizeof(CHAR16); 1942 AsciiStrBuffer = AllocateZeroPool(Size + sizeof(CHAR8)); 1957 *BufferSize = *BufferSize / sizeof (CHAR16) * sizeof (CHAR16); 1958 if (*BufferSize == 0) { 1959 return EFI_SUCCESS; 1960 } 1961 Status = ((EFI_FILE_PROTOCOL_FILE*)This)->Orig->GetPosition (((EFI_FILE_PROTOCOL_FILE*)This)->Orig, &Position); 1962 if (EFI_ERROR (Status)) { 1963 return Status; 1964 } 1965 if (Position == 0) { 1966 // 1967 // First two bytes in Buffer is for the Unicode file tag. 1968 // 1969 *(CHAR16 *)Buffer = gUnicodeFileTag; 1970 Buffer = (CHAR16 *)Buffer + 1; 1971 Size = *BufferSize / sizeof (CHAR16) - 1; 1972 } else { 1973 Size = *BufferSize / sizeof (CHAR16); 1974 } 1975 AsciiStrBuffer = AllocateZeroPool (Size + 1); 1943 1976 if (AsciiStrBuffer == NULL) { 1944 1977 return EFI_OUT_OF_RESOURCES; 1945 1978 } 1946 UscStrBuffer = AllocateZeroPool (*BufferSize +sizeof(CHAR16));1979 UscStrBuffer = AllocateZeroPool ((Size + 1) * sizeof(CHAR16)); 1947 1980 if (UscStrBuffer== NULL) { 1948 1981 SHELL_FREE_NON_NULL(AsciiStrBuffer); 1949 1982 return EFI_OUT_OF_RESOURCES; 1950 1983 } 1951 Status = (( (EFI_FILE_PROTOCOL_FILE*)This)->Orig->Read(((EFI_FILE_PROTOCOL_FILE*)This)->Orig, &Size, AsciiStrBuffer));1984 Status = ((EFI_FILE_PROTOCOL_FILE*)This)->Orig->Read (((EFI_FILE_PROTOCOL_FILE*)This)->Orig, &Size, AsciiStrBuffer); 1952 1985 if (!EFI_ERROR(Status)) { 1953 CharNum = UnicodeSPrint(UscStrBuffer, *BufferSize + sizeof(CHAR16), L"%a", AsciiStrBuffer); 1954 if (CharNum == Size) { 1955 CopyMem (Buffer, UscStrBuffer, *BufferSize); 1956 } else { 1957 Status = EFI_UNSUPPORTED; 1958 } 1959 } 1960 SHELL_FREE_NON_NULL(AsciiStrBuffer); 1961 SHELL_FREE_NON_NULL(UscStrBuffer); 1962 return (Status); 1986 AsciiStrToUnicodeStrS (AsciiStrBuffer, UscStrBuffer, Size + 1); 1987 *BufferSize = Size * sizeof (CHAR16); 1988 CopyMem (Buffer, UscStrBuffer, *BufferSize); 1989 } 1990 SHELL_FREE_NON_NULL (AsciiStrBuffer); 1991 SHELL_FREE_NON_NULL (UscStrBuffer); 1992 return Status; 1963 1993 } 1964 1994 } -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/FileHandleWrappers.h
r77662 r80721 3 3 4 4 Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR> 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 5 SPDX-License-Identifier: BSD-2-Clause-Patent 12 6 13 7 **/ -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/Shell.c
r77662 r80721 2 2 This is THE shell (application) 3 3 4 Copyright (c) 2009 - 201 7, Intel Corporation. All rights reserved.<BR>4 Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.<BR> 5 5 (C) Copyright 2013-2014 Hewlett-Packard Development Company, L.P.<BR> 6 This program and the accompanying materials 7 are licensed and made available under the terms and conditions of the BSD License 8 which accompanies this distribution. The full text of the license may be found at 9 http://opensource.org/licenses/bsd-license.php 10 11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 6 Copyright 2015-2018 Dell Technologies.<BR> 7 SPDX-License-Identifier: BSD-2-Clause-Patent 13 8 14 9 **/ … … 1002 997 ShellInfoObject.ShellInitSettings.BitUnion.Bits.Delay = TRUE; 1003 998 // Check for optional delay value following "-delay" 1004 DelayValueStr = gEfiShellParametersProtocol->Argv[LoopVar + 1]; 999 if ((LoopVar + 1) >= gEfiShellParametersProtocol->Argc) { 1000 DelayValueStr = NULL; 1001 } else { 1002 DelayValueStr = gEfiShellParametersProtocol->Argv[LoopVar + 1]; 1003 } 1005 1004 if (DelayValueStr != NULL){ 1006 1005 if (*DelayValueStr == L':') { … … 1170 1169 } 1171 1170 1171 InternalEfiShellSetEnv(L"homefilesystem", StartupScriptPath, TRUE); 1172 1172 1173 StartupScriptPath = StrnCatGrow (&StartupScriptPath, &Size, ((FILEPATH_DEVICE_PATH *)FileDevicePath)->PathName, 0); 1173 1174 PathRemoveLastItem (StartupScriptPath); … … 1207 1208 EFI_INPUT_KEY Key; 1208 1209 CHAR16 *FileStringPath; 1210 CHAR16 *FullFileStringPath; 1209 1211 UINTN NewSize; 1210 1212 … … 1274 1276 FileStringPath = LocateStartupScript (ImagePath, FilePath); 1275 1277 if (FileStringPath != NULL) { 1276 Status = RunScriptFile (FileStringPath, NULL, L"", ShellInfoObject.NewShellParametersProtocol); 1278 FullFileStringPath = FullyQualifyPath(FileStringPath); 1279 if (FullFileStringPath == NULL) { 1280 Status = RunScriptFile (FileStringPath, NULL, FileStringPath, ShellInfoObject.NewShellParametersProtocol); 1281 } else { 1282 Status = RunScriptFile (FullFileStringPath, NULL, FullFileStringPath, ShellInfoObject.NewShellParametersProtocol); 1283 FreePool(FullFileStringPath); 1284 } 1277 1285 FreePool (FileStringPath); 1278 1286 } else { … … 2428 2436 EFI_STATUS StartStatus; 2429 2437 CHAR16 *CommandWithPath; 2438 CHAR16 *FullCommandWithPath; 2430 2439 EFI_DEVICE_PATH_PROTOCOL *DevPath; 2431 2440 SHELL_STATUS CalleeExitStatus; … … 2473 2482 switch (Type) { 2474 2483 case Script_File_Name: 2475 Status = RunScriptFile (CommandWithPath, NULL, CmdLine, ParamProtocol); 2484 FullCommandWithPath = FullyQualifyPath(CommandWithPath); 2485 if (FullCommandWithPath == NULL) { 2486 Status = RunScriptFile (CommandWithPath, NULL, CmdLine, ParamProtocol); 2487 } else { 2488 Status = RunScriptFile (FullCommandWithPath, NULL, CmdLine, ParamProtocol); 2489 FreePool(FullCommandWithPath); 2490 } 2476 2491 break; 2477 2492 case Efi_Application: … … 2749 2764 { 2750 2765 return (RunShellCommand(CmdLine, NULL)); 2751 }2752 2753 2754 STATIC CONST UINT16 InvalidChars[] = {L'*', L'?', L'<', L'>', L'\\', L'/', L'\"', 0x0001, 0x0002};2755 /**2756 Function determines if the CommandName COULD be a valid command. It does not determine whether2757 this is a valid command. It only checks for invalid characters.2758 2759 @param[in] CommandName The name to check2760 2761 @retval TRUE CommandName could be a command name2762 @retval FALSE CommandName could not be a valid command name2763 **/2764 BOOLEAN2765 IsValidCommandName(2766 IN CONST CHAR16 *CommandName2767 )2768 {2769 UINTN Count;2770 if (CommandName == NULL) {2771 ASSERT(FALSE);2772 return (FALSE);2773 }2774 for ( Count = 02775 ; Count < sizeof(InvalidChars) / sizeof(InvalidChars[0])2776 ; Count++2777 ){2778 if (ScanMem16(CommandName, StrSize(CommandName), InvalidChars[Count]) != NULL) {2779 return (FALSE);2780 }2781 }2782 return (TRUE);2783 2766 } 2784 2767 … … 2843 2826 return (EFI_OUT_OF_RESOURCES); 2844 2827 } 2845 for (LoopVar = 0 ; LoopVar < 10 && LoopVar < NewScriptFile->Argc; LoopVar++) { 2828 // 2829 // Put the full path of the script file into Argv[0] as required by section 2830 // 3.6.2 of version 2.2 of the shell specification. 2831 // 2832 NewScriptFile->Argv[0] = StrnCatGrow(&NewScriptFile->Argv[0], NULL, NewScriptFile->ScriptName, 0); 2833 for (LoopVar = 1 ; LoopVar < 10 && LoopVar < NewScriptFile->Argc; LoopVar++) { 2846 2834 ASSERT(NewScriptFile->Argv[LoopVar] == NULL); 2847 2835 NewScriptFile->Argv[LoopVar] = StrnCatGrow(&NewScriptFile->Argv[LoopVar], NULL, ShellInfoObject.NewShellParametersProtocol->Argv[LoopVar], 0); -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/Shell.h
r77662 r80721 3 3 4 4 (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR> 5 Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR> 6 This program and the accompanying materials 7 are licensed and made available under the terms and conditions of the BSD License 8 which accompanies this distribution. The full text of the license may be found at 9 http://opensource.org/licenses/bsd-license.php 10 11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 5 Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR> 6 SPDX-License-Identifier: BSD-2-Clause-Patent 13 7 14 8 **/ … … 310 304 ); 311 305 312 /**313 Function determines if the CommandName COULD be a valid command. It does not determine whether314 this is a valid command. It only checks for invalid characters.315 316 @param[in] CommandName The name to check317 318 @retval TRUE CommandName could be a command name319 @retval FALSE CommandName could not be a valid command name320 **/321 BOOLEAN322 IsValidCommandName(323 IN CONST CHAR16 *CommandName324 );325 306 326 307 /** -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/Shell.inf
r77662 r80721 3 3 # 4 4 # (C) Copyright 2013 Hewlett-Packard Development Company, L.P.<BR> 5 # Copyright (c) 2009 - 201 6, Intel Corporation. All rights reserved.<BR>5 # Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR> 6 6 # 7 # This program and the accompanying materials 8 # are licensed and made available under the terms and conditions of the BSD License 9 # which accompanies this distribution. The full text of the license may be found at 10 # http://opensource.org/licenses/bsd-license.php 11 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 12 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 7 # SPDX-License-Identifier: BSD-2-Clause-Patent 13 8 # 14 9 # … … 26 21 # The following information is for reference only and not required by the build tools. 27 22 # 28 # VALID_ARCHITECTURES = IA32 X64 IPFEBC23 # VALID_ARCHITECTURES = IA32 X64 EBC 29 24 # 30 25 … … 103 98 gEfiShellPkgTokenSpaceGuid.PcdShellSupportFrameworkHii ## CONSUMES 104 99 gEfiShellPkgTokenSpaceGuid.PcdShellPageBreakDefault ## CONSUMES 105 gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize ## CONSUMES106 100 gEfiShellPkgTokenSpaceGuid.PcdShellInsertModeDefault ## CONSUMES 107 101 gEfiShellPkgTokenSpaceGuid.PcdShellScreenLogCount ## CONSUMES 108 gEfiShellPkgTokenSpaceGuid.PcdShellMapNameLength ## CONSUMES109 102 gEfiShellPkgTokenSpaceGuid.PcdShellPrintBufferSize ## CONSUMES 110 103 gEfiShellPkgTokenSpaceGuid.PcdShellForceConsole ## CONSUMES -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/Shell.uni
r77662 r80721 3 3 // (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR> 4 4 // Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved. <BR> 5 // This program and the accompanying materials 6 // are licensed and made available under the terms and conditions of the BSD License 7 // which accompanies this distribution. The full text of the license may be found at 8 // http://opensource.org/licenses/bsd-license.php 9 // 10 // THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 5 // SPDX-License-Identifier: BSD-2-Clause-Patent 12 6 // 13 7 // Module Name: -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/ShellEnvVar.c
r77662 r80721 2 2 function declarations for shell environment functions. 3 3 4 Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR> 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 4 Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR> 5 SPDX-License-Identifier: BSD-2-Clause-Patent 12 6 13 7 **/ -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/ShellEnvVar.h
r77662 r80721 7 7 8 8 9 Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR> 10 This program and the accompanying materials 11 are licensed and made available under the terms and conditions of the BSD License 12 which accompanies this distribution. The full text of the license may be found at 13 http://opensource.org/licenses/bsd-license.php 14 15 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 16 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 9 Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR> 10 SPDX-License-Identifier: BSD-2-Clause-Patent 17 11 18 12 **/ -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/ShellManParser.c
r77662 r80721 2 2 Provides interface to shell MAN file parser. 3 3 4 Copyright (c) 2009 - 201 8, Intel Corporation. All rights reserved.<BR>4 Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.<BR> 5 5 Copyright 2015 Dell Inc. 6 This program and the accompanying materials 7 are licensed and made available under the terms and conditions of the BSD License 8 which accompanies this distribution. The full text of the license may be found at 9 http://opensource.org/licenses/bsd-license.php 10 11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 6 SPDX-License-Identifier: BSD-2-Clause-Patent 13 7 14 8 **/ … … 46 40 } 47 41 }; 48 49 50 /**51 Convert a Unicode character to upper case only if52 it maps to a valid small-case ASCII character.53 54 This internal function only deal with Unicode character55 which maps to a valid small-case ASCII character, i.e.56 L'a' to L'z'. For other Unicode character, the input character57 is returned directly.58 59 @param Char The character to convert.60 61 @retval LowerCharacter If the Char is with range L'a' to L'z'.62 @retval Unchanged Otherwise.63 64 **/65 CHAR1666 InternalShellCharToUpper (67 IN CHAR16 Char68 );69 42 70 43 /** … … 417 390 State = (BriefDesc == NULL) ? Final : GetBriefDescription; 418 391 } 419 else if ( InternalShellCharToUpper (*Line) != InternalShellCharToUpper (*(Command + CommandIndex++))) {392 else if (CharToUpper (*Line) != CharToUpper (*(Command + CommandIndex++))) { 420 393 State = Final; 421 394 } -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/ShellManParser.h
r77662 r80721 3 3 4 4 Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR> 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 5 SPDX-License-Identifier: BSD-2-Clause-Patent 12 6 13 7 **/ -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/ShellParametersProtocol.c
r77662 r80721 6 6 Copyright (C) 2014, Red Hat, Inc. 7 7 (C) Copyright 2013 Hewlett-Packard Development Company, L.P.<BR> 8 Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR> 9 This program and the accompanying materials 10 are licensed and made available under the terms and conditions of the BSD License 11 which accompanies this distribution. The full text of the license may be found at 12 http://opensource.org/licenses/bsd-license.php 13 14 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 15 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 8 Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR> 9 SPDX-License-Identifier: BSD-2-Clause-Patent 16 10 17 11 **/ … … 166 160 if (StripQuotation) { 167 161 CopyMem ((CHAR16*)NextDelim, NextDelim + 1, StrSize (NextDelim + 1)); 168 162 } else{ 169 163 NextDelim++; 170 164 } 171 165 } 172 166 } … … 627 621 } 628 622 629 /**630 Remove the unicode file tag from the begining of the file buffer since that will not be631 used by StdIn.632 633 @param[in] Handle Pointer to the handle of the file to be processed.634 635 @retval EFI_SUCCESS The unicode file tag has been moved successfully.636 **/637 EFI_STATUS638 RemoveFileTag(639 IN SHELL_FILE_HANDLE *Handle640 )641 {642 UINTN CharSize;643 CHAR16 CharBuffer;644 645 CharSize = sizeof(CHAR16);646 CharBuffer = 0;647 gEfiShellProtocol->ReadFile(*Handle, &CharSize, &CharBuffer);648 if (CharBuffer != gUnicodeFileTag) {649 gEfiShellProtocol->SetFilePosition(*Handle, 0);650 }651 return (EFI_SUCCESS);652 }653 623 654 624 /** -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/ShellParametersProtocol.h
r77662 r80721 4 4 5 5 Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR> 6 This program and the accompanying materials 7 are licensed and made available under the terms and conditions of the BSD License 8 which accompanies this distribution. The full text of the license may be found at 9 http://opensource.org/licenses/bsd-license.php 10 11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 6 SPDX-License-Identifier: BSD-2-Clause-Patent 13 7 14 8 **/ -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/ShellProtocol.c
r77662 r80721 5 5 (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR> 6 6 (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR> 7 Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR> 8 This program and the accompanying materials 9 are licensed and made available under the terms and conditions of the BSD License 10 which accompanies this distribution. The full text of the license may be found at 11 http://opensource.org/licenses/bsd-license.php 12 13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 7 Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR> 8 SPDX-License-Identifier: BSD-2-Clause-Patent 15 9 16 10 **/ … … 99 93 } 100 94 101 /**102 Internal worker debug helper function to print out maps as they are added.103 104 @param[in] Mapping string mapping that has been added105 @param[in] DevicePath pointer to device path that has been mapped.106 107 @retval EFI_SUCCESS the operation was successful.108 @return other an error ocurred109 110 @sa LocateHandle111 @sa OpenProtocol112 **/113 EFI_STATUS114 InternalShellProtocolDebugPrintMessage (115 IN CONST CHAR16 *Mapping,116 IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath117 )118 {119 EFI_STATUS Status;120 CHAR16 *Temp;121 122 Status = EFI_SUCCESS;123 DEBUG_CODE_BEGIN();124 125 if (Mapping != NULL) {126 DEBUG((EFI_D_INFO, "Added new map item:\"%S\"\r\n", Mapping));127 }128 Temp = ConvertDevicePathToText(DevicePath, TRUE, TRUE);129 DEBUG((EFI_D_INFO, "DevicePath: %S\r\n", Temp));130 FreePool(Temp);131 132 DEBUG_CODE_END();133 return (Status);134 }135 95 136 96 /** … … 1334 1294 // 1335 1295 DevicePath = EfiShellGetDevicePathFromFilePath(FileName); 1336 // DEBUG_CODE(InternalShellProtocolDebugPrintMessage (NULL, DevicePath);); 1296 1337 1297 if (DevicePath == NULL) { 1338 1298 return (EFI_NOT_FOUND); … … 2262 2222 } 2263 2223 2264 /** 2265 Updates a file name to be preceeded by the mapped drive name 2266 2267 @param[in] BasePath the Mapped drive name to prepend 2268 @param[in, out] Path pointer to pointer to the file name to update. 2269 2270 @retval EFI_SUCCESS 2271 @retval EFI_OUT_OF_RESOURCES 2272 **/ 2273 EFI_STATUS 2274 UpdateFileName( 2275 IN CONST CHAR16 *BasePath, 2276 IN OUT CHAR16 **Path 2277 ) 2278 { 2279 CHAR16 *Path2; 2280 UINTN Path2Size; 2281 2282 Path2Size = 0; 2283 Path2 = NULL; 2284 2285 ASSERT(Path != NULL); 2286 ASSERT(*Path != NULL); 2287 ASSERT(BasePath != NULL); 2288 2289 // 2290 // convert a local path to an absolute path 2291 // 2292 if (StrStr(*Path, L":") == NULL) { 2293 ASSERT((Path2 == NULL && Path2Size == 0) || (Path2 != NULL)); 2294 StrnCatGrow(&Path2, &Path2Size, BasePath, 0); 2295 if (Path2 == NULL) { 2296 return (EFI_OUT_OF_RESOURCES); 2297 } 2298 ASSERT((Path2 == NULL && Path2Size == 0) || (Path2 != NULL)); 2299 StrnCatGrow(&Path2, &Path2Size, (*Path)[0] == L'\\'?(*Path) + 1 :*Path, 0); 2300 if (Path2 == NULL) { 2301 return (EFI_OUT_OF_RESOURCES); 2302 } 2303 } 2304 2305 FreePool(*Path); 2306 (*Path) = Path2; 2307 2308 return (EFI_SUCCESS); 2309 } 2224 2310 2225 2311 2226 /** … … 2925 2840 // Make sure we dont 'set' a predefined read only variable 2926 2841 // 2927 if (gUnicodeCollation->StriColl( 2928 gUnicodeCollation, 2929 (CHAR16*)Name, 2930 L"cwd") == 0 2931 ||gUnicodeCollation->StriColl( 2932 gUnicodeCollation, 2933 (CHAR16*)Name, 2934 L"Lasterror") == 0 2935 ||gUnicodeCollation->StriColl( 2936 gUnicodeCollation, 2937 (CHAR16*)Name, 2938 L"profiles") == 0 2939 ||gUnicodeCollation->StriColl( 2940 gUnicodeCollation, 2941 (CHAR16*)Name, 2942 L"uefishellsupport") == 0 2943 ||gUnicodeCollation->StriColl( 2944 gUnicodeCollation, 2945 (CHAR16*)Name, 2946 L"uefishellversion") == 0 2947 ||gUnicodeCollation->StriColl( 2948 gUnicodeCollation, 2949 (CHAR16*)Name, 2950 L"uefiversion") == 0 2951 ||(!ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoNest && 2952 gUnicodeCollation->StriColl( 2953 gUnicodeCollation, 2954 (CHAR16*)Name, 2955 (CHAR16*)mNoNestingEnvVarName) == 0) 2956 ){ 2842 if ((StrCmp (Name, L"cwd") == 0) || 2843 (StrCmp (Name, L"lasterror") == 0) || 2844 (StrCmp (Name, L"profiles") == 0) || 2845 (StrCmp (Name, L"uefishellsupport") == 0) || 2846 (StrCmp (Name, L"uefishellversion") == 0) || 2847 (StrCmp (Name, L"uefiversion") == 0) || 2848 (!ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoNest && 2849 StrCmp (Name, mNoNestingEnvVarName) == 0) 2850 ) { 2957 2851 return (EFI_INVALID_PARAMETER); 2958 2852 } … … 3386 3280 this is stored in a volatile fashion. FALSE otherwise. 3387 3281 3388 @return 3282 @return If Alias is not NULL, it will return a pointer to 3389 3283 the NULL-terminated command for that alias. 3390 3284 If Alias is NULL, ReturnedData points to a ';' -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/ShellProtocol.h
r77662 r80721 4 4 5 5 (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR> 6 Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR> 7 This program and the accompanying materials 8 are licensed and made available under the terms and conditions of the BSD License 9 which accompanies this distribution. The full text of the license may be found at 10 http://opensource.org/licenses/bsd-license.php 11 12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 6 Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR> 7 SPDX-License-Identifier: BSD-2-Clause-Patent 14 8 15 9 **/ … … 820 814 @param[out] Volatile upon return of a single command if TRUE indicates 821 815 this is stored in a volatile fashion. FALSE otherwise. 822 @return 816 @return If Alias is not NULL, it will return a pointer to 823 817 the NULL-terminated command for that alias. 824 818 If Alias is NULL, ReturnedData points to a ';'
Note:
See TracChangeset
for help on using the changeset viewer.