|
typedef VOID * | SHELL_FILE_HANDLE |
|
typedef BOOLEAN(EFIAPI * | EFI_SHELL_BATCH_IS_ACTIVE) (VOID) |
|
typedef EFI_STATUS(EFIAPI * | EFI_SHELL_CLOSE_FILE) (IN SHELL_FILE_HANDLE FileHandle) |
|
typedef EFI_STATUS(EFIAPI * | EFI_SHELL_CREATE_FILE) (IN CONST CHAR16 *FileName, IN UINT64 FileAttribs, OUT SHELL_FILE_HANDLE *FileHandle) |
|
typedef EFI_STATUS(EFIAPI * | EFI_SHELL_DELETE_FILE) (IN SHELL_FILE_HANDLE FileHandle) |
|
typedef EFI_STATUS(EFIAPI * | EFI_SHELL_DELETE_FILE_BY_NAME) (IN CONST CHAR16 *FileName) |
|
typedef VOID(EFIAPI * | EFI_SHELL_DISABLE_PAGE_BREAK) (VOID) |
|
typedef VOID(EFIAPI * | EFI_SHELL_ENABLE_PAGE_BREAK) (VOID) |
|
typedef EFI_STATUS(EFIAPI * | EFI_SHELL_EXECUTE) (IN EFI_HANDLE *ParentImageHandle, IN CHAR16 *CommandLine OPTIONAL, IN CHAR16 **Environment OPTIONAL, OUT EFI_STATUS *StatusCode OPTIONAL) |
|
typedef EFI_STATUS(EFIAPI * | EFI_SHELL_FIND_FILES) (IN CONST CHAR16 *FilePattern, OUT EFI_SHELL_FILE_INFO **FileList) |
|
typedef EFI_STATUS(EFIAPI * | EFI_SHELL_FIND_FILES_IN_DIR) (IN SHELL_FILE_HANDLE FileDirHandle, OUT EFI_SHELL_FILE_INFO **FileList) |
|
typedef EFI_STATUS(EFIAPI * | EFI_SHELL_FLUSH_FILE) (IN SHELL_FILE_HANDLE FileHandle) |
|
typedef EFI_STATUS(EFIAPI * | EFI_SHELL_FREE_FILE_LIST) (IN EFI_SHELL_FILE_INFO **FileList) |
|
typedef CONST CHAR16 *(EFIAPI * | EFI_SHELL_GET_CUR_DIR) (IN CONST CHAR16 *FileSystemMapping OPTIONAL) |
|
typedef UINT32 | EFI_SHELL_DEVICE_NAME_FLAGS |
|
typedef EFI_STATUS(EFIAPI * | EFI_SHELL_GET_DEVICE_NAME) (IN EFI_HANDLE DeviceHandle, IN EFI_SHELL_DEVICE_NAME_FLAGS Flags, IN CHAR8 *Language, OUT CHAR16 **BestDeviceName) |
|
typedef CONST EFI_DEVICE_PATH_PROTOCOL *(EFIAPI * | EFI_SHELL_GET_DEVICE_PATH_FROM_MAP) (IN CONST CHAR16 *Mapping) |
|
typedef EFI_DEVICE_PATH_PROTOCOL *(EFIAPI * | EFI_SHELL_GET_DEVICE_PATH_FROM_FILE_PATH) (IN CONST CHAR16 *Path) |
|
typedef CONST CHAR16 *(EFIAPI * | EFI_SHELL_GET_ENV) (IN CONST CHAR16 *Name OPTIONAL) |
|
typedef CONST CHAR16 *(EFIAPI * | EFI_SHELL_GET_ENV_EX) (IN CONST CHAR16 *Name, OUT UINT32 *Attributes OPTIONAL) |
|
typedef EFI_FILE_INFO *(EFIAPI * | EFI_SHELL_GET_FILE_INFO) (IN SHELL_FILE_HANDLE FileHandle) |
|
typedef CHAR16 *(EFIAPI * | EFI_SHELL_GET_FILE_PATH_FROM_DEVICE_PATH) (IN CONST EFI_DEVICE_PATH_PROTOCOL *Path) |
|
typedef EFI_STATUS(EFIAPI * | EFI_SHELL_GET_FILE_POSITION) (IN SHELL_FILE_HANDLE FileHandle, OUT UINT64 *Position) |
|
typedef EFI_STATUS(EFIAPI * | EFI_SHELL_GET_FILE_SIZE) (IN SHELL_FILE_HANDLE FileHandle, OUT UINT64 *Size) |
|
typedef EFI_STATUS(EFIAPI * | EFI_SHELL_GET_GUID_FROM_NAME) (IN CONST CHAR16 *GuidName, OUT EFI_GUID *Guid) |
|
typedef EFI_STATUS(EFIAPI * | EFI_SHELL_GET_GUID_NAME) (IN CONST EFI_GUID *Guid, OUT CONST CHAR16 **GuidName) |
|
typedef EFI_STATUS(EFIAPI * | EFI_SHELL_GET_HELP_TEXT) (IN CONST CHAR16 *Command, IN CONST CHAR16 *Sections OPTIONAL, OUT CHAR16 **HelpText) |
|
typedef CONST CHAR16 *(EFIAPI * | EFI_SHELL_GET_MAP_FROM_DEVICE_PATH) (IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath) |
|
typedef BOOLEAN(EFIAPI * | EFI_SHELL_GET_PAGE_BREAK) (VOID) |
|
typedef BOOLEAN(EFIAPI * | EFI_SHELL_IS_ROOT_SHELL) (VOID) |
|
typedef EFI_STATUS(EFIAPI * | EFI_SHELL_OPEN_FILE_BY_NAME) (IN CONST CHAR16 *FileName, OUT SHELL_FILE_HANDLE *FileHandle, IN UINT64 OpenMode) |
|
typedef EFI_STATUS(EFIAPI * | EFI_SHELL_OPEN_FILE_LIST) (IN CHAR16 *Path, IN UINT64 OpenMode, IN OUT EFI_SHELL_FILE_INFO **FileList) |
|
typedef EFI_STATUS(EFIAPI * | EFI_SHELL_OPEN_ROOT) (IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, OUT SHELL_FILE_HANDLE *FileHandle) |
|
typedef EFI_STATUS(EFIAPI * | EFI_SHELL_OPEN_ROOT_BY_HANDLE) (IN EFI_HANDLE DeviceHandle, OUT SHELL_FILE_HANDLE *FileHandle) |
|
typedef EFI_STATUS(EFIAPI * | EFI_SHELL_READ_FILE) (IN SHELL_FILE_HANDLE FileHandle, IN OUT UINTN *ReadSize, IN OUT VOID *Buffer) |
|
typedef EFI_STATUS(EFIAPI * | EFI_SHELL_REGISTER_GUID_NAME) (IN CONST EFI_GUID *Guid, IN CONST CHAR16 *GuidName) |
|
typedef EFI_STATUS(EFIAPI * | EFI_SHELL_REMOVE_DUP_IN_FILE_LIST) (IN EFI_SHELL_FILE_INFO **FileList) |
|
typedef EFI_STATUS(EFIAPI * | EFI_SHELL_SET_ALIAS) (IN CONST CHAR16 *Command, IN CONST CHAR16 *Alias, IN BOOLEAN Replace, IN BOOLEAN Volatile) |
|
typedef CONST CHAR16 *(EFIAPI * | EFI_SHELL_GET_ALIAS) (IN CONST CHAR16 *Alias, OUT BOOLEAN *Volatile OPTIONAL) |
|
typedef EFI_STATUS(EFIAPI * | EFI_SHELL_SET_CUR_DIR) (IN CONST CHAR16 *FileSystem OPTIONAL, IN CONST CHAR16 *Dir) |
|
typedef EFI_STATUS(EFIAPI * | EFI_SHELL_SET_ENV) (IN CONST CHAR16 *Name, IN CONST CHAR16 *Value, IN BOOLEAN Volatile) |
|
typedef EFI_STATUS(EFIAPI * | EFI_SHELL_SET_FILE_INFO) (IN SHELL_FILE_HANDLE FileHandle, IN CONST EFI_FILE_INFO *FileInfo) |
|
typedef EFI_STATUS(EFIAPI * | EFI_SHELL_SET_FILE_POSITION) (IN SHELL_FILE_HANDLE FileHandle, IN UINT64 Position) |
|
typedef EFI_STATUS(EFIAPI * | EFI_SHELL_SET_MAP) (IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN CONST CHAR16 *Mapping) |
|
typedef EFI_STATUS(EFIAPI * | EFI_SHELL_WRITE_FILE) (IN SHELL_FILE_HANDLE FileHandle, IN OUT UINTN *BufferSize, IN VOID *Buffer) |
|
typedef struct _EFI_SHELL_PROTOCOL | EFI_SHELL_PROTOCOL |
|
EFI Shell protocol as defined in the UEFI Shell 2.0 specification including errata.
(C) Copyright 2014 Hewlett-Packard Development Company, L.P.
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file Shell.h.
Creates a file or directory by name.
This function creates an empty new file or directory with the specified attributes and returns the new file's handle. If the file already exists and is read-only, then EFI_INVALID_PARAMETER will be returned.
If the file already existed, it is truncated and its attributes updated. If the file is created successfully, the FileHandle is the file's handle, else, the FileHandle is NULL.
If the file name begins with >v, then the file handle which is returned refers to the shell environment variable with the specified name. If the shell environment variable already exists and is non-volatile then EFI_INVALID_PARAMETER is returned.
- Parameters
-
[in] | FileName | Pointer to NULL-terminated file path. |
[in] | FileAttribs | The new file's attrbiutes. The different attributes are described in EFI_FILE_PROTOCOL.Open(). |
[out] | FileHandle | On return, points to the created file handle or directory's handle. |
- Return values
-
EFI_SUCCESS | The file was opened. FileHandle points to the new file's handle. |
EFI_INVALID_PARAMETER | One of the parameters has an invalid value. |
EFI_UNSUPPORTED | The file path could not be opened. |
EFI_NOT_FOUND | The specified file could not be found on the device, or could not file the file system on the device. |
EFI_NO_MEDIA | The device has no medium. |
EFI_MEDIA_CHANGED | The device has a different medium in it or the medium is no longer supported. |
EFI_DEVICE_ERROR | The device reported an error or can't get the file path according the DirName. |
EFI_VOLUME_CORRUPTED | The file system structures are corrupted. |
EFI_WRITE_PROTECTED | An attempt was made to create a file, or open a file for write when the media is write-protected. |
EFI_ACCESS_DENIED | The service denied access to the file. |
EFI_OUT_OF_RESOURCES | Not enough resources were available to open the file. |
EFI_VOLUME_FULL | The volume is full. |
Definition at line 228 of file Shell.h.
Execute the command line.
This function creates a nested instance of the shell and executes the specified command (CommandLine) with the specified environment (Environment). Upon return, the status code returned by the specified command is placed in StatusCode.
If Environment is NULL, then the current environment is used and all changes made by the commands executed will be reflected in the current environment. If the Environment is non-NULL, then the changes made will be discarded.
The CommandLine is executed from the current working directory on the current device.
- Parameters
-
[in] | ParentImageHandle | A handle of the image that is executing the specified command line. |
[in] | CommandLine | Points to the NULL-terminated UCS-2 encoded string containing the command line. If NULL then the command- line will be empty. |
[in] | 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. |
[out] | ErrorCode | Points to the status code returned by the command. |
- Return values
-
EFI_SUCCESS | The command executed successfully. The status code returned by the command is pointed to by StatusCode. |
EFI_INVALID_PARAMETER | The parameters are invalid. |
EFI_OUT_OF_RESOURCES | Out of resources. |
EFI_UNSUPPORTED | Nested shell invocations are not allowed. |
Definition at line 319 of file Shell.h.
Returns the current directory on the specified device.
If FileSystemMapping is NULL, it returns the current working directory. If the FileSystemMapping is not NULL, it returns the current directory associated with the 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.
- Parameters
-
[in] | FileSystemMapping | A pointer to the file system mapping. If NULL, then the current working directory is returned. |
- Return values
-
!=NULL | The current directory. |
NULL | Current directory does not exist. |
Definition at line 429 of file Shell.h.
Gets the name of the device specified by the device handle.
This function gets the user-readable name of the device specified by the device handle. If no user-readable name could be generated, then *BestDeviceName will be NULL and EFI_NOT_FOUND will be returned.
If EFI_DEVICE_NAME_USE_COMPONENT_NAME is set, then the function will return the device's name using the EFI_COMPONENT_NAME2_PROTOCOL, if present on DeviceHandle.
If EFI_DEVICE_NAME_USE_DEVICE_PATH is set, then the function will return the device's name using the EFI_DEVICE_PATH_PROTOCOL, if present on DeviceHandle. If both EFI_DEVICE_NAME_USE_COMPONENT_NAME and EFI_DEVICE_NAME_USE_DEVICE_PATH are set, then EFI_DEVICE_NAME_USE_COMPONENT_NAME will have higher priority.
- Parameters
-
[in] | DeviceHandle | The handle of the device. |
[in] | Flags | Determines the possible sources of component names. |
[in] | Language | A pointer to the language specified for the device name, in the same format as described in the UEFI specification, Appendix M. |
[out] | BestDeviceName | On return, points to the callee-allocated NULL- terminated name of the device. If no device name could be found, points to NULL. The name must be freed by the caller... |
- Return values
-
EFI_SUCCESS | Get the name successfully. |
EFI_NOT_FOUND | Fail to get the device name. |
Definition at line 469 of file Shell.h.
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.
- Parameters
-
[in] | Guid | A pointer to the GUID being queried. |
[out] | GuidName | A pointer to a pointer the localized to name for the GUID being requested |
- Return values
-
EFI_SUCCESS | The operation was successful. |
EFI_INVALID_PARAMETER | Guid was NULL. |
EFI_INVALID_PARAMETER | GuidName was NULL. |
EFI_NOT_FOUND | Guid is not assigned a name. |
Definition at line 686 of file Shell.h.
Return help information about a specific command.
This function returns the help information for the specified command. The help text can be internal to the shell or can be from a UEFI Shell manual page.
If Sections is specified, then each section name listed will be compared in a casesensitive manner, to the section names described in Appendix B. If the section exists, it will be appended to the returned help text. If the section does not exist, no information will be returned. If Sections is NULL, then all help text information available will be returned.
- Parameters
-
[in] | Command | Points to the NULL-terminated UEFI Shell command name. |
[in] | Sections | Points to the NULL-terminated comma-delimited section names to return. If NULL, then all sections will be returned. |
[out] | HelpText | On return, points to a callee-allocated buffer containing all specified help text. |
- Return values
-
EFI_SUCCESS | The help text was returned. |
EFI_OUT_OF_RESOURCES | The necessary buffer could not be allocated to hold the returned help text. |
EFI_INVALID_PARAMETER | HelpText is NULL. |
EFI_NOT_FOUND | There is no help text available for Command. |
Definition at line 718 of file Shell.h.
Gets the mapping(s) that most closely matches the device path.
This function gets the mapping which corresponds to the device path *DevicePath. If there is no exact match, then the mapping which most closely matches *DevicePath is returned, and *DevicePath is updated to point to the remaining portion of the device path. If there is an exact match, the mapping is returned and *DevicePath points to the end-of-device-path node.
If there are multiple map names they will be semi-colon seperated in the NULL-terminated string.
- Parameters
-
[in,out] | DevicePath | On entry, points to a device path pointer. On exit, updates the pointer to point to the portion of the device path after the mapping. |
- Return values
-
NULL | No mapping was found. |
!=NULL | Pointer to NULL-terminated mapping. The buffer is callee allocated and should be freed by the caller. |
Definition at line 746 of file Shell.h.
Opens a file or a directory by file name.
This function opens the specified file in the specified OpenMode and returns a file handle. If the file name begins with '>v', then the file handle which is returned refers to the shell environment variable with the specified name. If the shell environment variable exists, is non-volatile and the OpenMode indicates EFI_FILE_MODE_WRITE, then EFI_INVALID_PARAMETER is returned.
If the file name is '>i', then the file handle which is returned refers to the standard input. If the OpenMode indicates EFI_FILE_MODE_WRITE, then EFI_INVALID_PARAMETER is returned.
If the file name is '>o', then the file handle which is returned refers to the standard output. If the OpenMode indicates EFI_FILE_MODE_READ, then EFI_INVALID_PARAMETER is returned.
If the file name is '>e', then the file handle which is returned refers to the standard error. If the OpenMode indicates EFI_FILE_MODE_READ, then EFI_INVALID_PARAMETER is returned.
If the file name is 'NUL', then the file handle that is returned refers to the standard NUL file. If the OpenMode indicates EFI_FILE_MODE_READ, then EFI_INVALID_PARAMETER is returned.
If return EFI_SUCCESS, the FileHandle is the opened file's handle, else, the FileHandle is NULL.
- Parameters
-
[in] | FileName | Points to the NULL-terminated UCS-2 encoded file name. |
[out] | FileHandle | On return, points to the file handle. |
[in] | OpenMode | File open mode. Either EFI_FILE_MODE_READ or EFI_FILE_MODE_WRITE from section 12.4 of the UEFI Specification. |
- Return values
-
EFI_SUCCESS | The file was opened. FileHandle has the opened file's handle. |
EFI_INVALID_PARAMETER | One of the parameters has an invalid value. FileHandle is NULL. |
EFI_UNSUPPORTED | Could not open the file path. FileHandle is NULL. |
EFI_NOT_FOUND | The specified file could not be found on the device or the file system could not be found on the device. FileHandle is NULL. |
EFI_NO_MEDIA | The device has no medium. FileHandle is NULL. |
EFI_MEDIA_CHANGED | The device has a different medium in it or the medium is no longer supported. FileHandle is NULL. |
EFI_DEVICE_ERROR | The device reported an error or can't get the file path according the FileName. FileHandle is NULL. |
EFI_VOLUME_CORRUPTED | The file system structures are corrupted. FileHandle is NULL. |
EFI_WRITE_PROTECTED | An attempt was made to create a file, or open a file for write when the media is write-protected. FileHandle is NULL. |
EFI_ACCESS_DENIED | The service denied access to the file. FileHandle is NULL. |
EFI_OUT_OF_RESOURCES | Not enough resources were available to open the file. FileHandle is NULL. |
EFI_VOLUME_FULL | The volume is full. FileHandle is NULL. |
Definition at line 832 of file Shell.h.
Reads data from the file.
If FileHandle is not a directory, the function reads the requested number of bytes from the file at the file's current position and returns them in Buffer. If the read goes beyond the end of the file, the read length is truncated to the end of the file. The file's current position is increased by the number of bytes returned. If FileHandle is a directory, then an error is returned.
- Parameters
-
[in] | FileHandle | The opened file handle for read. |
[in] | ReadSize | On input, the size of Buffer, in bytes. On output, the amount of data read. |
[in,out] | Buffer | The buffer in which data is read. |
- Return values
-
EFI_SUCCESS | Data was read. |
EFI_NO_MEDIA | The device has no media. |
EFI_DEVICE_ERROR | The device reported an error. |
EFI_VOLUME_CORRUPTED | The file system structures are corrupted. |
EFI_BUFFER_TO_SMALL | Buffer is too small. ReadSize contains required size. |
Definition at line 927 of file Shell.h.
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.
- Parameters
-
[in] | Guid | A pointer to the GUID being registered. |
[in] | GuidName | A pointer to the localized name for the GUID being registered. |
- Return values
-
EFI_SUCCESS | The operation was successful. |
EFI_INVALID_PARAMETER | Guid was NULL. |
EFI_INVALID_PARAMETER | GuidName was NULL. |
EFI_ACCESS_DENIED | Guid already is assigned a name. |
Definition at line 952 of file Shell.h.
Changes the current directory on the specified device.
If the FileSystem is NULL, and the directory Dir does not contain a file system's mapped name, this function changes the current working directory. If FileSystem is NULL and the directory Dir contains a mapped name, then the current file system and the current directory on that file system are changed.
If FileSystem is not NULL, and Dir is NULL, then this changes the current working file system.
If FileSystem is not NULL and Dir is not NULL, then this function changes the current directory on the specified file system.
If the current working directory or the current working file system is changed then the cwd% environment variable will be updated.
- Parameters
-
[in] | FileSystem | A pointer to the file system's mapped name. If NULL, then the current working directory is changed. |
[in] | Dir | Points to the NULL-terminated directory on the device specified by FileSystem. |
- Return values
-
NULL | Current directory does not exist. |
- Returns
- The current directory.
Definition at line 1047 of file Shell.h.
Sets the environment variable.
This function changes the current value of the specified environment variable. If the environment variable exists and the Value is an empty string, then the environment variable is deleted. If the environment variable exists and the Value is not an empty string, then the value of the environment variable is changed. If the environment variable does not exist and the Value is an empty string, there is no action. If the environment variable does not exist and the Value is a non-empty string, then the environment variable is created and assigned the specified value.
For a description of volatile and non-volatile environment variables, see UEFI Shell 2.0 specification section 3.6.1.
- Parameters
-
[in] | Name | Points to the NULL-terminated environment variable name. |
[in] | Value | Points to the NULL-terminated environment variable value. If the value is an empty string then the environment variable is deleted. |
[in] | Volatile | Indicates whether the variable is non-volatile (FALSE) or volatile (TRUE). |
- Return values
-
EFI_SUCCESS | The environment variable was successfully updated. |
Definition at line 1075 of file Shell.h.