ShellPkg[all]  1.02
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ShellCommandLib.h File Reference

Data Structures

struct  SHELL_MAP_LIST
 
struct  COMMAND_LIST
 
struct  ALIAS_LIST
 
struct  SCRIPT_COMMAND_LIST
 
struct  SCRIPT_FILE
 
struct  BUFFER_LIST
 

Typedefs

typedef CONST CHAR16 *(EFIAPI * SHELL_GET_MAN_FILENAME )(VOID)
 
typedef SHELL_STATUS(EFIAPI * SHELL_RUN_COMMAND )(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Enumerations

enum  SHELL_MAPPING_TYPE { MappingTypeFileSystem, MappingTypeBlockIo, MappingTypeMax }
 
enum  SHELL_SORT_FILE_LIST { ShellSortFileListByFileName, ShellSortFileListByFullName, ShellSortFileListMax }
 

Functions

RETURN_STATUS EFIAPI ShellCommandRegisterCommandName (IN CONST CHAR16 *CommandString, IN SHELL_RUN_COMMAND CommandHandler, IN SHELL_GET_MAN_FILENAME GetManFileName, IN UINT32 ShellMinSupportLevel, IN CONST CHAR16 *ProfileName, IN CONST BOOLEAN CanAffectLE, IN CONST EFI_HII_HANDLE HiiHandle, IN CONST EFI_STRING_ID ManFormatHelp)
 
RETURN_STATUS EFIAPI ShellCommandRunCommandHandler (IN CONST CHAR16 *CommandString, IN OUT SHELL_STATUS *RetVal, IN OUT BOOLEAN *CanAffectLE)
 
CONST CHAR16 *EFIAPI ShellCommandGetManFileNameHandler (IN CONST CHAR16 *CommandString)
 
CONST COMMAND_LIST *EFIAPI ShellCommandGetCommandList (IN CONST BOOLEAN Sort)
 
RETURN_STATUS EFIAPI ShellCommandRegisterAlias (IN CONST CHAR16 *Command, IN CONST CHAR16 *Alias)
 
CONST ALIAS_LIST *EFIAPI ShellCommandGetInitAliasList (VOID)
 
BOOLEAN EFIAPI ShellCommandIsOnAliasList (IN CONST CHAR16 *Alias)
 
BOOLEAN EFIAPI ShellCommandIsCommandOnList (IN CONST CHAR16 *CommandString)
 
CHAR16 *EFIAPI ShellCommandGetCommandHelp (IN CONST CHAR16 *CommandString)
 
EFI_STATUS EFIAPI CommandInit (VOID)
 
BOOLEAN EFIAPI ShellCommandGetEchoState (VOID)
 
VOID EFIAPI ShellCommandSetEchoState (IN BOOLEAN State)
 
VOID EFIAPI ShellCommandRegisterExit (IN BOOLEAN ScriptOnly, IN CONST UINT64 ErrorCode)
 
UINT64 EFIAPI ShellCommandGetExitCode (VOID)
 
BOOLEAN EFIAPI ShellCommandGetExit (VOID)
 
BOOLEAN EFIAPI ShellCommandGetScriptExit (VOID)
 
SCRIPT_FILE *EFIAPI ShellCommandGetCurrentScriptFile (VOID)
 
SCRIPT_FILE *EFIAPI ShellCommandSetNewScript (IN SCRIPT_FILE *Script)
 
VOID EFIAPI DeleteScriptFileStruct (IN SCRIPT_FILE *Script)
 
CONST CHAR16 *EFIAPI ShellCommandGetProfileList (VOID)
 
CHAR16 *EFIAPI ShellCommandCreateNewMappingName (IN CONST SHELL_MAPPING_TYPE Type)
 
EFI_STATUS EFIAPI ShellCommandConsistMappingInitialize (EFI_DEVICE_PATH_PROTOCOL ***Table)
 
EFI_STATUS EFIAPI ShellCommandConsistMappingUnInitialize (EFI_DEVICE_PATH_PROTOCOL **Table)
 
CHAR16 *EFIAPI ShellCommandConsistMappingGenMappingName (IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN EFI_DEVICE_PATH_PROTOCOL **Table)
 
SHELL_MAP_LIST *EFIAPI ShellCommandFindMapItem (IN CONST CHAR16 *MapKey)
 
EFI_STATUS EFIAPI ShellCommandAddMapItemAndUpdatePath (IN CONST CHAR16 *Name, IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN CONST UINT64 Flags, IN CONST BOOLEAN Path)
 
EFI_STATUS EFIAPI ShellCommandCreateInitialMappingsAndPaths (VOID)
 
EFI_STATUS EFIAPI ShellCommandUpdateMapping (VOID)
 
EFI_FILE_PROTOCOL *EFIAPI ConvertShellHandleToEfiFileProtocol (IN CONST SHELL_FILE_HANDLE Handle)
 
BOOLEAN EFIAPI ShellFileHandleRemove (IN CONST SHELL_FILE_HANDLE Handle)
 
SHELL_FILE_HANDLE EFIAPI ConvertEfiFileProtocolToShellHandle (IN CONST EFI_FILE_PROTOCOL *Handle, IN CONST CHAR16 *Path)
 
CONST CHAR16 *EFIAPI ShellFileHandleGetPath (IN CONST SHELL_FILE_HANDLE Handle)
 
BOOLEAN EFIAPI ShellFileHandleEof (IN SHELL_FILE_HANDLE Handle)
 
VOID EFIAPI FreeBufferList (IN BUFFER_LIST *List)
 
VOID EFIAPI DumpHex (IN UINTN Indent, IN UINTN Offset, IN UINTN DataSize, IN VOID *UserData)
 
CHAR16 *EFIAPI CatSDumpHex (IN CHAR16 *Buffer, IN UINTN Indent, IN UINTN Offset, IN UINTN DataSize, IN VOID *UserData)
 
EFI_STATUS EFIAPI ShellSortFileList (IN OUT EFI_SHELL_FILE_INFO **FileList, OUT EFI_SHELL_FILE_INFO **Duplicates, IN SHELL_SORT_FILE_LIST Order)
 

Variables

EFI_UNICODE_COLLATION_PROTOCOL * gUnicodeCollation
 
CONST CHAR16 * SupportLevel []
 
SHELL_MAP_LIST gShellMapList
 List of Mappings - DeviceName and Drive Letter(ism). More...
 
SHELL_MAP_LISTgShellCurMapping
 Pointer to node of current directory in the mMapList. More...
 

Detailed Description

Provides interface to shell internal functions for shell commands.

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 - 2018, Intel Corporation. All rights reserved.
(C) Copyright 2016 Hewlett Packard Enterprise Development LP
(C) Copyright 2013-2014 Hewlett-Packard Development Company, L.P.
SPDX-License-Identifier: BSD-2-Clause-Patent

Typedef Documentation

typedef CONST CHAR16*(EFIAPI * SHELL_GET_MAN_FILENAME)(VOID)

Returns the help MAN fileName for a given shell command.

Return values
!NULLThe unicode string of the MAN filename.
NULLAn error ocurred.
typedef SHELL_STATUS(EFIAPI * SHELL_RUN_COMMAND)(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)

Runs a shell command on a given command line.

The specific operation of a given shell command is specified in the UEFI Shell Specification 2.0, or in the source of the given command.

Upon completion of the command run the shell protocol and environment variables may have been updated due to the operation.

Parameters
[in]ImageHandleThe ImageHandle to the app, or NULL if the command built into shell.
[in]SystemTableThe pointer to the system table.
Return values
RETURN_SUCCESSThe shell command was sucessful.
RETURN_UNSUPPORTEDThe command is not supported.

Enumeration Type Documentation

Enumerator
MappingTypeFileSystem 
MappingTypeBlockIo 
MappingTypeMax 
Enumerator
ShellSortFileListByFileName 
ShellSortFileListByFullName 
ShellSortFileListMax 

Function Documentation

CHAR16* EFIAPI CatSDumpHex ( IN CHAR16 *  Buffer,
IN UINTN  Indent,
IN UINTN  Offset,
IN UINTN  DataSize,
IN VOID UserData 
)

Dump HEX data into buffer.

Parameters
[in]BufferHEX data to be dumped in Buffer.
[in]IndentHow many spaces to indent the output.
[in]OffsetThe offset of the printing.
[in]DataSizeThe size in bytes of UserData.
[in]UserDataThe data to print out.
EFI_STATUS EFIAPI CommandInit ( VOID  )

Function to make sure that the above pointers are valid.

SHELL_FILE_HANDLE EFIAPI ConvertEfiFileProtocolToShellHandle ( IN CONST EFI_FILE_PROTOCOL *  Handle,
IN CONST CHAR16 *  Path 
)

Converts a EFI_FILE_PROTOCOL* to an SHELL_FILE_HANDLE.

Parameters
[in]HandleThe pointer to EFI_FILE_PROTOCOL to convert.
[in]PathThe path to the file for verification.
Returns
a SHELL_FILE_HANDLE representing the same file.
EFI_FILE_PROTOCOL* EFIAPI ConvertShellHandleToEfiFileProtocol ( IN CONST SHELL_FILE_HANDLE  Handle)

Converts a SHELL_FILE_HANDLE to an EFI_FILE_PROTOCOL*.

Parameters
[in]HandleThe SHELL_FILE_HANDLE to convert.
Returns
a EFI_FILE_PROTOCOL* representing the same file.
VOID EFIAPI DeleteScriptFileStruct ( IN SCRIPT_FILE Script)

Function to cleanup all memory from a SCRIPT_FILE structure.

Parameters
[in]ScriptThe pointer to the structure to cleanup.
VOID EFIAPI DumpHex ( IN UINTN  Indent,
IN UINTN  Offset,
IN UINTN  DataSize,
IN VOID UserData 
)

Function printing hex output to the console.

Parameters
[in]IndentNumber of spaces to indent.
[in]OffsetOffset to start with.
[in]DataSizeLength of data.
[in]UserDataPointer to some data.
VOID EFIAPI FreeBufferList ( IN BUFFER_LIST List)

Frees any BUFFER_LIST defined type.

Parameters
[in]ListThe pointer to the list head.
EFI_STATUS EFIAPI ShellCommandAddMapItemAndUpdatePath ( IN CONST CHAR16 *  Name,
IN CONST EFI_DEVICE_PATH_PROTOCOL *  DevicePath,
IN CONST UINT64  Flags,
IN CONST BOOLEAN  Path 
)

Function to add a map node to the list of map items and update the "path" environment variable (optionally).

If Path is TRUE (during initialization only), the path environment variable will also be updated to include default paths on the new map name...

Path should be FALSE when this function is called from the protocol SetMap function.

Parameters
[in]NameThe human readable mapped name.
[in]DevicePathThe Device Path for this map.
[in]FlagsThe Flags attribute for this map item.
[in]PathTRUE to update path, FALSE to skip this step (should only be TRUE during initialization).
Return values
EFI_SUCCESSThe addition was sucessful.
EFI_OUT_OF_RESOURCESA memory allocation failed.
EFI_INVALID_PARAMETERA parameter was invalid.
CHAR16* EFIAPI ShellCommandConsistMappingGenMappingName ( IN EFI_DEVICE_PATH_PROTOCOL *  DevicePath,
IN EFI_DEVICE_PATH_PROTOCOL **  Table 
)

Create a consistent mapped name for the device specified by DevicePath based on the Table.

This must be called after ShellCommandConsistMappingInitialize() and before ShellCommandConsistMappingUnInitialize() is called.

Parameters
[in]DevicePathThe pointer to the dev path for the device.
[in]TableThe Table of mapping information.
Return values
NULLA consistent mapped name could not be created.
Returns
A pointer to a string allocated from pool with the device name.
EFI_STATUS EFIAPI ShellCommandConsistMappingInitialize ( EFI_DEVICE_PATH_PROTOCOL ***  Table)

Function to initialize the table for creating consistent map names.

Parameters
[out]TableThe pointer to pointer to pointer to DevicePathProtocol object.
Return values
EFI_SUCCESSThe table was created successfully.
EFI_STATUS EFIAPI ShellCommandConsistMappingUnInitialize ( EFI_DEVICE_PATH_PROTOCOL **  Table)

Function to uninitialize the table for creating consistent map names.

The parameter must have been received from ShellCommandConsistMappingInitialize.

Parameters
[out]TableThe pointer to pointer to DevicePathProtocol object.
Return values
EFI_SUCCESSThe table was deleted successfully.
EFI_STATUS EFIAPI ShellCommandCreateInitialMappingsAndPaths ( VOID  )

Creates the default map names for each device path in the system with a protocol depending on the Type.

Also sets up the default path environment variable if Type is FileSystem.

Return values
EFI_SUCCESSAll map names were created sucessfully.
EFI_NOT_FOUNDNo protocols were found in the system.
Returns
Error returned from gBS->LocateHandle().
See Also
LocateHandle
CHAR16* EFIAPI ShellCommandCreateNewMappingName ( IN CONST SHELL_MAPPING_TYPE  Type)

Function to generate the next default mapping name.

If the return value is not NULL then it must be callee freed.

Parameters
TypeWhat kind of mapping name to make.
Return values
NULLa memory allocation failed.
Returns
a new map name string
SHELL_MAP_LIST* EFIAPI ShellCommandFindMapItem ( IN CONST CHAR16 *  MapKey)

Function to search the list of mappings for the first matching node on the list based on the MapKey.

Parameters
[in]MapKeyThe pointer to the string key to search for in the map.
Returns
the node on the list.
CHAR16* EFIAPI ShellCommandGetCommandHelp ( IN CONST CHAR16 *  CommandString)

Get the help text for a command.

Parameters
[in]CommandStringThe command name.
Return values
NULLNo help text was found.
Returns
The string of the help text. The caller required to free.
CONST COMMAND_LIST* EFIAPI ShellCommandGetCommandList ( IN CONST BOOLEAN  Sort)

Get the list of all available shell internal commands. This is a linked list, via the LIST_ENTRY structure. Enumerate through it using the BaseLib linked list functions. Do not modify the values.

Parameters
[in]SortTRUE to alphabetically sort the values first. FALSE otherwise.
Returns
A linked list of all available shell commands.
SCRIPT_FILE* EFIAPI ShellCommandGetCurrentScriptFile ( VOID  )

Function to return a pointer to the currently running script file object.

Return values
NULLA script file is not currently running.
Returns
A pointer to the current script file object.
BOOLEAN EFIAPI ShellCommandGetEchoState ( VOID  )

Function to determine current state of ECHO. Echo determines if lines from scripts and ECHO commands are enabled.

Return values
TRUEEcho is currently enabled.
FALSEEcho is currently disabled.
BOOLEAN EFIAPI ShellCommandGetExit ( VOID  )

Retrieve the Exit indicator.

Return values
TRUEExit was indicated.
FALSEExit was not indicated.
UINT64 EFIAPI ShellCommandGetExitCode ( VOID  )

Retrieve the Exit code.

Returns
the value passed into RegisterExit.
CONST ALIAS_LIST* EFIAPI ShellCommandGetInitAliasList ( VOID  )

Get the list of all shell alias commands. This is a linked list, via LIST_ENTRY structure. Enumerate through it using the BaseLib linked list functions. Do not modify the values.

Returns
A linked list of all requested shell aliases.
CONST CHAR16* EFIAPI ShellCommandGetManFileNameHandler ( IN CONST CHAR16 *  CommandString)

Checks if a command string has been registered for CommandString, and if so, it returns the MAN filename specified for that command.

If CommandString is NULL, then ASSERT().

Parameters
[in]CommandStringThe pointer to the command name. This is the name found on the command line in the shell.
Return values
NULLThe CommandString was not a registered command.
otherThe name of the MAN file.
See Also
SHELL_GET_MAN_FILENAME
CONST CHAR16* EFIAPI ShellCommandGetProfileList ( VOID  )

Function to get the current Profile string.

This is used to retrieve what profiles were installed.

Return values
NULLThere are no installed profiles.
Returns
A semicolon-delimited list of profiles.
BOOLEAN EFIAPI ShellCommandGetScriptExit ( VOID  )

Retrieve the Exit script indicator.

If ShellCommandGetExit returns FALSE, then the return from this is undefined.

Return values
TRUEScriptOnly was indicated.
FALSEScriptOnly was not indicated.
BOOLEAN EFIAPI ShellCommandIsCommandOnList ( IN CONST CHAR16 *  CommandString)

Checks if a command is already on the list.

Parameters
[in]CommandStringThe command string to check for on the list.
Return values
TRUECommandString represents a registered command.
FALSECommandString does not represent a registered command.
BOOLEAN EFIAPI ShellCommandIsOnAliasList ( IN CONST CHAR16 *  Alias)

Determine if a given alias is on the list of built in aliases.

Parameters
[in]AliasThe alias to test for.
Return values
TRUEThe alias is a built in alias.
FALSEThe alias is not a built in alias.
RETURN_STATUS EFIAPI ShellCommandRegisterAlias ( IN CONST CHAR16 *  Command,
IN CONST CHAR16 *  Alias 
)

Registers aliases to be set as part of the initialization of the shell application.

If Command is NULL, then ASSERT(). If Alias is NULL, then ASSERT().

Parameters
[in]CommandThe pointer to the Command.
[in]AliasThe pointer to Alias.
Return values
RETURN_SUCCESSThe handlers were registered.
RETURN_OUT_OF_RESOURCESThere are not enough resources available to register the shell command.
RETURN_STATUS EFIAPI ShellCommandRegisterCommandName ( IN CONST CHAR16 *  CommandString,
IN SHELL_RUN_COMMAND  CommandHandler,
IN SHELL_GET_MAN_FILENAME  GetManFileName,
IN UINT32  ShellMinSupportLevel,
IN CONST CHAR16 *  ProfileName,
IN CONST BOOLEAN  CanAffectLE,
IN CONST EFI_HII_HANDLE  HiiHandle,
IN CONST EFI_STRING_ID  ManFormatHelp 
)

Registers the handlers of type SHELL_RUN_COMMAND and SHELL_GET_MAN_FILENAME for each shell command.

If the ShellSupportLevel is greater than the value of PcdShellSupportLevel, then return RETURN_UNSUPPORTED.

Registers the the handlers specified by GetHelpInfoHandler and CommandHandler with the command specified by CommandString. If the command named by CommandString has already been registered, then return RETURN_ALREADY_STARTED.

If there are not enough resources available to register the handlers, then RETURN_OUT_OF_RESOURCES is returned.

If CommandString is NULL, then ASSERT(). If GetHelpInfoHandler is NULL, then ASSERT(). If CommandHandler is NULL, then ASSERT(). If ProfileName is NULL, then ASSERT().

Parameters
[in]CommandStringThe pointer to the command name. This is the name to look for on the command line in the shell.
[in]CommandHandlerThe pointer to a function that runs the specified command.
[in]GetManFileNameThe pointer to a function that provides man filename.
[in]ShellMinSupportLevelThe minimum Shell Support Level which has this function.
[in]ProfileNameThe profile name to require for support of this function.
[in]CanAffectLEIndicates whether this command's return value can change the LASTERROR environment variable.
[in]HiiHandleThe handle of this command's HII entry.
[in]ManFormatHelpThe HII locator for the help text.
Return values
RETURN_SUCCESSThe handlers were registered.
RETURN_OUT_OF_RESOURCESThere are not enough resources available to register the shell command.
RETURN_UNSUPPORTEDThe ShellMinSupportLevel was higher than the currently allowed support level.
RETURN_ALREADY_STARTEDThe CommandString represents a command that is already registered. Only one handler set for a given command is allowed.
See Also
SHELL_GET_MAN_FILENAME
SHELL_RUN_COMMAND
VOID EFIAPI ShellCommandRegisterExit ( IN BOOLEAN  ScriptOnly,
IN CONST UINT64  ErrorCode 
)

Indicate that the current shell or script should exit.

Parameters
[in]ScriptOnlyTRUE if exiting a script; FALSE otherwise.
[in]ErrorCodeThe 64 bit error code to return.
RETURN_STATUS EFIAPI ShellCommandRunCommandHandler ( IN CONST CHAR16 *  CommandString,
IN OUT SHELL_STATUS *  RetVal,
IN OUT BOOLEAN CanAffectLE 
)

Checks if a command string has been registered for CommandString, and if so, it runs the previously registered handler for that command with the command line.

If CommandString is NULL, then ASSERT().

If Sections is specified, then each section name listed will be compared in a case sensitive manner to the section names described in Appendix B UEFI Shell 2.0 Specification. If the section exists, it is appended to the returned help text. If the section does not exist, no information is returned. If Sections is NULL, then all help text information available is returned.

Parameters
[in]CommandStringThe pointer to the command name. This is the name found on the command line in the shell.
[in,out]RetValThe pointer to the return value from the command handler.
[in,out]CanAffectLEIndicates whether this command's return value needs to be placed into LASTERROR environment variable.
Return values
RETURN_SUCCESSThe handler was run.
RETURN_NOT_FOUNDThe CommandString did not match a registered command name.
See Also
SHELL_RUN_COMMAND
VOID EFIAPI ShellCommandSetEchoState ( IN BOOLEAN  State)

Function to set current state of ECHO. Echo determines if lines from scripts and ECHO commands are enabled.

Parameters
[in]StateTRUE to enable Echo, FALSE otherwise.
SCRIPT_FILE* EFIAPI ShellCommandSetNewScript ( IN SCRIPT_FILE Script)

Function to set a new script as the currently running one.

This function will correctly stack and unstack nested scripts.

Parameters
[in]ScriptThe pointer to new script information structure. If NULL, it removes and de-allocates the topmost Script structure.
Returns
A pointer to the current running script file after this change. It is NULL if removing the final script.
EFI_STATUS EFIAPI ShellCommandUpdateMapping ( VOID  )

Add mappings for any devices without one. Do not change any existing maps.

Return values
EFI_SUCCESSThe operation was successful.
BOOLEAN EFIAPI ShellFileHandleEof ( IN SHELL_FILE_HANDLE  Handle)

Function to determine if a SHELL_FILE_HANDLE is at the end of the file.

This will NOT work on directories.

If Handle is NULL, then ASSERT.

Parameters
[in]Handlethe file handle
Return values
TRUEthe position is at the end of the file
FALSEthe position is not at the end of the file
CONST CHAR16* EFIAPI ShellFileHandleGetPath ( IN CONST SHELL_FILE_HANDLE  Handle)

Find the path that was logged with the specified SHELL_FILE_HANDLE.

Parameters
[in]HandleThe SHELL_FILE_HANDLE to query on.
Returns
A pointer to the path for the file.
BOOLEAN EFIAPI ShellFileHandleRemove ( IN CONST SHELL_FILE_HANDLE  Handle)

Remove a SHELL_FILE_HANDLE frmo the list of SHELL_FILE_HANDLES.

Parameters
[in]HandleThe SHELL_FILE_HANDLE to remove.
Return values
TRUEThe item was removed.
FALSEThe item was not found.
EFI_STATUS EFIAPI ShellSortFileList ( IN OUT EFI_SHELL_FILE_INFO **  FileList,
OUT EFI_SHELL_FILE_INFO **  Duplicates,
IN SHELL_SORT_FILE_LIST  Order 
)

Sort an EFI_SHELL_FILE_INFO list, optionally moving duplicates to a separate list.

Parameters
[in,out]FileListThe list of EFI_SHELL_FILE_INFO objects to sort.
                     If FileList is NULL on input, then FileList is
                     considered an empty, hence already sorted, list.

                     Otherwise, if (*FileList) is NULL on input, then
                     EFI_INVALID_PARAMETER is returned.

                     Otherwise, the caller is responsible for having
                     initialized (*FileList)->Link with
                     InitializeListHead(). No other fields in the
                     (**FileList) head element are accessed by this
                     function.

                     On output, (*FileList) is sorted according to Order.
                     If Duplicates is NULL on input, then duplicate
                     elements are preserved, sorted stably, on
                     (*FileList). If Duplicates is not NULL on input,
                     then duplicates are moved (stably sorted) to the
                     new, dynamically allocated (*Duplicates) list.
[out]DuplicatesIf Duplicates is NULL on input, (*FileList) will be a monotonically ordered list on output, with duplicates stably sorted.

If Duplicates is not NULL on input, (*FileList) will be a strictly monotonically oredered list on output, with duplicates separated (stably sorted) to (*Duplicates). All fields except Link will be zero-initialized in the (**Duplicates) head element. If no duplicates exist, then (*Duplicates) is set to NULL on output.

Parameters
[in]OrderDetermines the comparison operation between EFI_SHELL_FILE_INFO objects.
Return values
EFI_INVALID_PARAMETER(UINTN)Order is greater than or equal to (UINTN)ShellSortFileListMax. Neither the (*FileList) nor the (*Duplicates) list has been modified.
EFI_INVALID_PARAMETER(*FileList) was NULL on input. Neither the (*FileList) nor the (*Duplicates) list has been modified.
EFI_OUT_OF_RESOURCESMemory allocation failed. Neither the (*FileList) nor the (*Duplicates) list has been modified.
EFI_SUCCESSSorting successful, including the case when FileList is NULL on input.

Variable Documentation

SHELL_MAP_LIST* gShellCurMapping

Pointer to node of current directory in the mMapList.

SHELL_MAP_LIST gShellMapList

List of Mappings - DeviceName and Drive Letter(ism).

EFI_UNICODE_COLLATION_PROTOCOL* gUnicodeCollation
CONST CHAR16* SupportLevel[]