X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ShellPkg%2FApplication%2FShell%2FShellProtocol.c;h=17c30029e4201fea2e1df83072b62c25cb7211fe;hb=b62bb8854fc5ab36b9b88f8bee9a276558bbcd96;hp=116e3f2060358525b5c0f61360891d2567e3a864;hpb=f716d7b8c5aca0d913edd8925808e474df4d3bdb;p=mirror_edk2.git diff --git a/ShellPkg/Application/Shell/ShellProtocol.c b/ShellPkg/Application/Shell/ShellProtocol.c index 116e3f2060..17c30029e4 100644 --- a/ShellPkg/Application/Shell/ShellProtocol.c +++ b/ShellPkg/Application/Shell/ShellProtocol.c @@ -2,7 +2,8 @@ Member functions of EFI_SHELL_PROTOCOL and functions for creation, manipulation, and initialization of EFI_SHELL_PROTOCOL. - Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.
+ (C) Copyright 2014 Hewlett-Packard Development Company, L.P.
+ Copyright (c) 2009 - 2016, 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 @@ -15,6 +16,8 @@ #include "Shell.h" +#define INIT_NAME_BUFFER_SIZE 128 + /** Close an open file handle. @@ -182,6 +185,9 @@ EfiShellSetMap( ){ if (StringNoCaseCompare(&MapListNode->MapName, &Mapping) == 0) { RemoveEntryList(&MapListNode->Link); + SHELL_FREE_NON_NULL(MapListNode->DevicePath); + SHELL_FREE_NON_NULL(MapListNode->MapName); + SHELL_FREE_NON_NULL(MapListNode->CurrentDirectoryPath); FreePool(MapListNode); return (EFI_SUCCESS); } @@ -446,37 +452,37 @@ EfiShellGetFilePathFromDevicePath( ; FilePath = (FILEPATH_DEVICE_PATH*)NextDevicePathNode (&FilePath->Header) ){ // - // all the rest should be file path nodes + // If any node is not a file path node, then the conversion can not be completed // if ((DevicePathType(&FilePath->Header) != MEDIA_DEVICE_PATH) || (DevicePathSubType(&FilePath->Header) != MEDIA_FILEPATH_DP)) { FreePool(PathForReturn); - PathForReturn = NULL; - ASSERT(FALSE); - } else { - // - // append the path part onto the filepath. - // - ASSERT((PathForReturn == NULL && PathSize == 0) || (PathForReturn != NULL)); - - AlignedNode = AllocateCopyPool (DevicePathNodeLength(FilePath), FilePath); - - // File Path Device Path Nodes 'can optionally add a "\" separator to - // the beginning and/or the end of the Path Name string.' - // (UEFI Spec 2.4 section 9.3.6.4). - // If necessary, add a "\", but otherwise don't - // (This is specified in the above section, and also implied by the - // UEFI Shell spec section 3.7) - if ((PathSize != 0) && - (PathForReturn != NULL) && - (PathForReturn[PathSize - 1] != L'\\') && - (AlignedNode->PathName[0] != L'\\')) { - PathForReturn = StrnCatGrow (&PathForReturn, &PathSize, L"\\", 1); - } + return NULL; + } - PathForReturn = StrnCatGrow(&PathForReturn, &PathSize, AlignedNode->PathName, 0); - FreePool(AlignedNode); + // + // append the path part onto the filepath. + // + ASSERT((PathForReturn == NULL && PathSize == 0) || (PathForReturn != NULL)); + + AlignedNode = AllocateCopyPool (DevicePathNodeLength(FilePath), FilePath); + ASSERT (AlignedNode != NULL); + + // File Path Device Path Nodes 'can optionally add a "\" separator to + // the beginning and/or the end of the Path Name string.' + // (UEFI Spec 2.4 section 9.3.6.4). + // If necessary, add a "\", but otherwise don't + // (This is specified in the above section, and also implied by the + // UEFI Shell spec section 3.7) + if ((PathSize != 0) && + (PathForReturn != NULL) && + (PathForReturn[PathSize - 1] != L'\\') && + (AlignedNode->PathName[0] != L'\\')) { + PathForReturn = StrnCatGrow (&PathForReturn, &PathSize, L"\\", 1); } + + PathForReturn = StrnCatGrow(&PathForReturn, &PathSize, AlignedNode->PathName, 0); + FreePool(AlignedNode); } // for loop of remaining nodes } if (PathForReturn != NULL) { @@ -528,18 +534,18 @@ EfiShellGetDevicePathFromFilePath( if (Cwd == NULL) { return (NULL); } - Size = StrSize(Cwd); - Size += StrSize(Path); + Size = StrSize(Cwd) + StrSize(Path); NewPath = AllocateZeroPool(Size); if (NewPath == NULL) { return (NULL); } - StrCpy(NewPath, Cwd); + StrCpyS(NewPath, Size/sizeof(CHAR16), Cwd); + StrCatS(NewPath, Size/sizeof(CHAR16), L"\\"); if (*Path == L'\\') { Path++; while (PathRemoveLastItem(NewPath)) ; } - StrCat(NewPath, Path); + StrCatS(NewPath, Size/sizeof(CHAR16), Path); DevicePathForReturn = EfiShellGetDevicePathFromFilePath(NewPath); FreePool(NewPath); return (DevicePathForReturn); @@ -1144,12 +1150,39 @@ EfiShellCreateFile( return (EFI_NOT_FOUND); } - Status = InternalOpenFileDevicePath(DevicePath, FileHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE|EFI_FILE_MODE_CREATE, FileAttribs); // 0 = no specific file attributes + Status = InternalOpenFileDevicePath(DevicePath, FileHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE|EFI_FILE_MODE_CREATE, FileAttribs); FreePool(DevicePath); return(Status); } +/** + Register a GUID and a localized human readable name for it. + + If Guid is not assigned a name, then assign GuidName to Guid. This list of GUID + names must be used whenever a shell command outputs GUID information. + + This function is only available when the major and minor versions in the + EfiShellProtocol are greater than or equal to 2 and 1, respectively. + + @param[in] Guid A pointer to the GUID being registered. + @param[in] GuidName A pointer to the localized name for the GUID being registered. + + @retval EFI_SUCCESS The operation was successful. + @retval EFI_INVALID_PARAMETER Guid was NULL. + @retval EFI_INVALID_PARAMETER GuidName was NULL. + @retval EFI_ACCESS_DENIED Guid already is assigned a name. +**/ +EFI_STATUS +EFIAPI +EfiShellRegisterGuidName( + IN CONST EFI_GUID *Guid, + IN CONST CHAR16 *GuidName + ) +{ + return (AddNewGuidNameMapping(Guid, GuidName, NULL)); +} + /** Opens a file or a directory by file name. @@ -1317,6 +1350,8 @@ EfiShellDeleteFileByName( SHELL_FILE_HANDLE FileHandle; EFI_STATUS Status; + FileHandle = NULL; + // // get a handle to the file // @@ -1329,6 +1364,7 @@ EfiShellDeleteFileByName( // // now delete the file // + ShellFileHandleRemove(FileHandle); return (ShellInfoObject.NewEfiShellProtocol->DeleteFile(FileHandle)); } @@ -1359,19 +1395,18 @@ EfiShellEnablePageBreak ( /** internal worker function to load and run an image via device path. - @param ParentImageHandle A handle of the image that is executing the specified - command line. - @param DevicePath device path of the file to execute - @param CommandLine Points to the NULL-terminated UCS-2 encoded string - containing the command line. If NULL then the command- - line will be empty. - @param Environment Points to a NULL-terminated array of environment - 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] ExitDataSize ExitDataSize as returned from gBS->StartImage - @param[out] ExitData ExitData as returned from gBS->StartImage + @param ParentImageHandle A handle of the image that is executing the specified + command line. + @param DevicePath device path of the file to execute + @param CommandLine Points to the NULL-terminated UCS-2 encoded string + containing the command line. If NULL then the command- + line will be empty. + @param Environment Points to a NULL-terminated array of environment + 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 returned by the command is pointed to by StatusCode. @@ -1386,28 +1421,20 @@ InternalShellExecuteDevicePath( IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN CONST CHAR16 *CommandLine OPTIONAL, IN CONST CHAR16 **Environment OPTIONAL, - OUT UINTN *ExitDataSize OPTIONAL, - OUT CHAR16 **ExitData OPTIONAL + OUT EFI_STATUS *StartImageStatus OPTIONAL ) { EFI_STATUS Status; + EFI_STATUS StartStatus; EFI_STATUS CleanupStatus; EFI_HANDLE NewHandle; EFI_LOADED_IMAGE_PROTOCOL *LoadedImage; LIST_ENTRY OrigEnvs; EFI_SHELL_PARAMETERS_PROTOCOL ShellParamsProtocol; - UINTN InternalExitDataSize; - UINTN *ExitDataSizePtr; CHAR16 *ImagePath; UINTN Index; - - // ExitDataSize is not OPTIONAL for gBS->BootServices, provide somewhere for - // it to be dumped if the caller doesn't want it. - if (ExitData == NULL) { - ExitDataSizePtr = &InternalExitDataSize; - } else { - ExitDataSizePtr = ExitDataSize; - } + CHAR16 *Walker; + CHAR16 *NewCmdLine; if (ParentImageHandle == NULL) { return (EFI_INVALID_PARAMETER); @@ -1416,6 +1443,17 @@ InternalShellExecuteDevicePath( InitializeListHead(&OrigEnvs); NewHandle = NULL; + + NewCmdLine = AllocateCopyPool (StrSize (CommandLine), CommandLine); + if (NewCmdLine == NULL) { + return EFI_OUT_OF_RESOURCES; + } + + for (Walker = NewCmdLine; Walker != NULL && *Walker != CHAR_NULL ; Walker++) { + if (*Walker == L'^' && *(Walker+1) == L'#') { + CopyMem(Walker, Walker+1, StrSize(Walker) - sizeof(Walker[0])); + } + } // // Load the image with: @@ -1433,6 +1471,7 @@ InternalShellExecuteDevicePath( if (NewHandle != NULL) { gBS->UnloadImage(NewHandle); } + FreePool (NewCmdLine); return (Status); } Status = gBS->OpenProtocol( @@ -1445,9 +1484,9 @@ InternalShellExecuteDevicePath( if (!EFI_ERROR(Status)) { ASSERT(LoadedImage->LoadOptionsSize == 0); - if (CommandLine != NULL) { - LoadedImage->LoadOptionsSize = (UINT32)StrSize(CommandLine); - LoadedImage->LoadOptions = (VOID*)CommandLine; + if (NewCmdLine != NULL) { + LoadedImage->LoadOptionsSize = (UINT32)StrSize(NewCmdLine); + LoadedImage->LoadOptions = (VOID*)NewCmdLine; } // @@ -1466,7 +1505,7 @@ InternalShellExecuteDevicePath( ShellParamsProtocol.StdIn = ShellInfoObject.NewShellParametersProtocol->StdIn; ShellParamsProtocol.StdOut = ShellInfoObject.NewShellParametersProtocol->StdOut; ShellParamsProtocol.StdErr = ShellInfoObject.NewShellParametersProtocol->StdErr; - Status = UpdateArgcArgv(&ShellParamsProtocol, CommandLine, NULL, NULL); + Status = UpdateArgcArgv(&ShellParamsProtocol, NewCmdLine, Efi_Application, NULL, NULL); ASSERT_EFI_ERROR(Status); // // Replace Argv[0] with the full path of the binary we're executing: @@ -1501,14 +1540,17 @@ InternalShellExecuteDevicePath( ///@todo initialize and install ShellInterface protocol on the new image for compatibility if - PcdGetBool(PcdShellSupportOldProtocols) // - // now start the image, passing up exit data if the caller requested it + // now start the image and if the caller wanted the return code pass it to them... // if (!EFI_ERROR(Status)) { - Status = gBS->StartImage( + StartStatus = gBS->StartImage( NewHandle, - ExitDataSizePtr, - ExitData + 0, + NULL ); + if (StartImageStatus != NULL) { + *StartImageStatus = StartStatus; + } CleanupStatus = gBS->UninstallProtocolInterface( NewHandle, @@ -1542,8 +1584,113 @@ FreeAlloc: ASSERT_EFI_ERROR (CleanupStatus); } + FreePool (NewCmdLine); + return(Status); } + +/** + internal worker function to load and run an image in the current shell. + + @param CommandLine Points to the NULL-terminated UCS-2 encoded string + containing the command line. If NULL then the command- + line will be empty. + @param Environment Points to a NULL-terminated array of environment + 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 + returned by the command is pointed to by StatusCode. + @retval EFI_INVALID_PARAMETER The parameters are invalid. + @retval EFI_OUT_OF_RESOURCES Out of resources. + @retval EFI_UNSUPPORTED Nested shell invocations are not allowed. +**/ +EFI_STATUS +EFIAPI +InternalShellExecute( + IN CONST CHAR16 *CommandLine OPTIONAL, + IN CONST CHAR16 **Environment OPTIONAL, + OUT EFI_STATUS *StartImageStatus OPTIONAL + ) +{ + EFI_STATUS Status; + EFI_STATUS CleanupStatus; + LIST_ENTRY OrigEnvs; + + InitializeListHead(&OrigEnvs); + + // + // Save our current environment settings for later restoration if necessary + // + if (Environment != NULL) { + Status = GetEnvironmentVariableList(&OrigEnvs); + if (!EFI_ERROR(Status)) { + Status = SetEnvironmentVariables(Environment); + } else { + return Status; + } + } + + Status = RunShellCommand(CommandLine, StartImageStatus); + + // Restore environment variables + if (!IsListEmpty(&OrigEnvs)) { + CleanupStatus = SetEnvironmentVariableList(&OrigEnvs); + ASSERT_EFI_ERROR (CleanupStatus); + } + + return(Status); +} + +/** + Determine if the UEFI Shell is currently running with nesting enabled or disabled. + + @retval FALSE nesting is required + @retval other nesting is enabled +**/ +STATIC +BOOLEAN +EFIAPI +NestingEnabled( +) +{ + EFI_STATUS Status; + CHAR16 *Temp; + CHAR16 *Temp2; + UINTN TempSize; + BOOLEAN RetVal; + + RetVal = TRUE; + Temp = NULL; + Temp2 = NULL; + + if (ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoNest) { + TempSize = 0; + Temp = NULL; + Status = SHELL_GET_ENVIRONMENT_VARIABLE(mNoNestingEnvVarName, &TempSize, Temp); + if (Status == EFI_BUFFER_TOO_SMALL) { + Temp = AllocateZeroPool(TempSize + sizeof(CHAR16)); + if (Temp != NULL) { + Status = SHELL_GET_ENVIRONMENT_VARIABLE(mNoNestingEnvVarName, &TempSize, Temp); + } + } + Temp2 = StrnCatGrow(&Temp2, NULL, mNoNestingTrue, 0); + if (Temp != NULL && Temp2 != NULL && StringNoCaseCompare(&Temp, &Temp2) == 0) { + // + // Use the no nesting method. + // + RetVal = FALSE; + } + } + + SHELL_FREE_NON_NULL(Temp); + SHELL_FREE_NON_NULL(Temp2); + return (RetVal); +} + /** Execute the command line. @@ -1567,7 +1714,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 StatusCode Points to the status code returned by the command. + @param StatusCode Points to the status code returned by the CommandLine. @retval EFI_SUCCESS The command executed successfully. The status code returned by the command is pointed to by StatusCode. @@ -1591,68 +1738,48 @@ EfiShellExecute( CHAR16 *Temp; EFI_DEVICE_PATH_PROTOCOL *DevPath; UINTN Size; - UINTN ExitDataSize; - CHAR16 *ExitData; if ((PcdGet8(PcdShellSupportLevel) < 1)) { return (EFI_UNSUPPORTED); } - DevPath = AppendDevicePath (ShellInfoObject.ImageDevPath, ShellInfoObject.FileDevPath); + if (NestingEnabled()) { + DevPath = AppendDevicePath (ShellInfoObject.ImageDevPath, ShellInfoObject.FileDevPath); - DEBUG_CODE_BEGIN(); - Temp = ConvertDevicePathToText(ShellInfoObject.FileDevPath, TRUE, TRUE); - FreePool(Temp); - Temp = ConvertDevicePathToText(ShellInfoObject.ImageDevPath, TRUE, TRUE); - FreePool(Temp); - Temp = ConvertDevicePathToText(DevPath, TRUE, TRUE); - FreePool(Temp); - DEBUG_CODE_END(); + DEBUG_CODE_BEGIN(); + Temp = ConvertDevicePathToText(ShellInfoObject.FileDevPath, TRUE, TRUE); + FreePool(Temp); + Temp = ConvertDevicePathToText(ShellInfoObject.ImageDevPath, TRUE, TRUE); + FreePool(Temp); + Temp = ConvertDevicePathToText(DevPath, TRUE, TRUE); + FreePool(Temp); + DEBUG_CODE_END(); - Temp = NULL; - Size = 0; - ASSERT((Temp == NULL && Size == 0) || (Temp != NULL)); - StrnCatGrow(&Temp, &Size, L"Shell.efi -_exit ", 0); - StrnCatGrow(&Temp, &Size, CommandLine, 0); - - Status = InternalShellExecuteDevicePath( - ParentImageHandle, - DevPath, - Temp, - (CONST CHAR16**)Environment, - &ExitDataSize, - &ExitData); - - if (Status == EFI_ABORTED) { - // If the command exited with an error, the shell should put the exit - // status in ExitData, preceded by a null-terminated string. - ASSERT (ExitDataSize == StrSize (ExitData) + sizeof (SHELL_STATUS)); - - if (StatusCode != NULL) { - // Skip the null-terminated string - ExitData += StrLen (ExitData) + 1; - - // Use CopyMem to avoid alignment faults - CopyMem (StatusCode, ExitData, sizeof (SHELL_STATUS)); - - // Convert from SHELL_STATUS to EFI_STATUS - // EFI_STATUSes have top bit set when they are errors. - // (See UEFI Spec Appendix D) - if (*StatusCode != SHELL_SUCCESS) { - *StatusCode = (EFI_STATUS) *StatusCode | MAX_BIT; - } - } - FreePool (ExitData); - Status = EFI_SUCCESS; - } else if ((StatusCode != NULL) && !EFI_ERROR(Status)) { - *StatusCode = EFI_SUCCESS; - } + Temp = NULL; + Size = 0; + ASSERT((Temp == NULL && Size == 0) || (Temp != NULL)); + StrnCatGrow(&Temp, &Size, L"Shell.efi -_exit ", 0); + StrnCatGrow(&Temp, &Size, CommandLine, 0); + + Status = InternalShellExecuteDevicePath( + ParentImageHandle, + DevPath, + Temp, + (CONST CHAR16**)Environment, + StatusCode); + + // + // de-allocate and return + // + FreePool(DevPath); + FreePool(Temp); + } else { + Status = InternalShellExecute( + (CONST CHAR16*)CommandLine, + (CONST CHAR16**)Environment, + StatusCode); + } - // - // de-allocate and return - // - FreePool(DevPath); - FreePool(Temp); return(Status); } @@ -1770,6 +1897,19 @@ EfiShellRemoveDupInFileList( } return (EFI_SUCCESS); } + +// +// This is the same structure as the external version, but it has no CONST qualifiers. +// +typedef struct { + LIST_ENTRY Link; ///< Linked list members. + EFI_STATUS Status; ///< Status of opening the file. Valid only if Handle != NULL. + CHAR16 *FullName; ///< Fully qualified filename. + CHAR16 *FileName; ///< name of this file. + SHELL_FILE_HANDLE Handle; ///< Handle for interacting with the opened file or NULL if closed. + EFI_FILE_INFO *Info; ///< Pointer to the FileInfo struct for this file or NULL. +} EFI_SHELL_FILE_INFO_NO_CONST; + /** Allocates and duplicates a EFI_SHELL_FILE_INFO node. @@ -1786,20 +1926,28 @@ InternalDuplicateShellFileInfo( IN BOOLEAN Save ) { - EFI_SHELL_FILE_INFO *NewNode; + EFI_SHELL_FILE_INFO_NO_CONST *NewNode; + + // + // try to confirm that the objects are in sync + // + ASSERT(sizeof(EFI_SHELL_FILE_INFO_NO_CONST) == sizeof(EFI_SHELL_FILE_INFO)); NewNode = AllocateZeroPool(sizeof(EFI_SHELL_FILE_INFO)); if (NewNode == NULL) { return (NULL); } - NewNode->FullName = AllocateZeroPool(StrSize(Node->FullName)); - - NewNode->FileName = AllocateZeroPool(StrSize(Node->FileName)); - NewNode->Info = AllocateZeroPool((UINTN)Node->Info->Size); + NewNode->FullName = AllocateCopyPool(StrSize(Node->FullName), Node->FullName); + NewNode->FileName = AllocateCopyPool(StrSize(Node->FileName), Node->FileName); + NewNode->Info = AllocateCopyPool((UINTN)Node->Info->Size, Node->Info); if ( NewNode->FullName == NULL || NewNode->FileName == NULL || NewNode->Info == NULL - ){ + ){ + SHELL_FREE_NON_NULL(NewNode->FullName); + SHELL_FREE_NON_NULL(NewNode->FileName); + SHELL_FREE_NON_NULL(NewNode->Info); + SHELL_FREE_NON_NULL(NewNode); return(NULL); } NewNode->Status = Node->Status; @@ -1807,11 +1955,8 @@ InternalDuplicateShellFileInfo( if (!Save) { Node->Handle = NULL; } - StrCpy((CHAR16*)NewNode->FullName, Node->FullName); - StrCpy((CHAR16*)NewNode->FileName, Node->FileName); - CopyMem(NewNode->Info, Node->Info, (UINTN)Node->Info->Size); - return(NewNode); + return((EFI_SHELL_FILE_INFO*)NewNode); } /** @@ -1876,7 +2021,7 @@ CreateAndPopulateShellFileInfo( TempString = StrnCatGrow(&TempString, &Size, BasePath, 0); if (TempString == NULL) { FreePool((VOID*)ShellFileListItem->FileName); - FreePool(ShellFileListItem->Info); + SHELL_FREE_NON_NULL(ShellFileListItem->Info); FreePool(ShellFileListItem); return (NULL); } @@ -1892,6 +2037,8 @@ CreateAndPopulateShellFileInfo( } } + TempString = PathCleanUpDirectories(TempString); + ShellFileListItem->FullName = TempString; ShellFileListItem->Status = Status; ShellFileListItem->Handle = Handle; @@ -1930,6 +2077,7 @@ EfiShellFindFilesInDir( UINTN Size; CHAR16 *TempSpot; + BasePath = NULL; Status = FileHandleGetFileName(FileDirHandle, &BasePath); if (EFI_ERROR(Status)) { return (Status); @@ -1996,6 +2144,87 @@ EfiShellFindFilesInDir( return(Status); } +/** + Get the GUID value from a human readable name. + + If GuidName is a known GUID name, then update Guid to have the correct value for + that GUID. + + This function is only available when the major and minor versions in the + EfiShellProtocol are greater than or equal to 2 and 1, respectively. + + @param[in] GuidName A pointer to the localized name for the GUID being queried. + @param[out] Guid A pointer to the GUID structure to be filled in. + + @retval EFI_SUCCESS The operation was successful. + @retval EFI_INVALID_PARAMETER Guid was NULL. + @retval EFI_INVALID_PARAMETER GuidName was NULL. + @retval EFI_NOT_FOUND GuidName is not a known GUID Name. +**/ +EFI_STATUS +EFIAPI +EfiShellGetGuidFromName( + IN CONST CHAR16 *GuidName, + OUT EFI_GUID *Guid + ) +{ + EFI_GUID *NewGuid; + EFI_STATUS Status; + + if (Guid == NULL || GuidName == NULL) { + return (EFI_INVALID_PARAMETER); + } + + Status = GetGuidFromStringName(GuidName, NULL, &NewGuid); + + if (!EFI_ERROR(Status)) { + CopyGuid(NewGuid, Guid); + } + + return (Status); +} + +/** + Get the human readable name for a GUID from the value. + + If Guid is assigned a name, then update *GuidName to point to the name. The callee + should not modify the value. + + This function is only available when the major and minor versions in the + EfiShellProtocol are greater than or equal to 2 and 1, respectively. + + @param[in] Guid A pointer to the GUID being queried. + @param[out] GuidName A pointer to a pointer the localized to name for the GUID being requested + + @retval EFI_SUCCESS The operation was successful. + @retval EFI_INVALID_PARAMETER Guid was NULL. + @retval EFI_INVALID_PARAMETER GuidName was NULL. + @retval EFI_NOT_FOUND Guid is not assigned a name. +**/ +EFI_STATUS +EFIAPI +EfiShellGetGuidName( + IN CONST EFI_GUID *Guid, + OUT CONST CHAR16 **GuidName + ) +{ + CHAR16 *Name; + + if (Guid == NULL || GuidName == NULL) { + return (EFI_INVALID_PARAMETER); + } + + Name = GetStringNameFromGuid(Guid, NULL); + if (Name == NULL || StrLen(Name) == 0) { + SHELL_FREE_NON_NULL(Name); + return (EFI_NOT_FOUND); + } + + *GuidName = AddBufferToFreeList(Name); + + return (EFI_SUCCESS); +} + /** Updates a file name to be preceeded by the mapped drive name @@ -2083,6 +2312,7 @@ ShellSearchHandle( EFI_SHELL_FILE_INFO *ShellInfo; EFI_SHELL_FILE_INFO *ShellInfoNode; EFI_SHELL_FILE_INFO *NewShellNode; + EFI_FILE_INFO *FileInfo; BOOLEAN Directory; CHAR16 *NewFullName; UINTN Size; @@ -2106,34 +2336,48 @@ ShellSearchHandle( CurrentFilePattern = AllocateZeroPool((NextFilePatternStart-FilePattern+1)*sizeof(CHAR16)); ASSERT(CurrentFilePattern != NULL); - StrnCpy(CurrentFilePattern, FilePattern, NextFilePatternStart-FilePattern); + StrnCpyS(CurrentFilePattern, NextFilePatternStart-FilePattern+1, FilePattern, NextFilePatternStart-FilePattern); if (CurrentFilePattern[0] == CHAR_NULL &&NextFilePatternStart[0] == CHAR_NULL - ){ + ){ // - // Add the current parameter FileHandle to the list, then end... + // we want the parent or root node (if no parent) // if (ParentNode == NULL) { - Status = EFI_INVALID_PARAMETER; + // + // We want the root node. create the node. + // + FileInfo = FileHandleGetInfo(FileHandle); + NewShellNode = CreateAndPopulateShellFileInfo( + MapName, + EFI_SUCCESS, + L"\\", + FileHandle, + FileInfo + ); + SHELL_FREE_NON_NULL(FileInfo); } else { + // + // Add the current parameter FileHandle to the list, then end... + // NewShellNode = InternalDuplicateShellFileInfo((EFI_SHELL_FILE_INFO*)ParentNode, TRUE); - if (NewShellNode == NULL) { - Status = EFI_OUT_OF_RESOURCES; - } else { - NewShellNode->Handle = NULL; - if (*FileList == NULL) { - *FileList = AllocateZeroPool(sizeof(EFI_SHELL_FILE_INFO)); - InitializeListHead(&((*FileList)->Link)); - } + } + if (NewShellNode == NULL) { + Status = EFI_OUT_OF_RESOURCES; + } else { + NewShellNode->Handle = NULL; + if (*FileList == NULL) { + *FileList = AllocateZeroPool(sizeof(EFI_SHELL_FILE_INFO)); + InitializeListHead(&((*FileList)->Link)); + } - // - // Add to the returning to use list - // - InsertTailList(&(*FileList)->Link, &NewShellNode->Link); + // + // Add to the returning to use list + // + InsertTailList(&(*FileList)->Link, &NewShellNode->Link); - Status = EFI_SUCCESS; - } + Status = EFI_SUCCESS; } } else { Status = EfiShellFindFilesInDir(FileHandle, &ShellInfo); @@ -2156,8 +2400,8 @@ ShellSearchHandle( if (NewFullName == NULL) { Status = EFI_OUT_OF_RESOURCES; } else { - StrCpy(NewFullName, MapName); - StrCat(NewFullName, ShellInfoNode->FullName+1); + StrCpyS(NewFullName, Size/sizeof(CHAR16), MapName); + StrCatS(NewFullName, Size/sizeof(CHAR16), ShellInfoNode->FullName+1); FreePool((VOID*)ShellInfoNode->FullName); ShellInfoNode->FullName = NewFullName; } @@ -2188,6 +2432,8 @@ ShellSearchHandle( // recurse with the next part of the pattern // Status = ShellSearchHandle(NextFilePatternStart, UnicodeCollation, ShellInfoNode->Handle, FileList, ShellInfoNode, MapName); + EfiShellClose(ShellInfoNode->Handle); + ShellInfoNode->Handle = NULL; } } else if (!EFI_ERROR(Status)) { // @@ -2280,11 +2526,10 @@ EfiShellFindFiles( RootDevicePath = NULL; RootFileHandle = NULL; MapName = NULL; - PatternCopy = AllocateZeroPool(StrSize(FilePattern)); + PatternCopy = AllocateCopyPool(StrSize(FilePattern), FilePattern); if (PatternCopy == NULL) { return (EFI_OUT_OF_RESOURCES); } - StrCpy(PatternCopy, FilePattern); PatternCopy = PathCleanUpDirectories(PatternCopy); @@ -2307,6 +2552,7 @@ EfiShellFindFiles( ; PatternCurrentLocation++); PatternCurrentLocation++; Status = ShellSearchHandle(PatternCurrentLocation, gUnicodeCollation, RootFileHandle, FileList, NULL, MapName); + EfiShellClose(RootFileHandle); } FreePool(RootDevicePath); } @@ -2368,6 +2614,7 @@ EfiShellOpenFileList( CurDir = EfiShellGetCurDir(NULL); ASSERT((Path2 == NULL && Path2Size == 0) || (Path2 != NULL)); StrnCatGrow(&Path2, &Path2Size, CurDir, 0); + StrnCatGrow(&Path2, &Path2Size, L"\\", 0); if (*Path == L'\\') { Path++; while (PathRemoveLastItem(Path2)) ; @@ -2413,40 +2660,37 @@ EfiShellOpenFileList( } /** - This function updated with errata. - - Gets either a single or list of environment variables. - - If name is not NULL then this function returns the current value of the specified - environment variable. - - If Name is NULL, then a list of all environment variable names is returned. Each is a - NULL terminated string with a double NULL terminating the list. - - @param Name A pointer to the environment variable name. If - Name is NULL, then the function will return all - of the defined shell environment variables. In - the case where multiple environment variables are - being returned, each variable will be terminated by - a NULL, and the list will be terminated by a double - NULL. - - @return !=NULL A pointer to the returned string. - The returned pointer does not need to be freed by the caller. - - @retval NULL The environment variable doesn't exist or there are - no environment variables. + Gets the environment variable and Attributes, or list of environment variables. Can be + used instead of GetEnv(). + + This function returns the current value of the specified environment variable and + the Attributes. If no variable name was specified, then all of the known + variables will be returned. + + @param[in] Name A pointer to the environment variable name. If Name is NULL, + then the function will return all of the defined shell + environment variables. In the case where multiple environment + variables are being returned, each variable will be terminated + by a NULL, and the list will be terminated by a double NULL. + @param[out] Attributes If not NULL, a pointer to the returned attributes bitmask for + the environment variable. In the case where Name is NULL, and + multiple environment variables are being returned, Attributes + is undefined. + + @retval NULL The environment variable doesn't exist. + @return A non-NULL value points to the variable's value. The returned + pointer does not need to be freed by the caller. **/ CONST CHAR16 * -EFIAPI -EfiShellGetEnv( - IN CONST CHAR16 *Name +EFIAPI +EfiShellGetEnvEx( + IN CONST CHAR16 *Name, + OUT UINT32 *Attributes OPTIONAL ) { EFI_STATUS Status; VOID *Buffer; UINTN Size; - LIST_ENTRY List; ENV_VAR_LIST *Node; CHAR16 *CurrentWriteLocation; @@ -2454,21 +2698,13 @@ EfiShellGetEnv( Buffer = NULL; if (Name == NULL) { - // - // Get all our environment variables - // - InitializeListHead(&List); - Status = GetEnvironmentVariableList(&List); - if (EFI_ERROR(Status)){ - return (NULL); - } // // Build the semi-colon delimited list. (2 passes) // - for ( Node = (ENV_VAR_LIST*)GetFirstNode(&List) - ; !IsNull(&List, &Node->Link) - ; Node = (ENV_VAR_LIST*)GetNextNode(&List, &Node->Link) + for ( Node = (ENV_VAR_LIST*)GetFirstNode(&gShellEnvVarList.Link) + ; !IsNull(&gShellEnvVarList.Link, &Node->Link) + ; Node = (ENV_VAR_LIST*)GetNextNode(&gShellEnvVarList.Link, &Node->Link) ){ ASSERT(Node->Key != NULL); Size += StrSize(Node->Key); @@ -2478,54 +2714,59 @@ EfiShellGetEnv( Buffer = AllocateZeroPool(Size); if (Buffer == NULL) { - if (!IsListEmpty (&List)) { - FreeEnvironmentVariableList(&List); - } return (NULL); } CurrentWriteLocation = (CHAR16*)Buffer; - for ( Node = (ENV_VAR_LIST*)GetFirstNode(&List) - ; !IsNull(&List, &Node->Link) - ; Node = (ENV_VAR_LIST*)GetNextNode(&List, &Node->Link) + for ( Node = (ENV_VAR_LIST*)GetFirstNode(&gShellEnvVarList.Link) + ; !IsNull(&gShellEnvVarList.Link, &Node->Link) + ; Node = (ENV_VAR_LIST*)GetNextNode(&gShellEnvVarList.Link, &Node->Link) ){ ASSERT(Node->Key != NULL); - StrCpy(CurrentWriteLocation, Node->Key); + StrCpyS( CurrentWriteLocation, + (Size)/sizeof(CHAR16) - (CurrentWriteLocation - ((CHAR16*)Buffer)), + Node->Key + ); CurrentWriteLocation += StrLen(CurrentWriteLocation) + 1; } - // - // Free the list... - // - if (!IsListEmpty (&List)) { - FreeEnvironmentVariableList(&List); - } } else { // // We are doing a specific environment variable // + Status = ShellFindEnvVarInList(Name, (CHAR16**)&Buffer, &Size, Attributes); - // - // get the size we need for this EnvVariable - // - Status = SHELL_GET_ENVIRONMENT_VARIABLE(Name, &Size, Buffer); - if (Status == EFI_BUFFER_TOO_SMALL) { + if (EFI_ERROR(Status)){ // - // Allocate the space and recall the get function + // get the size we need for this EnvVariable // - Buffer = AllocateZeroPool(Size); - ASSERT(Buffer != NULL); - Status = SHELL_GET_ENVIRONMENT_VARIABLE(Name, &Size, Buffer); - } - // - // we didnt get it (might not exist) - // free the memory if we allocated any and return NULL - // - if (EFI_ERROR(Status)) { - if (Buffer != NULL) { - FreePool(Buffer); + Status = SHELL_GET_ENVIRONMENT_VARIABLE_AND_ATTRIBUTES(Name, Attributes, &Size, Buffer); + if (Status == EFI_BUFFER_TOO_SMALL) { + // + // Allocate the space and recall the get function + // + Buffer = AllocateZeroPool(Size); + Status = SHELL_GET_ENVIRONMENT_VARIABLE_AND_ATTRIBUTES(Name, Attributes, &Size, Buffer); + } + // + // we didnt get it (might not exist) + // free the memory if we allocated any and return NULL + // + if (EFI_ERROR(Status)) { + if (Buffer != NULL) { + FreePool(Buffer); + } + return (NULL); + } else { + // + // If we did not find the environment variable in the gShellEnvVarList + // but get it from UEFI variable storage successfully then we need update + // the gShellEnvVarList. + // + ShellFreeEnvVarList (); + Status = ShellInitEnvVarList (); + ASSERT (Status == EFI_SUCCESS); } - return (NULL); } } @@ -2535,6 +2776,38 @@ EfiShellGetEnv( return (AddBufferToFreeList(Buffer)); } +/** + Gets either a single or list of environment variables. + + If name is not NULL then this function returns the current value of the specified + environment variable. + + If Name is NULL, then a list of all environment variable names is returned. Each is a + NULL terminated string with a double NULL terminating the list. + + @param Name A pointer to the environment variable name. If + Name is NULL, then the function will return all + of the defined shell environment variables. In + the case where multiple environment variables are + being returned, each variable will be terminated by + a NULL, and the list will be terminated by a double + NULL. + + @retval !=NULL A pointer to the returned string. + The returned pointer does not need to be freed by the caller. + + @retval NULL The environment variable doesn't exist or there are + no environment variables. +**/ +CONST CHAR16 * +EFIAPI +EfiShellGetEnv( + IN CONST CHAR16 *Name + ) +{ + return (EfiShellGetEnvEx(Name, NULL)); +} + /** Internal variable setting function. Allows for setting of the read only variables. @@ -2553,14 +2826,35 @@ InternalEfiShellSetEnv( IN BOOLEAN Volatile ) { + EFI_STATUS Status; + UINT32 Atts; + + Atts = 0x0; + if (Value == NULL || StrLen(Value) == 0) { - return (SHELL_DELETE_ENVIRONMENT_VARIABLE(Name)); + Status = SHELL_DELETE_ENVIRONMENT_VARIABLE(Name); + if (!EFI_ERROR(Status)) { + ShellRemvoeEnvVarFromList(Name); + } + return Status; } else { SHELL_DELETE_ENVIRONMENT_VARIABLE(Name); if (Volatile) { - return (SHELL_SET_ENVIRONMENT_VARIABLE_V(Name, StrSize(Value), Value)); + Status = SHELL_SET_ENVIRONMENT_VARIABLE_V(Name, StrSize(Value), Value); + if (!EFI_ERROR(Status)) { + Atts &= ~EFI_VARIABLE_NON_VOLATILE; + Atts |= EFI_VARIABLE_BOOTSERVICE_ACCESS; + ShellAddEnvVarToList(Name, Value, StrSize(Value), Atts); + } + return Status; } else { - return (SHELL_SET_ENVIRONMENT_VARIABLE_NV(Name, StrSize(Value), Value)); + Status = SHELL_SET_ENVIRONMENT_VARIABLE_NV(Name, StrSize(Value), Value); + if (!EFI_ERROR(Status)) { + Atts |= EFI_VARIABLE_NON_VOLATILE; + Atts |= EFI_VARIABLE_BOOTSERVICE_ACCESS; + ShellAddEnvVarToList(Name, Value, StrSize(Value), Atts); + } + return Status; } } } @@ -2624,6 +2918,11 @@ EfiShellSetEnv( gUnicodeCollation, (CHAR16*)Name, L"uefiversion") == 0 + ||(!ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoNest && + gUnicodeCollation->StriColl( + gUnicodeCollation, + (CHAR16*)Name, + (CHAR16*)mNoNestingEnvVarName) == 0) ){ return (EFI_INVALID_PARAMETER); } @@ -2638,6 +2937,8 @@ EfiShellSetEnv( FileSystemMapping. In both cases, the returned name includes the file system mapping (i.e. fs0:\current-dir). + Note that the current directory string should exclude the tailing backslash character. + @param FileSystemMapping A pointer to the file system mapping. If NULL, then the current working directory is returned. @@ -2693,6 +2994,8 @@ EfiShellGetCurDir( If the current working directory or the current working file system is changed then the %cwd% environment variable will be updated + Note that the current directory string should exclude the tailing backslash character. + @param FileSystem A pointer to the file system's mapped name. If NULL, then the current working directory is changed. @param Dir Points to the NULL-terminated directory on the device specified by FileSystem. @@ -2760,6 +3063,8 @@ EfiShellSetCurDir( } if (MapListItem == NULL) { + FreePool (DirectoryName); + SHELL_FREE_NON_NULL(MapName); return (EFI_NOT_FOUND); } @@ -2776,19 +3081,23 @@ EfiShellSetCurDir( ASSERT((MapListItem->CurrentDirectoryPath == NULL && Size == 0) || (MapListItem->CurrentDirectoryPath != NULL)); MapListItem->CurrentDirectoryPath = StrnCatGrow(&MapListItem->CurrentDirectoryPath, &Size, DirectoryName+StrLen(MapName), 0); } + FreePool (MapName); } else { ASSERT((MapListItem->CurrentDirectoryPath == NULL && Size == 0) || (MapListItem->CurrentDirectoryPath != NULL)); MapListItem->CurrentDirectoryPath = StrnCatGrow(&MapListItem->CurrentDirectoryPath, &Size, DirectoryName, 0); } - if ((MapListItem->CurrentDirectoryPath != NULL && MapListItem->CurrentDirectoryPath[StrLen(MapListItem->CurrentDirectoryPath)-1] != L'\\') || (MapListItem->CurrentDirectoryPath == NULL)) { + if ((MapListItem->CurrentDirectoryPath != NULL && MapListItem->CurrentDirectoryPath[StrLen(MapListItem->CurrentDirectoryPath)-1] == L'\\') || (MapListItem->CurrentDirectoryPath == NULL)) { ASSERT((MapListItem->CurrentDirectoryPath == NULL && Size == 0) || (MapListItem->CurrentDirectoryPath != NULL)); - MapListItem->CurrentDirectoryPath = StrnCatGrow(&MapListItem->CurrentDirectoryPath, &Size, L"\\", 0); + if (MapListItem->CurrentDirectoryPath != NULL) { + MapListItem->CurrentDirectoryPath[StrLen(MapListItem->CurrentDirectoryPath)-1] = CHAR_NULL; + } } } else { // // cant have a mapping in the directory... // if (StrStr(DirectoryName, L":") != NULL) { + FreePool (DirectoryName); return (EFI_INVALID_PARAMETER); } // @@ -2796,6 +3105,7 @@ EfiShellSetCurDir( // MapListItem = ShellCommandFindMapItem(FileSystem); if (MapListItem == NULL) { + FreePool (DirectoryName); return (EFI_INVALID_PARAMETER); } // gShellCurDir = MapListItem; @@ -2814,12 +3124,13 @@ EfiShellSetCurDir( MapListItem->CurrentDirectoryPath = StrnCatGrow(&MapListItem->CurrentDirectoryPath, &Size, L"\\", 0); ASSERT((MapListItem->CurrentDirectoryPath == NULL && Size == 0) || (MapListItem->CurrentDirectoryPath != NULL)); MapListItem->CurrentDirectoryPath = StrnCatGrow(&MapListItem->CurrentDirectoryPath, &Size, DirectoryName, 0); - if (MapListItem->CurrentDirectoryPath != NULL && MapListItem->CurrentDirectoryPath[StrLen(MapListItem->CurrentDirectoryPath)-1] != L'\\') { + if (MapListItem->CurrentDirectoryPath != NULL && MapListItem->CurrentDirectoryPath[StrLen(MapListItem->CurrentDirectoryPath)-1] == L'\\') { ASSERT((MapListItem->CurrentDirectoryPath == NULL && Size == 0) || (MapListItem->CurrentDirectoryPath != NULL)); - MapListItem->CurrentDirectoryPath = StrnCatGrow(&MapListItem->CurrentDirectoryPath, &Size, L"\\", 0); + MapListItem->CurrentDirectoryPath[StrLen(MapListItem->CurrentDirectoryPath)-1] = CHAR_NULL; } } } + FreePool (DirectoryName); // // if updated the current directory then update the environment variable // @@ -2890,7 +3201,11 @@ EfiShellGetHelpText( FixCommand = AllocateZeroPool(StrSize(Command) - 4 * sizeof (CHAR16)); ASSERT(FixCommand != NULL); - StrnCpy(FixCommand, Command, StrLen(Command)-4); + StrnCpyS( FixCommand, + (StrSize(Command) - 4 * sizeof (CHAR16))/sizeof(CHAR16), + Command, + StrLen(Command)-4 + ); Status = ProcessManFile(FixCommand, FixCommand, Sections, NULL, HelpText); FreePool(FixCommand); return Status; @@ -2948,20 +3263,17 @@ EFIAPI InternalEfiShellGetListAlias( ) { - UINT64 MaxStorSize; - UINT64 RemStorSize; - UINT64 MaxVarSize; + EFI_STATUS Status; EFI_GUID Guid; CHAR16 *VariableName; UINTN NameSize; + UINTN NameBufferSize; CHAR16 *RetVal; UINTN RetSize; - Status = gRT->QueryVariableInfo(EFI_VARIABLE_NON_VOLATILE|EFI_VARIABLE_BOOTSERVICE_ACCESS, &MaxStorSize, &RemStorSize, &MaxVarSize); - ASSERT_EFI_ERROR(Status); - - VariableName = AllocateZeroPool((UINTN)MaxVarSize); + NameBufferSize = INIT_NAME_BUFFER_SIZE; + VariableName = AllocateZeroPool(NameBufferSize); RetSize = 0; RetVal = NULL; @@ -2972,22 +3284,38 @@ InternalEfiShellGetListAlias( VariableName[0] = CHAR_NULL; while (TRUE) { - NameSize = (UINTN)MaxVarSize; + NameSize = NameBufferSize; Status = gRT->GetNextVariableName(&NameSize, VariableName, &Guid); if (Status == EFI_NOT_FOUND){ break; - } - ASSERT_EFI_ERROR(Status); - if (EFI_ERROR(Status)) { + } else if (Status == EFI_BUFFER_TOO_SMALL) { + NameBufferSize = NameSize > NameBufferSize * 2 ? NameSize : NameBufferSize * 2; + SHELL_FREE_NON_NULL(VariableName); + VariableName = AllocateZeroPool(NameBufferSize); + if (VariableName == NULL) { + Status = EFI_OUT_OF_RESOURCES; + SHELL_FREE_NON_NULL(RetVal); + 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); RetVal = StrnCatGrow(&RetVal, &RetSize, L";", 0); } // compare guid } // while - FreePool(VariableName); + SHELL_FREE_NON_NULL(VariableName); return (RetVal); } @@ -2995,8 +3323,11 @@ 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. **/ -STATIC CHAR16 * ToLower ( CHAR16 *Str @@ -3042,6 +3373,7 @@ EfiShellGetAlias( UINT32 Attribs; EFI_STATUS Status; CHAR16 *AliasLower; + CHAR16 *AliasVal; // Convert to lowercase to make aliases case-insensitive if (Alias != NULL) { @@ -3050,7 +3382,9 @@ EfiShellGetAlias( ToLower (AliasLower); if (Volatile == NULL) { - return (AddBufferToFreeList(GetVariable(AliasLower, &gShellAliasGuid))); + GetVariable2 (AliasLower, &gShellAliasGuid, (VOID **)&AliasVal, NULL); + FreePool(AliasLower); + return (AddBufferToFreeList(AliasVal)); } RetSize = 0; RetVal = NULL; @@ -3063,6 +3397,7 @@ EfiShellGetAlias( if (RetVal != NULL) { FreePool(RetVal); } + FreePool(AliasLower); return (NULL); } if ((EFI_VARIABLE_NON_VOLATILE & Attribs) == EFI_VARIABLE_NON_VOLATILE) { @@ -3232,7 +3567,13 @@ EFI_SHELL_PROTOCOL mShellProtocol = { EfiShellOpenRootByHandle, NULL, SHELL_MAJOR_VERSION, - SHELL_MINOR_VERSION + SHELL_MINOR_VERSION, + + // New for UEFI Shell 2.1 + EfiShellRegisterGuidName, + EfiShellGetGuidName, + EfiShellGetGuidFromName, + EfiShellGetEnvEx }; /** @@ -3538,3 +3879,4 @@ InernalEfiShellStartMonitor( } return (Status); } +