summaryrefslogtreecommitdiffstats
path: root/ShellPkg/Include/Protocol
diff options
context:
space:
mode:
Diffstat (limited to 'ShellPkg/Include/Protocol')
-rw-r--r--ShellPkg/Include/Protocol/EfiShell.h1005
-rw-r--r--ShellPkg/Include/Protocol/EfiShellEnvironment2.h975
-rw-r--r--ShellPkg/Include/Protocol/EfiShellInterface.h94
-rw-r--r--ShellPkg/Include/Protocol/EfiShellParameters.h60
4 files changed, 0 insertions, 2134 deletions
diff --git a/ShellPkg/Include/Protocol/EfiShell.h b/ShellPkg/Include/Protocol/EfiShell.h
deleted file mode 100644
index d36c1f6b17..0000000000
--- a/ShellPkg/Include/Protocol/EfiShell.h
+++ /dev/null
@@ -1,1005 +0,0 @@
-/** @file
- EFI Shell protocol as defined in the UEFI Shell 2.0 specification including errata.
-
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __EFI_SHELL_PROTOCOL__
-#define __EFI_SHELL_PROTOCOL__
-
-#include <ShellBase.h>
-#include <Guid/FileInfo.h>
-
-#define EFI_SHELL_PROTOCOL_GUID \
- { \
- 0x6302d008, 0x7f9b, 0x4f30, { 0x87, 0xac, 0x60, 0xc9, 0xfe, 0xf5, 0xda, 0x4e } \
- }
-
-// replaced EFI_LIST_ENTRY with LIST_ENTRY for simplicity.
-// they are identical outside of the name.
-typedef struct {
- LIST_ENTRY Link; ///< Linked list members.
- EFI_STATUS Status; ///< Status of opening the file. Valid only if Handle != NULL.
- CONST CHAR16 *FullName; ///< Fully qualified filename.
- CONST 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;
-
-/**
- Returns whether any script files are currently being processed.
-
- @retval TRUE There is at least one script file active.
- @retval FALSE No script files are active now.
-
-**/
-typedef
-BOOLEAN
-(EFIAPI *EFI_SHELL_BATCH_IS_ACTIVE) (
- VOID
- );
-
-/**
- Closes the file handle.
-
- This function closes a specified file handle. All 'dirty' cached file data is
- flushed to the device, and the file is closed. In all cases, the handle is
- closed.
-
- @param[in] FileHandle The file handle to be closed.
-
- @retval EFI_SUCCESS The file closed sucessfully.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_CLOSE_FILE)(
- IN SHELL_FILE_HANDLE FileHandle
- );
-
-/**
- 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.
-
- @param[in] FileName Pointer to NULL-terminated file path.
- @param[in] FileAttribs The new file's attrbiutes. The different attributes are
- described in EFI_FILE_PROTOCOL.Open().
- @param[out] FileHandle On return, points to the created file handle or directory's handle.
-
- @retval EFI_SUCCESS The file was opened. FileHandle points to the new file's handle.
- @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
- @retval EFI_UNSUPPORTED The file path could not be opened.
- @retval EFI_NOT_FOUND The specified file could not be found on the device, or could not
- file the file system on the device.
- @retval EFI_NO_MEDIA The device has no medium.
- @retval EFI_MEDIA_CHANGED The device has a different medium in it or the medium is no
- longer supported.
- @retval EFI_DEVICE_ERROR The device reported an error or can't get the file path according
- the DirName.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_WRITE_PROTECTED An attempt was made to create a file, or open a file for write
- when the media is write-protected.
- @retval EFI_ACCESS_DENIED The service denied access to the file.
- @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the file.
- @retval EFI_VOLUME_FULL The volume is full.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_CREATE_FILE)(
- IN CONST CHAR16 *FileName,
- IN UINT64 FileAttribs,
- OUT SHELL_FILE_HANDLE *FileHandle
- );
-
-/**
- Deletes the file specified by the file handle.
-
- This function closes and deletes a file. In all cases, the file handle is closed. If the file
- cannot be deleted, the warning code EFI_WARN_DELETE_FAILURE is returned, but the
- handle is still closed.
-
- @param[in] FileHandle The file handle to delete.
-
- @retval EFI_SUCCESS The file was closed and deleted and the handle was closed.
- @retval EFI_WARN_DELETE_FAILURE The handle was closed but the file was not deleted.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_DELETE_FILE)(
- IN SHELL_FILE_HANDLE FileHandle
- );
-
-/**
- Deletes the file specified by the file name.
-
- This function deletes a file.
-
- @param[in] FileName Points to the NULL-terminated file name.
-
- @retval EFI_SUCCESS The file was deleted.
- @retval EFI_WARN_DELETE_FAILURE The handle was closed but the file was not deleted.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_DELETE_FILE_BY_NAME)(
- IN CONST CHAR16 *FileName
- );
-
-/**
- Disables the page break output mode.
-**/
-typedef
-VOID
-(EFIAPI *EFI_SHELL_DISABLE_PAGE_BREAK) (
- VOID
- );
-
-/**
- Enables the page break output mode.
-**/
-typedef
-VOID
-(EFIAPI *EFI_SHELL_ENABLE_PAGE_BREAK) (
- VOID
- );
-
-/**
- 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.
-
- @param[in] ParentImageHandle A handle of the image that is executing the specified
- command line.
- @param[in] CommandLine Points to the NULL-terminated UCS-2 encoded string
- containing the command line. If NULL then the command-
- line will be empty.
- @param[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.
- @param[out] ErrorCode Points to the status code returned by the command.
-
- @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.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_EXECUTE) (
- IN EFI_HANDLE *ParentImageHandle,
- IN CHAR16 *CommandLine OPTIONAL,
- IN CHAR16 **Environment OPTIONAL,
- OUT EFI_STATUS *StatusCode OPTIONAL
- );
-
-/**
- Find files that match a specified pattern.
-
- This function searches for all files and directories that match the specified
- FilePattern. The FilePattern can contain wild-card characters. The resulting file
- information is placed in the file list FileList.
-
- The files in the file list are not opened. The OpenMode field is set to 0 and the FileInfo
- field is set to NULL.
-
- @param[in] FilePattern Points to a NULL-terminated shell file path, including wildcards.
- @param[out] FileList On return, points to the start of a file list containing the names
- of all matching files or else points to NULL if no matching files
- were found.
-
- @retval EFI_SUCCESS Files found.
- @retval EFI_NOT_FOUND No files found.
- @retval EFI_NO_MEDIA The device has no media.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_FIND_FILES)(
- IN CONST CHAR16 *FilePattern,
- OUT EFI_SHELL_FILE_INFO **FileList
- );
-
-/**
- Find all files in a specified directory.
-
- @param[in] FileDirHandle Handle of the directory to search.
- @param[out] FileList On return, points to the list of files in the directory
- or NULL if there are no files in the directory.
-
- @retval EFI_SUCCESS File information was returned successfully.
- @retval EFI_VOLUME_CORRUPTED The file system structures have been corrupted.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_NO_MEDIA The device media is not present.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_FIND_FILES_IN_DIR)(
-IN SHELL_FILE_HANDLE FileDirHandle,
-OUT EFI_SHELL_FILE_INFO **FileList
-);
-
-/**
- Flushes data back to a device.
-
- This function flushes all modified data associated with a file to a device.
-
- @param[in] FileHandle The handle of the file to flush.
-
- @retval EFI_SUCCESS The data was flushed.
- @retval EFI_NO_MEDIA The device has no medium.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_WRITE_PROTECTED The file or medium is write-protected.
- @retval EFI_ACCESS_DENIED The file was opened read-only.
- @retval EFI_VOLUME_FULL The volume is full.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_FLUSH_FILE)(
- IN SHELL_FILE_HANDLE FileHandle
- );
-
-/**
- Frees the file list.
-
- This function cleans up the file list and any related data structures. It has no
- impact on the files themselves.
-
- @param[in] FileList The file list to free. Type EFI_SHELL_FILE_INFO is
- defined in OpenFileList().
-
- @retval EFI_SUCCESS Free the file list successfully.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_FREE_FILE_LIST) (
- IN EFI_SHELL_FILE_INFO **FileList
- );
-
-/**
- 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).
-
- @param[in] FileSystemMapping A pointer to the file system mapping. If NULL,
- then the current working directory is returned.
-
- @retval !=NULL The current directory.
- @retval NULL Current directory does not exist.
-**/
-typedef
-CONST CHAR16 *
-(EFIAPI *EFI_SHELL_GET_CUR_DIR) (
- IN CONST CHAR16 *FileSystemMapping OPTIONAL
- );
-
-typedef UINT32 EFI_SHELL_DEVICE_NAME_FLAGS;
-#define EFI_DEVICE_NAME_USE_COMPONENT_NAME 0x00000001
-#define EFI_DEVICE_NAME_USE_DEVICE_PATH 0x00000002
-
-/**
- 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.
-
- @param[in] DeviceHandle The handle of the device.
- @param[in] Flags Determines the possible sources of component names.
- @param[in] Language A pointer to the language specified for the device
- name, in the same format as described in the UEFI
- specification, Appendix M.
- @param[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...
-
- @retval EFI_SUCCESS Get the name successfully.
- @retval EFI_NOT_FOUND Fail to get the device name.
-**/
-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
- );
-
-/**
- Gets the device path from the mapping.
-
- This function gets the device path associated with a mapping.
-
- @param[in] Mapping A pointer to the mapping
-
- @retval !=NULL Pointer to the device path that corresponds to the
- device mapping. The returned pointer does not need
- to be freed.
- @retval NULL There is no device path associated with the
- specified mapping.
-**/
-typedef
-CONST EFI_DEVICE_PATH_PROTOCOL *
-(EFIAPI *EFI_SHELL_GET_DEVICE_PATH_FROM_MAP) (
- IN CONST CHAR16 *Mapping
- );
-
-/**
- Converts a file system style name to a device path.
-
- This function converts a file system style name to a device path, by replacing any
- mapping references to the associated device path.
-
- @param[in] Path The pointer to the path.
-
- @return The pointer of the file path. The file path is callee
- allocated and should be freed by the caller.
-**/
-typedef
-EFI_DEVICE_PATH_PROTOCOL *
-(EFIAPI *EFI_SHELL_GET_DEVICE_PATH_FROM_FILE_PATH) (
- IN CONST CHAR16 *Path
- );
-
-/**
- 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 than a list of all environment variable names is returned. Each a
- NULL terminated string with a double NULL terminating the list.
-
- @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.
-
- @return 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.
-**/
-typedef
-CONST CHAR16 *
-(EFIAPI *EFI_SHELL_GET_ENV) (
- IN CONST CHAR16 *Name OPTIONAL
- );
-
-/**
- Gets the file information from an open file handle.
-
- This function allocates a buffer to store the file's information. It's the caller's
- responsibility to free the buffer.
-
- @param[in] FileHandle A File Handle.
-
- @retval NULL Cannot get the file info.
- @return A pointer to a buffer with file information.
-**/
-typedef
-EFI_FILE_INFO *
-(EFIAPI *EFI_SHELL_GET_FILE_INFO)(
- IN SHELL_FILE_HANDLE FileHandle
- );
-
-/**
- Converts a device path to a file system-style path.
-
- This function converts a device path to a file system path by replacing part, or all, of
- the device path with the file-system mapping. If there are more than one application
- file system mappings, the one that most closely matches Path will be used.
-
- @param[in] Path The pointer to the device path.
-
- @return The pointer of the NULL-terminated file path. The path
- is callee-allocated and should be freed by the caller.
-**/
-typedef
-CHAR16 *
-(EFIAPI *EFI_SHELL_GET_FILE_PATH_FROM_DEVICE_PATH) (
- IN CONST EFI_DEVICE_PATH_PROTOCOL *Path
- );
-
-/**
- Gets a file's current position.
-
- This function returns the current file position for the file handle. For directories, the
- current file position has no meaning outside of the file system driver and as such, the
- operation is not supported.
-
- @param[in] FileHandle The file handle on which to get the current position.
- @param[out] Position Byte position from the start of the file.
-
- @retval EFI_SUCCESS Data was accessed.
- @retval EFI_UNSUPPORTED The request is not valid on open directories.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_GET_FILE_POSITION)(
- IN SHELL_FILE_HANDLE FileHandle,
- OUT UINT64 *Position
- );
-
-/**
- Gets the size of a file.
-
- This function returns the size of the file specified by FileHandle.
-
- @param[in] FileHandle The handle of the file.
- @param[out] Size The size of this file.
-
- @retval EFI_SUCCESS Get the file's size.
- @retval EFI_DEVICE_ERROR Can't access the file.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_GET_FILE_SIZE)(
- IN SHELL_FILE_HANDLE FileHandle,
- OUT UINT64 *Size
- );
-
-/**
- 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.
-
- @param[in] Command Points to the NULL-terminated UEFI Shell command name.
- @param[in] Sections Points to the NULL-terminated comma-delimited
- section names to return. If NULL, then all
- sections will be returned.
- @param[out] HelpText On return, points to a callee-allocated buffer
- containing all specified help text.
-
- @retval EFI_SUCCESS The help text was returned.
- @retval EFI_OUT_OF_RESOURCES The necessary buffer could not be allocated to hold the
- returned help text.
- @retval EFI_INVALID_PARAMETER HelpText is NULL.
- @retval EFI_NOT_FOUND There is no help text available for Command.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_GET_HELP_TEXT) (
- IN CONST CHAR16 *Command,
- IN CONST CHAR16 *Sections OPTIONAL,
- OUT CHAR16 **HelpText
- );
-
-/**
- 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.
-
- @param[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.
-
- @retval NULL No mapping was found.
- @retval !=NULL Pointer to NULL-terminated mapping. The buffer
- is callee allocated and should be freed by the caller.
-**/
-typedef
-CONST CHAR16 *
-(EFIAPI *EFI_SHELL_GET_MAP_FROM_DEVICE_PATH) (
- IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
- );
-
-/**
- Gets the enable status of the page break output mode.
-
- User can use this function to determine current page break mode.
-
- @retval TRUE The page break output mode is enabled.
- @retval FALSE The page break output mode is disabled.
-**/
-typedef
-BOOLEAN
-(EFIAPI *EFI_SHELL_GET_PAGE_BREAK) (
- VOID
- );
-
-/**
- Judges whether the active shell is the root shell.
-
- This function makes the user to know that whether the active Shell is the root shell.
-
- @retval TRUE The active Shell is the root Shell.
- @retval FALSE The active Shell is NOT the root Shell.
-**/
-typedef
-BOOLEAN
-(EFIAPI *EFI_SHELL_IS_ROOT_SHELL) (
-VOID
-);
-
-/**
- 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.
-
- @param[in] FileName Points to the NULL-terminated UCS-2 encoded file name.
- @param[out] FileHandle On return, points to the file handle.
- @param[in] OpenMode File open mode. Either EFI_FILE_MODE_READ or
- EFI_FILE_MODE_WRITE from section 12.4 of the UEFI
- Specification.
- @retval EFI_SUCCESS The file was opened. FileHandle has the opened file's handle.
- @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value. FileHandle is NULL.
- @retval EFI_UNSUPPORTED Could not open the file path. FileHandle is NULL.
- @retval 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.
- @retval EFI_NO_MEDIA The device has no medium. FileHandle is NULL.
- @retval EFI_MEDIA_CHANGED The device has a different medium in it or the medium is no
- longer supported. FileHandle is NULL.
- @retval EFI_DEVICE_ERROR The device reported an error or can't get the file path according
- the FileName. FileHandle is NULL.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted. FileHandle is NULL.
- @retval 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.
- @retval EFI_ACCESS_DENIED The service denied access to the file. FileHandle is NULL.
- @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the file. FileHandle
- is NULL.
- @retval EFI_VOLUME_FULL The volume is full. FileHandle is NULL.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_OPEN_FILE_BY_NAME) (
- IN CONST CHAR16 *FileName,
- OUT SHELL_FILE_HANDLE *FileHandle,
- IN UINT64 OpenMode
- );
-
-/**
- Opens the files that match the path specified.
-
- This function opens all of the files specified by Path. Wildcards are processed
- according to the rules specified in UEFI Shell 2.0 spec section 3.7.1. Each
- matching file has an EFI_SHELL_FILE_INFO structure created in a linked list.
-
- @param[in] Path A pointer to the path string.
- @param[in] OpenMode Specifies the mode used to open each file, EFI_FILE_MODE_READ or
- EFI_FILE_MODE_WRITE.
- @param[in, out] FileList Points to the start of a list of files opened.
-
- @retval EFI_SUCCESS Create the file list successfully.
- @return Can't create the file list.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_OPEN_FILE_LIST) (
- IN CHAR16 *Path,
- IN UINT64 OpenMode,
- IN OUT EFI_SHELL_FILE_INFO **FileList
- );
-
-/**
- Opens the root directory of a device.
-
- This function opens the root directory of a device and returns a file handle to it.
-
- @param[in] DevicePath Points to the device path corresponding to the device where the
- EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is installed.
- @param[out] FileHandle On exit, points to the file handle corresponding to the root directory on the
- device.
-
- @retval EFI_SUCCESS Root opened successfully.
- @retval EFI_NOT_FOUND EFI_SIMPLE_FILE_SYSTEM could not be found or the root directory
- could not be opened.
- @retval EFI_VOLUME_CORRUPTED The data structures in the volume were corrupted.
- @retval EFI_DEVICE_ERROR The device had an error.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_OPEN_ROOT)(
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
- OUT SHELL_FILE_HANDLE *FileHandle
- );
-
-/**
- Opens the root directory of a device on a handle.
-
- This function opens the root directory of a device and returns a file handle to it.
-
- @param[in] DeviceHandle The handle of the device that contains the volume.
- @param[out] FileHandle On exit, points to the file handle corresponding to the root directory on the
- device.
-
- @retval EFI_SUCCESS Root opened successfully.
- @retval EFI_NOT_FOUND EFI_SIMPLE_FILE_SYSTEM could not be found or the root directory
- could not be opened.
- @retval EFI_VOLUME_CORRUPTED The data structures in the volume were corrupted.
- @retval EFI_DEVICE_ERROR The device had an error.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_OPEN_ROOT_BY_HANDLE)(
- IN EFI_HANDLE DeviceHandle,
- OUT SHELL_FILE_HANDLE *FileHandle
- );
-
-/**
- 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.
-
- @param[in] FileHandle The opened file handle for read.
- @param[in] ReadSize On input, the size of Buffer, in bytes. On output, the amount of data read.
- @param[in, out] Buffer The buffer in which data is read.
-
- @retval EFI_SUCCESS Data was read.
- @retval EFI_NO_MEDIA The device has no media.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_BUFFER_TO_SMALL Buffer is too small. ReadSize contains required size.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_READ_FILE) (
- IN SHELL_FILE_HANDLE FileHandle,
- IN OUT UINTN *ReadSize,
- IN OUT VOID *Buffer
- );
-
-/**
- Deletes the duplicate file names files in the given file list.
-
- @param[in] FileList A pointer to the first entry in the file list.
-
- @retval EFI_SUCCESS Always success.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_REMOVE_DUP_IN_FILE_LIST) (
- IN EFI_SHELL_FILE_INFO **FileList
- );
-
-/**
- Changes a shell command alias.
-
- This function creates an alias for a shell command.
-
- @param[in] Command Points to the NULL-terminated shell command or existing alias.
- @param[in] Alias Points to the NULL-terminated alias for the shell command. If this is NULL, and
- Command refers to an alias, that alias will be deleted.
- @param[in] Replace If TRUE and the alias already exists, then the existing alias will be replaced. If
- FALSE and the alias already exists, then the existing alias is unchanged and
- EFI_ACCESS_DENIED is returned.
- @param[in] Volatile if TRUE the Alias being set will be stored in a volatile fashion. if FALSE the
- Alias being set will be stored in a non-volatile fashion.
-
- @retval EFI_SUCCESS Alias created or deleted successfully.
- @retval EFI_ACCESS_DENIED The alias is a built-in alias or already existed and Replace was set to
- FALSE.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_SET_ALIAS)(
- IN CONST CHAR16 *Command,
- IN CONST CHAR16 *Alias,
- IN BOOLEAN Replace,
- IN BOOLEAN Volatile
- );
-
-/**
- This function returns the command associated with a alias or a list of all
- alias'.
-
- @param[in] Alias Points to the NULL-terminated shell alias.
- If this parameter is NULL, then all
- aliases will be returned in ReturnedData.
- @param[out] Volatile Upon return of a single command if TRUE indicates
- this is stored in a volatile fashion. FALSE otherwise.
- @return If Alias is not NULL, it will return a pointer to
- the NULL-terminated command for that alias.
- If Alias is NULL, ReturnedData points to a ';'
- delimited list of alias (e.g.
- ReturnedData = "dir;del;copy;mfp") that is NULL-terminated.
- @retval NULL An error ocurred.
- @retval NULL Alias was not a valid Alias.
-**/
-typedef
-CONST CHAR16 *
-(EFIAPI *EFI_SHELL_GET_ALIAS)(
- IN CONST CHAR16 *Alias,
- OUT BOOLEAN *Volatile OPTIONAL
- );
-
-/**
- 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.
-
- @param[in] FileSystem A pointer to the file system's mapped name. If NULL, then the current working
- directory is changed.
- @param[in] Dir Points to the NULL-terminated directory on the device specified by FileSystem.
-
- @retval NULL Current directory does not exist.
- @return The current directory.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_SET_CUR_DIR) (
- IN CONST CHAR16 *FileSystem OPTIONAL,
- IN CONST CHAR16 *Dir
- );
-
-/**
- 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.
-
- @param[in] Name Points to the NULL-terminated environment variable name.
- @param[in] Value Points to the NULL-terminated environment variable value. If the value is an
- empty string then the environment variable is deleted.
- @param[in] Volatile Indicates whether the variable is non-volatile (FALSE) or volatile (TRUE).
-
- @retval EFI_SUCCESS The environment variable was successfully updated.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_SET_ENV) (
- IN CONST CHAR16 *Name,
- IN CONST CHAR16 *Value,
- IN BOOLEAN Volatile
- );
-
-/**
- Sets the file information to an opened file handle.
-
- This function changes file information. All file information in the EFI_FILE_INFO
- struct will be updated to the passed in data.
-
- @param[in] FileHandle A file handle.
- @param[in] FileInfo Points to new file information.
-
- @retval EFI_SUCCESS The information was set.
- @retval EFI_NO_MEDIA The device has no medium.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_WRITE_PROTECTED The file or medium is write-protected.
- @retval EFI_ACCESS_DENIED The file was opened read-only.
- @retval EFI_VOLUME_FULL The volume is full.
- @retval EFI_BAD_BUFFER_SIZE BufferSize is smaller than the size of EFI_FILE_INFO.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_SET_FILE_INFO)(
- IN SHELL_FILE_HANDLE FileHandle,
- IN CONST EFI_FILE_INFO *FileInfo
- );
-
-/**
- Sets a file's current position.
-
- This function sets the current file position for the handle to the position supplied. With
- the exception of seeking to position 0xFFFFFFFFFFFFFFFF, only absolute positioning is
- supported, and seeking past the end of the file is allowed (a subsequent write would
- grow the file). Seeking to position 0xFFFFFFFFFFFFFFFF causes the current position
- to be set to the end of the file.
-
- @param[in] FileHandle The file handle on which requested position will be set.
- @param[in] Position Byte position from the start of the file.
-
- @retval EFI_SUCCESS Data was written.
- @retval EFI_UNSUPPORTED The seek request for nonzero is not valid on open directories.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_SET_FILE_POSITION)(
- IN SHELL_FILE_HANDLE FileHandle,
- IN UINT64 Position
- );
-
-/**
- This function creates a mapping for a device path.
-
- @param[in] DevicePath Points to the device path. If this is NULL and Mapping points to a valid mapping,
- then the mapping will be deleted.
- @param[in] Mapping Points to the NULL-terminated mapping for the device path.
-
- @retval EFI_SUCCESS Mapping created or deleted successfully.
- @retval EFI_NO_MAPPING There is no handle that corresponds exactly to DevicePath. See the
- boot service function LocateDevicePath().
- @retval EFI_ACCESS_DENIED The mapping is a built-in alias.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_SET_MAP)(
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
- IN CONST CHAR16 *Mapping
- );
-
-/**
- Writes data to the file.
-
- This function writes the specified number of bytes to the file at the current file position.
- The current file position is advanced the actual number of bytes written, which is
- returned in BufferSize. Partial writes only occur when there has been a data error
- during the write attempt (such as "volume space full"). The file automatically grows to
- hold the data, if required.
-
- Direct writes to opened directories are not supported.
-
- @param[in] FileHandle The opened file handle for writing.
- @param[in, out] BufferSize On input, size of Buffer.
- @param[in] Buffer The buffer in which data to write.
-
- @retval EFI_SUCCESS Data was written.
- @retval EFI_UNSUPPORTED Writes to open directory are not supported.
- @retval EFI_NO_MEDIA The device has no media.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_WRITE_PROTECTED The device is write-protected.
- @retval EFI_ACCESS_DENIED The file was open for read only.
- @retval EFI_VOLUME_FULL The volume is full.
-**/
-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_EXECUTE Execute;
- EFI_SHELL_GET_ENV GetEnv;
- EFI_SHELL_SET_ENV SetEnv;
- EFI_SHELL_GET_ALIAS GetAlias;
- EFI_SHELL_SET_ALIAS SetAlias;
- EFI_SHELL_GET_HELP_TEXT GetHelpText;
- EFI_SHELL_GET_DEVICE_PATH_FROM_MAP GetDevicePathFromMap;
- EFI_SHELL_GET_MAP_FROM_DEVICE_PATH GetMapFromDevicePath;
- EFI_SHELL_GET_DEVICE_PATH_FROM_FILE_PATH GetDevicePathFromFilePath;
- EFI_SHELL_GET_FILE_PATH_FROM_DEVICE_PATH GetFilePathFromDevicePath;
- EFI_SHELL_SET_MAP SetMap;
- EFI_SHELL_GET_CUR_DIR GetCurDir;
- EFI_SHELL_SET_CUR_DIR SetCurDir;
- EFI_SHELL_OPEN_FILE_LIST OpenFileList;
- EFI_SHELL_FREE_FILE_LIST FreeFileList;
- EFI_SHELL_REMOVE_DUP_IN_FILE_LIST RemoveDupInFileList;
- EFI_SHELL_BATCH_IS_ACTIVE BatchIsActive;
- EFI_SHELL_IS_ROOT_SHELL IsRootShell;
- EFI_SHELL_ENABLE_PAGE_BREAK EnablePageBreak;
- EFI_SHELL_DISABLE_PAGE_BREAK DisablePageBreak;
- EFI_SHELL_GET_PAGE_BREAK GetPageBreak;
- EFI_SHELL_GET_DEVICE_NAME GetDeviceName;
- EFI_SHELL_GET_FILE_INFO GetFileInfo;
- EFI_SHELL_SET_FILE_INFO SetFileInfo;
- EFI_SHELL_OPEN_FILE_BY_NAME OpenFileByName;
- EFI_SHELL_CLOSE_FILE CloseFile;
- EFI_SHELL_CREATE_FILE CreateFile;
- EFI_SHELL_READ_FILE ReadFile;
- EFI_SHELL_WRITE_FILE WriteFile;
- EFI_SHELL_DELETE_FILE DeleteFile;
- EFI_SHELL_DELETE_FILE_BY_NAME DeleteFileByName;
- EFI_SHELL_GET_FILE_POSITION GetFilePosition;
- EFI_SHELL_SET_FILE_POSITION SetFilePosition;
- EFI_SHELL_FLUSH_FILE FlushFile;
- EFI_SHELL_FIND_FILES FindFiles;
- EFI_SHELL_FIND_FILES_IN_DIR FindFilesInDir;
- EFI_SHELL_GET_FILE_SIZE GetFileSize;
- EFI_SHELL_OPEN_ROOT OpenRoot;
- EFI_SHELL_OPEN_ROOT_BY_HANDLE OpenRootByHandle;
- EFI_EVENT ExecutionBreak;
- UINT32 MajorVersion;
- UINT32 MinorVersion;
-} EFI_SHELL_PROTOCOL;
-
-extern EFI_GUID gEfiShellProtocolGuid;
-
-enum ShellVersion {
- SHELL_MAJOR_VERSION = 2,
- SHELL_MINOR_VERSION = 0
-};
-
-#endif
diff --git a/ShellPkg/Include/Protocol/EfiShellEnvironment2.h b/ShellPkg/Include/Protocol/EfiShellEnvironment2.h
deleted file mode 100644
index 05ec69d5ac..0000000000
--- a/ShellPkg/Include/Protocol/EfiShellEnvironment2.h
+++ /dev/null
@@ -1,975 +0,0 @@
-/** @file
- Defines for EFI shell environment 2 ported to EDK II build environment. (no spec)
-
- Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-#ifndef _SHELL_ENVIRONMENT_2_PROTOCOL_H_
-#define _SHELL_ENVIRONMENT_2_PROTOCOL_H_
-
-#define DEFAULT_INIT_ROW 1
-#define DEFAULT_AUTO_LF FALSE
-
-/**
- This function is a prototype for a function that dumps information on a protocol
- to a given location. The location is dependant on the implementation. This is
- used when programatically adding shell commands.
-
- @param[in] Handle The handle the protocol is on.
- @param[in] Interface The interface to the protocol.
-
-**/
-typedef
-VOID
-(EFIAPI *SHELLENV_DUMP_PROTOCOL_INFO) (
- IN EFI_HANDLE Handle,
- IN VOID *Interface
- );
-
-/**
- This function is a prototype for each command internal to the EFI shell
- implementation. The specific command depends on the implementation. This is
- used when programatically adding shell commands.
-
- @param[in] ImageHandle The handle to the binary shell.
- @param[in] SystemTable The pointer to the system table.
-
- @retval EFI_SUCCESS The command completed.
- @retval other An error occurred. Any error is possible
- depending on the implementation of the shell
- command.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *SHELLENV_INTERNAL_COMMAND) (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- This function is a prototype for one that gets a help string for a given command.
- This is used when programatically adding shell commands. Upon successful return
- the memory allocated is up to the caller to free.
-
- @param[in, out] Str Pointer to pointer to string to display for help.
-
- @retval EFI_SUCCESS The help string is in the parameter Str.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *SHELLCMD_GET_LINE_HELP) (
- IN OUT CHAR16 **Str
- );
-
-/**
-Structure returned from functions that open multiple files.
-**/
-typedef struct {
- UINT32 Signature; ///< SHELL_FILE_ARG_SIGNATURE.
- LIST_ENTRY Link; ///< Linked list helper.
- EFI_STATUS Status; ///< File's status.
-
- EFI_FILE_HANDLE Parent; ///< What is the Parent file of this file.
- UINT64 OpenMode; ///< How was the file opened.
- CHAR16 *ParentName; ///< String representation of parent.
- EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath; ///< DevicePath for Parent.
-
- CHAR16 *FullName; ///< Path and file name for this file.
- CHAR16 *FileName; ///< File name for this file.
-
- EFI_FILE_HANDLE Handle; ///< Handle to this file.
- EFI_FILE_INFO *Info; ///< Pointer to file info for this file.
-} SHELL_FILE_ARG;
-
-/// Signature for SHELL_FILE_ARG.
-#define SHELL_FILE_ARG_SIGNATURE SIGNATURE_32 ('g', 'r', 'a', 'f')
-
-/**
-GUID for the shell environment2 and shell environment.
-**/
-#define SHELL_ENVIRONMENT_PROTOCOL_GUID \
- { \
- 0x47c7b221, 0xc42a, 0x11d2, {0x8e, 0x57, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} \
- }
-
-/**
-GUID for the shell environment2 extension (main GUID above).
-**/
-#define EFI_SE_EXT_SIGNATURE_GUID \
- { \
- 0xd2c18636, 0x40e5, 0x4eb5, {0xa3, 0x1b, 0x36, 0x69, 0x5f, 0xd4, 0x2c, 0x87} \
- }
-
-#define EFI_SHELL_MAJOR_VER 0x00000001 ///< Major version of the EFI_SHELL_ENVIRONMENT2.
-#define EFI_SHELL_MINOR_VER 0x00000000 ///< Minor version of the EFI_SHELL_ENVIRONMENT2.
-
-/**
- Execute a command line.
-
- This function will run the CommandLine. This includes loading any required images,
- parsing any requires scripts, and if DebugOutput is TRUE printing errors
- encountered directly to the screen.
-
- @param[in] ParentImageHandle Handle of the image executing this operation.
- @param[in] CommandLine The string command line to execute.
- @param[in] DebugOutput TRUE indicates that errors should be printed directly.
- FALSE supresses error messages.
-
- @retval EFI_SUCCESS The command line executed and completed.
- @retval EFI_ABORTED The operation aborted.
- @retval EFI_INVALID_PARAMETER A parameter did not have a valid value.
- @retval EFI_OUT_OF_RESOURCES A required memory allocation failed.
-
-@sa HandleProtocol
-**/
-typedef
-EFI_STATUS
-(EFIAPI *SHELLENV_EXECUTE) (
- IN EFI_HANDLE *ParentImageHandle,
- IN CHAR16 *CommandLine,
- IN BOOLEAN DebugOutput
- );
-
-/**
- This function returns a shell environment variable value.
-
- @param[in] Name The pointer to the string with the shell environment
- variable name.
-
- @retval NULL The shell environment variable's value could not be found.
- @retval !=NULL The value of the shell environment variable Name.
-
-**/
-typedef
-CHAR16 *
-(EFIAPI *SHELLENV_GET_ENV) (
- IN CHAR16 *Name
- );
-
-/**
- This function returns a shell environment map value.
-
- @param[in] Name The pointer to the string with the shell environment
- map name.
-
- @retval NULL The shell environment map's value could not be found.
- @retval !=NULL The value of the shell environment map Name.
-
-**/
-typedef
-CHAR16 *
-(EFIAPI *SHELLENV_GET_MAP) (
- IN CHAR16 *Name
- );
-
-/**
- This function will add an internal command to the shell interface.
-
- This will allocate all required memory, put the new command on the command
- list in the correct location.
-
- @param[in] Handler The handler function to call when the command gets called.
- @param[in] Cmd The command name.
- @param[in] GetLineHelp The function to call of type "get help" for this command.
-
- @retval EFI_SUCCESS The command is now part of the command list.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
- @sa SHELLENV_INTERNAL_COMMAND
- @sa SHELLCMD_GET_LINE_HELP
-**/
-typedef
-EFI_STATUS
-(EFIAPI *SHELLENV_ADD_CMD) (
- IN SHELLENV_INTERNAL_COMMAND Handler,
- IN CHAR16 *Cmd,
- IN SHELLCMD_GET_LINE_HELP GetLineHelp
- );
-
-/**
- Internal interface to add protocol handlers.
-
- This function is for internal shell use only. This is how protocol handlers are added.
- This will get the current protocol info and add the new info or update existing info
- and then resave the info.
-
- @param[in] Protocol The pointer to the protocol's GUID.
- @param[in] DumpToken The function pointer to dump token function or
- NULL.
- @param[in] DumpInfo The function pointer to dump infomation function
- or NULL.
- @param[in] IdString The English name of the protocol.
-**/
-typedef
-VOID
-(EFIAPI *SHELLENV_ADD_PROT) (
- IN EFI_GUID *Protocol,
- IN SHELLENV_DUMP_PROTOCOL_INFO DumpToken OPTIONAL,
- IN SHELLENV_DUMP_PROTOCOL_INFO DumpInfo OPTIONAL,
- IN CHAR16 *IdString
- );
-
-/**
- This function finds a protocol handle by a GUID.
-
- This function will check for already known protocols by GUID and if one is
- found it will return the name of that protocol. If no name is found and
- GenId is TRUE it will generate ths string.
-
- @param[in] Protocol The GUID of the protocol to look for.
- @param[in] GenId Whether to generate a name string if it is not found.
-
- @return !NULL The Name of the protocol.
- @retval NULL The Name was not found, and GenId was not TRUE.
-**/
-typedef
-CHAR16*
-(EFIAPI *SHELLENV_GET_PROT) (
- IN EFI_GUID *Protocol,
- IN BOOLEAN GenId
- );
-
-/**
- This function returns a string array containing the current directory on
- a given device.
-
- If DeviceName is specified, then return the current shell directory on that
- device. If DeviceName is NULL, then return the current directory on the
- current device. The caller us responsible to free the returned string when
- no longer required.
-
- @param[in] DeviceName The name of the device to get the current
- directory on, or NULL for current device.
-
- @return String array with the current directory on the current or specified device.
-
-**/
-typedef
-CHAR16*
-(EFIAPI *SHELLENV_CUR_DIR) (
- IN CHAR16 *DeviceName OPTIONAL
- );
-
-/**
- This function will open a group of files that match the Arg path, including
- support for wildcard characters ('?' and '*') in the Arg path. If there are
- any wildcard characters in the path this function will find any and all files
- that match the wildcards. It returns a double linked list based on the
- LIST_ENTRY linked list structure. Use this in conjunction with the
- SHELL_FILE_ARG_SIGNATURE to get the SHELL_FILE_ARG structures that are returned.
- The memory allocated by the callee for this list is freed by making a call to
- SHELLENV_FREE_FILE_LIST.
-
- @param[in] Arg The pointer Path to files to open.
- @param[in, out] ListHead The pointer to the allocated and initialized list head
- upon which to append all opened file structures.
-
- @retval EFI_SUCCESS One or more files was opened and a struct of each file's
- information was appended to ListHead.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
- @retval EFI_NOT_FOUND No matching files could be found.
- @sa SHELLENV_FREE_FILE_LIST
-**/typedef
-EFI_STATUS
-(EFIAPI *SHELLENV_FILE_META_ARG) (
- IN CHAR16 *Arg,
- IN OUT LIST_ENTRY *ListHead
- );
-
-/**
- This frees all of the nodes under the ListHead, but not ListHead itself.
-
- @param[in, out] ListHead Pointer to list to free all nodes of.
-
- @retval EFI_SUCCESS This function always returns EFI_SUCCESS.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *SHELLENV_FREE_FILE_LIST) (
- IN OUT LIST_ENTRY *ListHead
- );
-
-/**
- This function creates a new instance of the ShellInterface protocol for use on
- the ImageHandle.
-
- This function is for internal shell usage. This will allocate and then populate
- EFI_SHELL_INTERFACE protocol. It is the caller's responsibility to free the
- memory.
-
- @param[in] ImageHandle The handle which will use the new ShellInterface
- protocol.
-
- @return The newly allocated shell interface protocol.
-
-**/
-typedef
-EFI_SHELL_INTERFACE*
-(EFIAPI *SHELLENV_NEW_SHELL) (
- IN EFI_HANDLE ImageHandle
- );
-
-/**
- This function determins whether a script file is currently being processed.
-
- A script file (.nsh file) can contain a series of commands and this is useful to
- know for some shell commands whether they are being run manually or as part of a
- script.
-
- @retval TRUE A script file is being processed.
- @retval FALSE A script file is not being processed.
-**/
-typedef
-BOOLEAN
-(EFIAPI *SHELLENV_BATCH_IS_ACTIVE) (
- VOID
- );
-
-/**
- This is an internal shell function to free any and all allocated resources.
- This should be called immediately prior to closing the shell.
-**/
-typedef
-VOID
-(EFIAPI *SHELLENV_FREE_RESOURCES) (
- VOID
- );
-
-/**
- This function enables the page break mode.
-
- This mode causes the output to pause after each complete screen to enable a
- user to more easily read it. If AutoWrap is TRUE, then rows with too many
- characters will be chopped and divided into 2 rows. If FALSE, then rows with
- too many characters may not be fully visible to the user on the screen.
-
- @param[in] StartRow The row number to start this on.
- @param[in] AutoWrap Whether to auto wrap rows that are too long.
-**/
-typedef
-VOID
-(EFIAPI *SHELLENV_ENABLE_PAGE_BREAK) (
- IN INT32 StartRow,
- IN BOOLEAN AutoWrap
- );
-
-/**
- This function disables the page break mode.
-
- Disabling this causes the output to print out exactly as coded, with no breaks
- for readability.
-**/
-typedef
-VOID
-(EFIAPI *SHELLENV_DISABLE_PAGE_BREAK) (
- VOID
- );
-
-/**
- Get the status of the page break output mode.
-
- @retval FALSE Page break output mode is not enabled.
- @retval TRUE Page break output mode is enabled.
-**/
-typedef
-BOOLEAN
-(EFIAPI *SHELLENV_GET_PAGE_BREAK) (
- VOID
- );
-
-/**
- This function sets the keys to filter for for the console in. The valid
- values to set are:
-
- #define EFI_OUTPUT_SCROLL 0x00000001
- #define EFI_OUTPUT_PAUSE 0x00000002
- #define EFI_EXECUTION_BREAK 0x00000004
-
- @param[in] KeyFilter The new key filter to use.
-**/
-typedef
-VOID
-(EFIAPI *SHELLENV_SET_KEY_FILTER) (
- IN UINT32 KeyFilter
- );
-
-/**
- This function gets the keys to filter for for the console in.
-
- The valid values to get are:
- #define EFI_OUTPUT_SCROLL 0x00000001
- #define EFI_OUTPUT_PAUSE 0x00000002
- #define EFI_EXECUTION_BREAK 0x00000004
-
- @retval The current filter mask.
-**/
-typedef
-UINT32
-(EFIAPI *SHELLENV_GET_KEY_FILTER) (
- VOID
- );
-
-/**
- This function determins if the shell application should break.
-
- This is used to inform a shell application that a break condition has been
- initiated. Long loops should check this to prevent delays to the break.
-
- @retval TRUE A break has been signaled. The application
- should exit with EFI_ABORTED as soon as possible.
- @retval FALSE Continue as normal.
-**/
-typedef
-BOOLEAN
-(EFIAPI *SHELLENV_GET_EXECUTION_BREAK) (
- VOID
- );
-
-/**
- This is an internal shell function used to increment the shell nesting level.
-
-**/
-typedef
-VOID
-(EFIAPI *SHELLENV_INCREMENT_SHELL_NESTING_LEVEL) (
- VOID
- );
-
-/**
- This is an internal shell function used to decrement the shell nesting level.
-**/
-typedef
-VOID
-(EFIAPI *SHELLENV_DECREMENT_SHELL_NESTING_LEVEL) (
- VOID
- );
-
-/**
- This function determins if the caller is running under the root shell.
-
- @retval TRUE The caller is running under the root shell.
- @retval FALSE The caller is not running under the root shell.
-
-**/
-typedef
-BOOLEAN
-(EFIAPI *SHELLENV_IS_ROOT_SHELL) (
- VOID
- );
-
-/**
- Close the console proxy to restore the original console.
-
- This is an internal shell function to handle shell cascading. It restores the
- original set of console protocols.
-
- @param[in] ConInHandle The handle of ConIn.
- @param[in, out] ConIn The pointer to the location to return the pointer to
- the original console input.
- @param[in] ConOutHandle The handle of ConOut
- @param[in, out] ConOut The pointer to the location to return the pointer to
- the original console output.
-**/
-typedef
-VOID
-(EFIAPI *SHELLENV_CLOSE_CONSOLE_PROXY) (
- IN EFI_HANDLE ConInHandle,
- IN OUT EFI_SIMPLE_TEXT_INPUT_PROTOCOL **ConIn,
- IN EFI_HANDLE ConOutHandle,
- IN OUT EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL **ConOut
- );
-
-//
-// declarations of handle enumerator
-//
-/**
- For ease of use the shell maps handle #'s to short numbers.
- This is only done on request for various internal commands and the references
- are immediately freed when the internal command completes.
-**/
-typedef
-VOID
-(EFIAPI *INIT_HANDLE_ENUMERATOR) (
- VOID
- );
-
-/**
- This is an internal shell function to enumerate the handle database.
-
- This function gets the next handle in the handle database. If no handles are
- found, EFI_NOT_FOUND is returned. If the previous Handle was the last handle,
- it is set to NULL before returning.
-
- This must be called after INIT_HANDLE_ENUMERATOR and before CLOSE_HANDLE_ENUMERATOR.
-
- @param[in, out] Handle The pointer to pointer to Handle. It is set
- on a sucessful return.
-
- @retval EFI_SUCCESS The next handle in the handle database is *Handle.
- @retval EFI_NOT_FOUND There is not another handle.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *NEXT_HANDLE) (
- IN OUT EFI_HANDLE **Handle
- );
-
-/**
- This is an internal shell function to enumerate the handle database.
-
- This function skips the next SkipNum handles in the handle database. If there
- are not enough handles left to skip that many EFI_ACCESS_DENIED is returned and
- no skip is performed.
-
- This must be called after INIT_HANDLE_ENUMERATOR and before CLOSE_HANDLE_ENUMERATOR.
-
- @param[in] SkipNum How many handles to skip
-
- @retval EFI_SUCCESS The next handle in the handle database is *Handle
- @retval EFI_ACCESS_DENIED There are not SkipNum handles left in the database
-**/
-typedef
-EFI_STATUS
-(EFIAPI *SKIP_HANDLE) (
- IN UINTN SkipNum
- );
-
-/**
- This is an internal shell function to enumerate the handle database.
-
- This function resets the the handle database so that NEXT_HANDLE and SKIP_HANDLE
- will start from EnumIndex on the next call.
-
- This must be called after INIT_HANDLE_ENUMERATOR and before CLOSE_HANDLE_ENUMERATOR.
-
- @param[in] EnumIndex Where to start.
-
- @return The number of handles either read out or skipped before this reset.
-**/
-typedef
-UINTN
-(EFIAPI *RESET_HANDLE_ENUMERATOR) (
- IN UINTN EnumIndex
- );
-
-/**
- This is an internal shell function to enumerate the handle database.
-
- This must be called after INIT_HANDLE_ENUMERATOR.
-
- This function releases all memory and resources associated with the handle database.
- After this no other handle enumerator functions except INIT_HANDLE_ENUMERATOR will
- function properly.
-**/
-typedef
-VOID
-(EFIAPI *CLOSE_HANDLE_ENUMERATOR) (
- VOID
- );
-
-/**
- This is an internal shell function to enumerate the handle database.
-
- This function returns the number of handles in the handle database.
-
- This must be called after INIT_HANDLE_ENUMERATOR and before CLOSE_HANDLE_ENUMERATOR.
-
- @return The number of handles in the handle database.
-**/
-typedef
-UINTN
-(EFIAPI *GET_NUM) (
- VOID
- );
-
-/**
-Handle Enumerator structure.
-**/
-typedef struct {
- INIT_HANDLE_ENUMERATOR Init; ///< The pointer to INIT_HANDLE_ENUMERATOR function.
- NEXT_HANDLE Next; ///< The pointer to NEXT_HANDLE function.
- SKIP_HANDLE Skip; ///< The pointer to SKIP_HANDLE function.
- RESET_HANDLE_ENUMERATOR Reset; ///< The pointer to RESET_HANDLE_ENUMERATOR function.
- CLOSE_HANDLE_ENUMERATOR Close; ///< The pointer to CLOSE_HANDLE_ENUMERATOR function.
- GET_NUM GetNum; ///< The pointer to GET_NUM function.
-} HANDLE_ENUMERATOR;
-
-/**
- Signature for the PROTOCOL_INFO structure.
-**/
-#define PROTOCOL_INFO_SIGNATURE SIGNATURE_32 ('s', 'p', 'i', 'n')
-
-/**
- PROTOCOL_INFO structure for protocol enumerator functions.
-**/
-typedef struct {
- UINTN Signature; ///< PROTOCOL_INFO_SIGNATURE.
- LIST_ENTRY Link; ///< Standard linked list helper member.
- //
- // The parsing info for the protocol.
- //
- EFI_GUID ProtocolId; ///< The GUID for the protocol.
- CHAR16 *IdString; ///< The name of the protocol.
- SHELLENV_DUMP_PROTOCOL_INFO DumpToken; ///< The pointer to DumpToken function for the protocol.
- SHELLENV_DUMP_PROTOCOL_INFO DumpInfo; ///< The pointer to DumpInfo function for the protocol.
- //
- // Patabase info on which handles are supporting this protocol.
- //
- UINTN NoHandles; ///< The number of handles producing this protocol.
- EFI_HANDLE *Handles; ///< The array of handles.
-
-} PROTOCOL_INFO;
-
-//
-// Declarations of protocol info enumerator.
-//
-/**
- This is an internal shell function to initialize the protocol enumerator.
-
- This must be called before NEXT_PROTOCOL_INFO, SKIP_PROTOCOL_INFO,
- RESET_PROTOCOL_INFO_ENUMERATOR, and CLOSE_PROTOCOL_INFO_ENUMERATOR are
- called.
-**/
-typedef
-VOID
-(EFIAPI *INIT_PROTOCOL_INFO_ENUMERATOR) (
- VOID
- );
-
-/**
- This function is an internal shell function for enumeration of protocols.
-
- This function returns the next protocol on the list. If this is called
- immediately after initialization, it will return the first protocol on the list.
- If this is called immediately after reset, it will return the first protocol again.
-
- This cannot be called after CLOSE_PROTOCOL_INFO_ENUMERATOR, but it must be
- called after INIT_PROTOCOL_INFO_ENUMERATOR.
-
- @param[in, out] ProtocolInfo The pointer to pointer to protocol information structure.
-
- @retval EFI_SUCCESS The next protocol's information was sucessfully returned.
- @retval NULL There are no more protocols.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *NEXT_PROTOCOL_INFO) (
- IN OUT PROTOCOL_INFO **ProtocolInfo
- );
-
-/**
- This function is an internal shell function for enumeration of protocols.
-
- This cannot be called after CLOSE_PROTOCOL_INFO_ENUMERATOR, but it must be
- called after INIT_PROTOCOL_INFO_ENUMERATOR.
-
- This function does nothing and always returns EFI_SUCCESS.
-
- @retval EFI_SUCCESS Always returned (see above).
-**/
-typedef
-EFI_STATUS
-(EFIAPI *SKIP_PROTOCOL_INFO) (
- IN UINTN SkipNum
- );
-
-/**
- This function is an internal shell function for enumeration of protocols.
-
- This cannot be called after CLOSE_PROTOCOL_INFO_ENUMERATOR, but it must be
- called after INIT_PROTOCOL_INFO_ENUMERATOR.
-
- This function resets the list of protocols such that the next one in the
- list is the begining of the list.
-**/
-typedef
-VOID
-(EFIAPI *RESET_PROTOCOL_INFO_ENUMERATOR) (
- VOID
- );
-
-
-/**
- This function is an internal shell function for enumeration of protocols.
-
- This must be called after INIT_PROTOCOL_INFO_ENUMERATOR. After this call
- no protocol enumerator calls except INIT_PROTOCOL_INFO_ENUMERATOR may be made.
-
- This function frees any memory or resources associated with the protocol
- enumerator.
-**/
-typedef
-VOID
-(EFIAPI *CLOSE_PROTOCOL_INFO_ENUMERATOR) (
- VOID
- );
-
-/**
- Protocol enumerator structure of function pointers.
-**/
-typedef struct {
- INIT_PROTOCOL_INFO_ENUMERATOR Init; ///< The pointer to INIT_PROTOCOL_INFO_ENUMERATOR function.
- NEXT_PROTOCOL_INFO Next; ///< The pointer to NEXT_PROTOCOL_INFO function.
- SKIP_PROTOCOL_INFO Skip; ///< The pointer to SKIP_PROTOCOL_INFO function.
- RESET_PROTOCOL_INFO_ENUMERATOR Reset; ///< The pointer to RESET_PROTOCOL_INFO_ENUMERATOR function.
- CLOSE_PROTOCOL_INFO_ENUMERATOR Close; ///< The pointer to CLOSE_PROTOCOL_INFO_ENUMERATOR function.
-} PROTOCOL_INFO_ENUMERATOR;
-
-/**
- This function is used to retrieve a user-friendly display name for a handle.
-
- If UseComponentName is TRUE then the component name protocol for this device
- or it's parent device (if required) will be used to obtain the name of the
- device. If UseDevicePath is TRUE it will get the human readable device path
- and return that. If both are TRUE it will try to use component name first
- and device path if that fails.
-
- It will use either ComponentName or ComponentName2 protocol, depending on
- what is present.
-
- This function will furthur verify whether the handle in question produced either
- EFI_DRIVER_CONFIGRATION_PROTOCOL or EFI_DRIVER_CONFIGURATION2_PROTOCOL and also
- whether the handle in question produced either EFI_DRIVER_DIAGNOSTICS_PROTOCOL or
- EFI_DRIVER_DIAGNOSTICS2_PROTOCOL.
-
- Upon successful return, the memory for *BestDeviceName is up to the caller to free.
-
- @param[in] DeviceHandle The device handle whose name is desired.
- @param[in] UseComponentName Whether to use the ComponentName protocol at all.
- @param[in] UseDevicePath Whether to use the DevicePath protocol at all.
- @param[in] Language The pointer to the language string to use.
- @param[in, out] BestDeviceName The pointer to pointer to string allocated with the name.
- @param[out] ConfigurationStatus The pointer to status for opening a Configuration protocol.
- @param[out] DiagnosticsStatus The pointer to status for opening a Diagnostics protocol.
- @param[in] Display Whether to Print this out to default Print location.
- @param[in] Indent How many characters to indent the printing.
-
- @retval EFI_SUCCESS This function always returns EFI_SUCCESS.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *GET_DEVICE_NAME) (
- IN EFI_HANDLE DeviceHandle,
- IN BOOLEAN UseComponentName,
- IN BOOLEAN UseDevicePath,
- IN CHAR8 *Language,
- IN OUT CHAR16 **BestDeviceName,
- OUT EFI_STATUS *ConfigurationStatus,
- OUT EFI_STATUS *DiagnosticsStatus,
- IN BOOLEAN Display,
- IN UINTN Indent
- );
-
-#define EFI_SHELL_COMPATIBLE_MODE_VER L"1.1.1" ///< The string for lowest version this shell supports.
-#define EFI_SHELL_ENHANCED_MODE_VER L"1.1.2" ///< The string for highest version this shell supports.
-
-/**
- This function gets the shell mode as stored in the shell environment
- "efishellmode". It will not fail.
-
- @param[out] Mode Returns a string representing one of the
- 2 supported modes of the shell.
-
- @retval EFI_SUCCESS This function always returns success.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *GET_SHELL_MODE) (
- OUT CHAR16 **Mode
- );
-
-/**
- Convert a file system style name to a device path.
-
- This function will convert a shell path name to a Device Path Protocol path.
- This function will allocate any required memory for this operation and it
- is the responsibility of the caller to free that memory when no longer required.
-
- If anything prevents the complete conversion free any allocated memory and
- return NULL.
-
- @param[in] Path The path to convert.
-
- @retval !NULL A pointer to the callee allocated Device Path.
- @retval NULL The operation could not be completed.
-**/
-typedef
-EFI_DEVICE_PATH_PROTOCOL*
-(EFIAPI *SHELLENV_NAME_TO_PATH) (
- IN CHAR16 *Path
- );
-
-/**
- Converts a device path into a file system map name.
-
- If DevPath is NULL, then ASSERT.
-
- This function looks through the shell environment map for a map whose device
- path matches the DevPath parameter. If one is found the Name is returned via
- Name parameter. If sucessful the caller must free the memory allocated for
- Name.
-
- This function will use the internal lock to prevent changes to the map during
- the lookup operation.
-
- @param[in] DevPath The device path to search for a name for.
- @param[in] ConsistMapping What state to verify map flag VAR_ID_CONSIST.
- @param[out] Name On sucessful return the name of that device path.
-
- @retval EFI_SUCCESS The DevPath was found and the name returned
- in Name.
- @retval EFI_OUT_OF_RESOURCES A required memory allocation failed.
- @retval EFI_UNSUPPORTED The DevPath was not found in the map.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *SHELLENV_GET_FS_NAME) (
- IN EFI_DEVICE_PATH_PROTOCOL * DevPath,
- IN BOOLEAN ConsistMapping,
- OUT CHAR16 **Name
- );
-
-/**
- This function will open a group of files that match the Arg path, but will not
- support the wildcard characters ('?' and '*') in the Arg path. If there are
- any wildcard characters in the path this function will return
- EFI_INVALID_PARAMETER. The return is a double linked list based on the
- LIST_ENTRY linked list structure. Use this in conjunction with the
- SHELL_FILE_ARG_SIGNATURE to get the SHELL_FILE_ARG structures that are returned.
- The memory allocated by the callee for this list is freed by making a call to
- SHELLENV_FREE_FILE_LIST.
-
- @param[in] Arg The pointer to the path of the files to be opened.
- @param[in, out] ListHead The pointer to allocated and initialized list head
- upon which to append all the opened file structures.
-
- @retval EFI_SUCCESS One or more files was opened and a struct of each file's
- information was appended to ListHead.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
- @retval EFI_NOT_FOUND No matching files could be found.
- @sa SHELLENV_FREE_FILE_LIST
-**/
-typedef
-EFI_STATUS
-(EFIAPI *SHELLENV_FILE_META_ARG_NO_WILDCARD) (
- IN CHAR16 *Arg,
- IN OUT LIST_ENTRY *ListHead
- );
-
-/**
- This function removes duplicate file listings from lists.
-
- This is a function for use with SHELLENV_FILE_META_ARG_NO_WILDCARD and
- SHELLENV_FILE_META_ARG. This function will verify that there are no duplicate
- files in the list of returned files. Any file listed twice will have one of its
- instances removed.
-
- @param[in] ListHead The pointer to linked list head that was returned from
- SHELLENV_FILE_META_ARG_NO_WILDCARD or
- SHELLENV_FILE_META_ARG.
-
- @retval EFI_SUCCESS This function always returns success.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *SHELLENV_DEL_DUP_FILE) (
- IN LIST_ENTRY * ListHead
- );
-
-/**
- Converts a File System map name to a device path.
-
- If DevPath is NULL, then ASSERT().
-
- This function looks through the shell environment map for a map whose Name
- matches the Name parameter. If one is found, the device path pointer is
- updated to point to that file systems device path. The caller should not
- free the memory from that device path.
-
- This function will use the internal lock to prevent changes to the map during
- the lookup operation.
-
- @param[in] Name The pointer to the NULL terminated UNICODE string of the
- file system name.
- @param[out] DevPath The pointer to pointer to DevicePath. Only valid on
- successful return.
-
- @retval EFI_SUCCESS The conversion was successful, and the device
- path was returned.
- @retval EFI_NOT_FOUND The file system could not be found in the map.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *SHELLENV_GET_FS_DEVICE_PATH) (
- IN CHAR16 *Name,
- OUT EFI_DEVICE_PATH_PROTOCOL **DevPath
- );
-
-/// EFI_SHELL_ENVIRONMENT2 protocol structure.
-typedef struct {
- SHELLENV_EXECUTE Execute;
- SHELLENV_GET_ENV GetEnv;
- SHELLENV_GET_MAP GetMap;
- SHELLENV_ADD_CMD AddCmd;
- SHELLENV_ADD_PROT AddProt;
- SHELLENV_GET_PROT GetProt;
- SHELLENV_CUR_DIR CurDir;
- SHELLENV_FILE_META_ARG FileMetaArg;
- SHELLENV_FREE_FILE_LIST FreeFileList;
-
- //
- // The following services are only used by the shell itself.
- //
- SHELLENV_NEW_SHELL NewShell;
- SHELLENV_BATCH_IS_ACTIVE BatchIsActive;
-
- SHELLENV_FREE_RESOURCES FreeResources;
-
- //
- // GUID to differentiate ShellEnvironment2 from ShellEnvironment.
- //
- EFI_GUID SESGuid;
- //
- // Major Version grows if shell environment interface has been changes.
- //
- UINT32 MajorVersion;
- UINT32 MinorVersion;
- SHELLENV_ENABLE_PAGE_BREAK EnablePageBreak;
- SHELLENV_DISABLE_PAGE_BREAK DisablePageBreak;
- SHELLENV_GET_PAGE_BREAK GetPageBreak;
-
- SHELLENV_SET_KEY_FILTER SetKeyFilter;
- SHELLENV_GET_KEY_FILTER GetKeyFilter;
-
- SHELLENV_GET_EXECUTION_BREAK GetExecutionBreak;
- SHELLENV_INCREMENT_SHELL_NESTING_LEVEL IncrementShellNestingLevel;
- SHELLENV_DECREMENT_SHELL_NESTING_LEVEL DecrementShellNestingLevel;
- SHELLENV_IS_ROOT_SHELL IsRootShell;
-
- SHELLENV_CLOSE_CONSOLE_PROXY CloseConsoleProxy;
- HANDLE_ENUMERATOR HandleEnumerator;
- PROTOCOL_INFO_ENUMERATOR ProtocolInfoEnumerator;
- GET_DEVICE_NAME GetDeviceName;
- GET_SHELL_MODE GetShellMode;
- SHELLENV_NAME_TO_PATH NameToPath;
- SHELLENV_GET_FS_NAME GetFsName;
- SHELLENV_FILE_META_ARG_NO_WILDCARD FileMetaArgNoWildCard;
- SHELLENV_DEL_DUP_FILE DelDupFileArg;
- SHELLENV_GET_FS_DEVICE_PATH GetFsDevicePath;
-} EFI_SHELL_ENVIRONMENT2;
-
-extern EFI_GUID gEfiShellEnvironment2Guid;
-extern EFI_GUID gEfiShellEnvironment2ExtGuid;
-
-#endif // _SHELL_ENVIRONMENT_2_PROTOCOL_H_
diff --git a/ShellPkg/Include/Protocol/EfiShellInterface.h b/ShellPkg/Include/Protocol/EfiShellInterface.h
deleted file mode 100644
index 6a34c60b07..0000000000
--- a/ShellPkg/Include/Protocol/EfiShellInterface.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/** @file
- EFI Shell Interface protocol from EDK shell (no spec).
-
- Shell Interface - additional information (over image_info) provided
- to an application started by the shell.
-
- ConIo provides a file-style interface to the console.
-
- The shell interface's and data (including ConIo) are only valid during
- the applications Entry Point. Once the application returns from it's
- entry point the data is freed by the invoking shell.
-
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _SHELLINTERFACE_H_
-#define _SHELLINTERFACE_H_
-
-#include <Protocol/SimpleFileSystem.h>
-
-#define SHELL_INTERFACE_PROTOCOL_GUID \
- { \
- 0x47c7b223, 0xc42a, 0x11d2, {0x8e, 0x57, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} \
- }
-
-///
-/// Bit definitions for EFI_SHELL_ARG_INFO
-///
-typedef enum {
- ARG_NO_ATTRIB = 0x0,
- ARG_IS_QUOTED = BIT0,
- ARG_PARTIALLY_QUOTED = BIT1,
- ARG_FIRST_HALF_QUOTED = BIT2,
- ARG_FIRST_CHAR_IS_ESC = BIT3
-} EFI_SHELL_ARG_INFO_TYPES;
-
-///
-/// Attributes for an argument.
-///
-typedef struct _EFI_SHELL_ARG_INFO {
- UINT32 Attributes;
-} EFI_SHELL_ARG_INFO;
-
-///
-/// This protocol provides access to additional information about a shell application.
-///
-typedef struct {
- ///
- /// Handle back to original image handle & image information.
- ///
- EFI_HANDLE ImageHandle;
- EFI_LOADED_IMAGE_PROTOCOL *Info;
-
- ///
- /// Parsed arg list converted more C-like format.
- ///
- CHAR16 **Argv;
- UINTN Argc;
-
- ///
- /// Storage for file redirection args after parsing.
- ///
- CHAR16 **RedirArgv;
- UINTN RedirArgc;
-
- ///
- /// A file style handle for console io.
- ///
- EFI_FILE_PROTOCOL *StdIn;
- EFI_FILE_PROTOCOL *StdOut;
- EFI_FILE_PROTOCOL *StdErr;
-
- ///
- /// List of attributes for each argument.
- ///
- EFI_SHELL_ARG_INFO *ArgInfo;
-
- ///
- /// Whether we are echoing.
- ///
- BOOLEAN EchoOn;
-} EFI_SHELL_INTERFACE;
-
-extern EFI_GUID gEfiShellInterfaceGuid;
-
-#endif
diff --git a/ShellPkg/Include/Protocol/EfiShellParameters.h b/ShellPkg/Include/Protocol/EfiShellParameters.h
deleted file mode 100644
index e52328b3a4..0000000000
--- a/ShellPkg/Include/Protocol/EfiShellParameters.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/** @file
- EFI Shell protocol as defined in the UEFI Shell 2.0 specification.
-
- Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __EFI_SHELL_PARAMETERS_PROTOCOL__
-#define __EFI_SHELL_PARAMETERS_PROTOCOL__
-
-#include <ShellBase.h>
-
-#define EFI_SHELL_PARAMETERS_PROTOCOL_GUID \
- { \
- 0x752f3136, 0x4e16, 0x4fdc, { 0xa2, 0x2a, 0xe5, 0xf4, 0x68, 0x12, 0xf4, 0xca } \
- }
-
-typedef struct _EFI_SHELL_PARAMETERS_PROTOCOL {
- ///
- /// Points to an Argc-element array of points to NULL-terminated strings containing
- /// the command-line parameters. The first entry in the array is always the full file
- /// path of the executable. Any quotation marks that were used to preserve
- /// whitespace have been removed.
- ///
- CHAR16 **Argv;
-
- ///
- /// The number of elements in the Argv array.
- ///
- UINTN Argc;
-
- ///
- /// The file handle for the standard input for this executable. This may be different
- /// from the ConInHandle in EFI_SYSTEM_TABLE.
- ///
- SHELL_FILE_HANDLE StdIn;
-
- ///
- /// The file handle for the standard output for this executable. This may be different
- /// from the ConOutHandle in EFI_SYSTEM_TABLE.
- ///
- SHELL_FILE_HANDLE StdOut;
-
- ///
- /// The file handle for the standard error output for this executable. This may be
- /// different from the StdErrHandle in EFI_SYSTEM_TABLE.
- ///
- SHELL_FILE_HANDLE StdErr;
-} EFI_SHELL_PARAMETERS_PROTOCOL;
-
-extern EFI_GUID gEfiShellParametersProtocolGuid;
-
-#endif