/** @file\r
- EFI Shell protocol as defined in the UEFI Shell 2.0 specification.\r
+ EFI Shell protocol as defined in the UEFI Shell 2.0 specification including errata.\r
\r
Copyright (c) 2006 - 2009, Intel Corporation \r
All rights reserved. This program and the accompanying materials \r
flushed to the device, and the file is closed. In all cases, the handle is \r
closed.\r
\r
- @param FileHandle The file handle to be closed\r
+ @param[in] FileHandle The file handle to be closed\r
\r
@retval EFI_SUCCESS the file closed sucessfully\r
**/\r
shell environment variable with the specified name. If the shell environment variable\r
already exists and is non-volatile then EFI_INVALID_PARAMETER is returned.\r
\r
- @param FileName Pointer to null-terminated file path\r
- @param FileAttribs The new file's attrbiutes. the different attributes are\r
+ @param[in] FileName Pointer to null-terminated file path\r
+ @param[in] FileAttribs The new file's attrbiutes. the different attributes are\r
described in EFI_FILE_PROTOCOL.Open().\r
- @param FileHandle On return, points to the created file handle or directory's handle\r
+ @param[out] FileHandle On return, points to the created file handle or directory's handle\r
\r
@retval EFI_SUCCESS The file was opened. FileHandle points to the new file's handle.\r
@retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r
cannot be deleted, the warning code EFI_WARN_DELETE_FAILURE is returned, but the\r
handle is still closed.\r
\r
- @param FileHandle The file handle to delete.\r
+ @param[in] FileHandle The file handle to delete.\r
\r
@retval EFI_SUCCESS The file was closed and deleted, and the handle was closed.\r
@retval EFI_WARN_DELETE_FAILURE The handle was closed but the file was not deleted.\r
\r
This function deletes a file.\r
\r
- @param FileName Points to the null-terminated file name.\r
+ @param[in] FileName Points to the null-terminated file name.\r
\r
- @retval EFI_SUCCESS The file was closed and deleted, and the handle was closed.\r
+ @retval EFI_SUCCESS The file was closed and deleted, and the handle was closed.\r
@retval EFI_WARN_DELETE_FAILURE The handle was closed but the file was not deleted.\r
**/\r
typedef\r
The CommandLine is executed from the current working directory on the current\r
device.\r
\r
- @param ParentImageHandle A handle of the image that is executing the specified \r
- command line. \r
- @param CommandLine Points to the null-terminated UCS-2 encoded string \r
- containing the command line. If NULL then the command-\r
- line will be empty.\r
- @param Environment Points to a null-terminated array of environment \r
- variables with the format 'x=y', where x is the \r
- environment variable name and y is the value. If this\r
- is NULL, then the current shell environment is used.\r
- @param ErrorCode Points to the status code returned by the command.\r
-\r
- @retval EFI_SUCCESS The command executed successfully. The status code \r
- returned by the command is pointed to by StatusCode.\r
+ @param[in] ParentImageHandle A handle of the image that is executing the specified \r
+ command line. \r
+ @param[in] CommandLine Points to the null-terminated UCS-2 encoded string \r
+ containing the command line. If NULL then the command-\r
+ line will be empty.\r
+ @param[in] Environment Points to a null-terminated array of environment \r
+ variables with the format 'x=y', where x is the \r
+ environment variable name and y is the value. If this\r
+ is NULL, then the current shell environment is used.\r
+ @param[out] ErrorCode Points to the status code returned by the command.\r
+\r
+ @retval EFI_SUCCESS The command executed successfully. The status code \r
+ returned by the command is pointed to by StatusCode.\r
@retval EFI_INVALID_PARAMETER The parameters are invalid.\r
- @retval EFI_OUT_OF_RESOURCES Out of resources.\r
- @retval EFI_UNSUPPORTED Nested shell invocations are not allowed.\r
+ @retval EFI_OUT_OF_RESOURCES Out of resources.\r
+ @retval EFI_UNSUPPORTED Nested shell invocations are not allowed.\r
**/\r
typedef\r
EFI_STATUS\r
The files in the file list are not opened. The OpenMode field is set to 0 and the FileInfo\r
field is set to NULL.\r
\r
- @param FilePattern Points to a null-terminated shell file path, including wildcards.\r
- @param FileList On return, points to the start of a file list containing the names \r
- of all matching files or else points to NULL if no matching files \r
- were found.\r
+ @param[in] FilePattern Points to a null-terminated shell file path, including wildcards.\r
+ @param[out] FileList On return, points to the start of a file list containing the names \r
+ of all matching files or else points to NULL if no matching files \r
+ were found.\r
\r
- @retval EFI_SUCCESS Files found.\r
- @retval EFI_NOT_FOUND No files found.\r
- @retval EFI_NO_MEDIA The device has no media\r
- @retval EFI_DEVICE_ERROR The device reported an error\r
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted\r
+ @retval EFI_SUCCESS Files found.\r
+ @retval EFI_NOT_FOUND No files found.\r
+ @retval EFI_NO_MEDIA The device has no media\r
+ @retval EFI_DEVICE_ERROR The device reported an error\r
+ @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted\r
**/\r
typedef\r
EFI_STATUS\r
/**\r
Find all files in a specified directory.\r
\r
- @param FileDirHandle Handle of the directory to search.\r
- @param FileList On return, points to the list of files in the directory \r
- or NULL if there are no files in the directory.\r
+ @param[in] FileDirHandle Handle of the directory to search.\r
+ @param[out] FileList On return, points to the list of files in the directory \r
+ or NULL if there are no files in the directory.\r
\r
- @retval EFI_SUCCESS File information was returned successfully.\r
- @retval EFI_VOLUME_CORRUPTED The file system structures have been corrupted.\r
- @retval EFI_DEVICE_ERROR The device reported an error.\r
- @retval EFI_NO_MEDIA The device media is not present.\r
+ @retval EFI_SUCCESS File information was returned successfully.\r
+ @retval EFI_VOLUME_CORRUPTED The file system structures have been corrupted.\r
+ @retval EFI_DEVICE_ERROR The device reported an error.\r
+ @retval EFI_NO_MEDIA The device media is not present.\r
**/\r
typedef\r
EFI_STATUS\r
\r
This function flushes all modified data associated with a file to a device.\r
\r
- @param FileHandle The handle of the file to flush\r
+ @param[in] FileHandle The handle of the file to flush\r
\r
@retval EFI_SUCCESS The data was flushed.\r
@retval EFI_NO_MEDIA The device has no medium.\r
This function cleans up the file list and any related data structures. It has no\r
impact on the files themselves.\r
\r
- @param FileList The file list to free. Type EFI_SHELL_FILE_INFO is \r
+ @param[in] FileList The file list to free. Type EFI_SHELL_FILE_INFO is \r
defined in OpenFileList()\r
\r
@retval EFI_SUCCESS Free the file list successfully.\r
FileSystemMapping. In both cases, the returned name includes the file system\r
mapping (i.e. fs0:\current-dir).\r
\r
- @param FileSystemMapping A pointer to the file system mapping. If NULL, \r
+ @param[in] FileSystemMapping A pointer to the file system mapping. If NULL, \r
then the current working directory is returned.\r
\r
@retval !=NULL The current directory.\r
EFI_DEVICE_NAME_USE_DEVICE_PATH are set, then\r
EFI_DEVICE_NAME_USE_COMPONENT_NAME will have higher priority.\r
\r
- @param DeviceHandle The handle of the device.\r
- @param Flags Determines the possible sources of component names. \r
- @param Language A pointer to the language specified for the device \r
+ @param[in] DeviceHandle The handle of the device.\r
+ @param[in] Flags Determines the possible sources of component names. \r
+ @param[in] Language A pointer to the language specified for the device \r
name, in the same format as described in the UEFI \r
specification, Appendix M \r
- @param BestDeviceName On return, points to the callee-allocated null-\r
+ @param[out] BestDeviceName On return, points to the callee-allocated null-\r
terminated name of the device. If no device name \r
could be found, points to NULL. The name must be \r
freed by the caller...\r
\r
This function gets the device path associated with a mapping.\r
\r
- @param Mapping A pointer to the mapping\r
+ @param[in] Mapping A pointer to the mapping\r
\r
@retval !=NULL Pointer to the device path that corresponds to the \r
device mapping. The returned pointer does not need \r
This function converts a file system style name to a device path, by replacing any\r
mapping references to the associated device path.\r
\r
- @param Path the pointer to the path\r
+ @param[in] Path the pointer to the path\r
\r
@return all The pointer of the file path. The file path is callee \r
allocated and should be freed by the caller.\r
);\r
\r
/**\r
- Gets the environment variable.\r
+ This function updated with errata.\r
+\r
+ Gets either a single or list of environment variables.\r
+\r
+ If name is not NULL then this function returns the current value of the specified \r
+ environment variable.\r
\r
- This function returns the current value of the specified environment variable.\r
+ If Name is NULL than a list of all environment variable names is returned. Each a \r
+ NULL terminated string with a double NULL terminating the list.\r
\r
- @param Name A pointer to the environment variable name\r
+ @param[in] Name A pointer to the environment variable name. If \r
+ Name is NULL, then the function will return all \r
+ of the defined shell environment variables. In \r
+ the case where multiple environment variables are \r
+ being returned, each variable will be terminated by \r
+ a NULL, and the list will be terminated by a double \r
+ NULL.\r
\r
- @return !=NULL The environment variable's value. The returned \r
- pointer does not need to be freed by the caller.\r
- @retval NULL The environment variable doesn't exist.\r
+ @return !=NULL A pointer to the returned string.\r
+ The returned pointer does not need to be freed by the caller.\r
+\r
+ @retval NULL The environment variable doesn't exist or there are \r
+ no environment variables.\r
**/\r
typedef\r
CONST CHAR16 *\r
(EFIAPI *EFI_SHELL_GET_ENV) (\r
- IN CONST CHAR16 *Name\r
+ IN CONST CHAR16 *Name OPTIONAL\r
);\r
\r
/**\r
This function allocates a buffer to store the file's information. It's the caller's\r
responsibility to free the buffer.\r
\r
- @param FileHandle A File Handle\r
+ @param[in] FileHandle A File Handle\r
\r
@return !=NULL Cannot get the file info.\r
@return NULL A pointer to a buffer with file information.\r
the device path with the file-system mapping. If there are more than one application\r
file system mappings, the one that most closely matches Path will be used.\r
\r
- @param Path The pointer to the device path\r
+ @param[in] Path The pointer to the device path\r
\r
@return all The pointer of the null-terminated file path. The path \r
is callee-allocated and should be freed by the caller.\r
current file position has no meaning outside of the file system driver and as such, the\r
operation is not supported.\r
\r
- @param FileHandle The file handle on which to get the current position.\r
- @param Position Byte position from the start of the file\r
+ @param[in] FileHandle The file handle on which to get the current position.\r
+ @paramp[out] Position Byte position from the start of the file\r
\r
@retval EFI_SUCCESS Data was accessed.\r
@retval EFI_UNSUPPORTED The request is not valid on open directories.\r
\r
This function returns the size of the file specified by FileHandle.\r
\r
- @param FileHandle The handle of the file.\r
- @param Size The size of this file.\r
+ @param[in] FileHandle The handle of the file.\r
+ @param[out] Size The size of this file.\r
\r
@retval EFI_SUCCESS Get the file's size.\r
@retval EFI_DEVICE_ERROR Can't access the file.\r
information will be returned. If Sections is NULL, then all help text information\r
available will be returned.\r
\r
- @param Command Points to the null-terminated UEFI Shell command name.\r
- @param Sections Points to the null-terminated comma-delimited \r
+ @param[in] Command Points to the null-terminated UEFI Shell command name.\r
+ @param[in] Sections Points to the null-terminated comma-delimited \r
section names to return. If NULL, then all \r
sections will be returned.\r
- @param HelpText On return, points to a callee-allocated buffer \r
+ @param[out] HelpText On return, points to a callee-allocated buffer \r
containing all specified help text.\r
\r
@retval EFI_SUCCESS The help text was returned.\r
);\r
\r
/**\r
- Gets the mapping that most closely matches the device path.\r
+ This funciton is updated with Errata.\r
+\r
+ Gets the mapping(s) that most closely matches the device path.\r
\r
This function gets the mapping which corresponds to the device path *DevicePath. If\r
there is no exact match, then the mapping which most closely matches *DevicePath\r
device path. If there is an exact match, the mapping is returned and *DevicePath\r
points to the end-of-device-path node.\r
\r
- @param DevicePath On entry, points to a device path pointer. On \r
+ If there are multiple map names they will be semi-colon seperated in the \r
+ NULL-terminated string.\r
+\r
+ @param[in,out] DevicePath On entry, points to a device path pointer. On \r
exit, updates the pointer to point to the \r
portion of the device path after the mapping.\r
\r
If return EFI_SUCCESS, the FileHandle is the opened file's handle, else, the\r
FileHandle is NULL.\r
\r
- @param FileName Points to the null-terminated UCS-2 encoded file name.\r
- @param FileHandle On return, points to the file handle.\r
- @param OpenMode File open mode. Either EFI_FILE_MODE_READ or \r
+ @param[in] FileName Points to the null-terminated UCS-2 encoded file name.\r
+ @param[out] FileHandle On return, points to the file handle.\r
+ @param[in] OpenMode File open mode. Either EFI_FILE_MODE_READ or \r
EFI_FILE_MODE_WRITE from section 12.4 of the UEFI \r
Specification.\r
@retval EFI_SUCCESS The file was opened. FileHandle has the opened file's handle.\r
according to the rules specified in UEFI Shell 2.0 spec section 3.7.1. Each \r
matching file has an EFI_SHELL_FILE_INFO structure created in a linked list.\r
\r
- @param Path A pointer to the path string.\r
- @param OpenMode Specifies the mode used to open each file, EFI_FILE_MODE_READ or\r
+ @param[in] Path A pointer to the path string.\r
+ @param[in] OpenMode Specifies the mode used to open each file, EFI_FILE_MODE_READ or\r
EFI_FILE_MODE_WRITE.\r
- @param FileList Points to the start of a list of files opened.\r
+ @param[in,out] FileList Points to the start of a list of files opened.\r
\r
@retval EFI_SUCCESS Create the file list successfully.\r
@return Others Can't create the file list.\r
\r
This function opens the root directory of a device and returns a file handle to it.\r
\r
- @param DevicePath Points to the device path corresponding to the device where the\r
+ @param[in] DevicePath Points to the device path corresponding to the device where the\r
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is installed.\r
- @param FileHandle On exit, points to the file handle corresponding to the root directory on the\r
+ @param[out] FileHandle On exit, points to the file handle corresponding to the root directory on the\r
device.\r
\r
@retval EFI_SUCCESS Root opened successfully.\r
\r
This function opens the root directory of a device and returns a file handle to it.\r
\r
- @param DeviceHandle The handle of the device that contains the volume.\r
- @param FileHandle On exit, points to the file handle corresponding to the root directory on the\r
+ @param[in] DeviceHandle The handle of the device that contains the volume.\r
+ @param[out] FileHandle On exit, points to the file handle corresponding to the root directory on the\r
device.\r
\r
@retval EFI_SUCCESS Root opened successfully.\r
current position is increased by the number of bytes returned.\r
If FileHandle is a directory, then an error is returned.\r
\r
- @param FileHandle The opened file handle for read\r
- @param ReadSize On input, the size of Buffer, in bytes. On output, the amount of data read.\r
- @param Buffer The buffer in which data is read.\r
+ @param[in] FileHandle The opened file handle for read\r
+ @param[in] ReadSize On input, the size of Buffer, in bytes. On output, the amount of data read.\r
+ @param[in,out] Buffer The buffer in which data is read.\r
\r
@retval EFI_SUCCESS Data was read.\r
@retval EFI_NO_MEDIA The device has no media\r
(EFIAPI *EFI_SHELL_READ_FILE) (\r
IN EFI_FILE_HANDLE FileHandle,\r
IN OUT UINTN *ReadSize,\r
- OUT VOID *Buffer\r
+ IN OUT VOID *Buffer\r
);\r
\r
/**\r
\r
This function deletes the reduplicate files in the given file list.\r
\r
- @param FileList A pointer to the first entry in the file list.\r
+ @param[in] FileList A pointer to the first entry in the file list.\r
\r
@retval EFI_SUCCESS Always success.\r
**/\r
IN EFI_SHELL_FILE_INFO **FileList\r
);\r
\r
+//\r
+// The SetAlias and GetAlias functions were affected by errata. \r
+// They are not UEFI Shell 2.0 (no errata) compliant.\r
+//\r
+\r
/**\r
Changes a shell command alias.\r
\r
This function creates an alias for a shell command.\r
\r
- @param Command Points to the null-terminated shell command or existing alias.\r
- @param Alias Points to the null-terminated alias for the shell command. If this is NULL, and\r
+ @param[in] Command Points to the null-terminated shell command or existing alias.\r
+ @param[in] Alias Points to the null-terminated alias for the shell command. If this is NULL, and\r
Command refers to an alias, that alias will be deleted.\r
- @param Replace If TRUE and the alias already exists, then the existing alias will be replaced. If\r
+ @param[in] Replace If TRUE and the alias already exists, then the existing alias will be replaced. If\r
FALSE and the alias already exists, then the existing alias is unchanged and\r
EFI_ACCESS_DENIED is returned.\r
+ @param[in] Volatile if TRUE the Alias being set will be stored in a volatile fashion. if FALSE the \r
+ Alias being set will be stored in a non-volatile fashion.\r
\r
@retval EFI_SUCCESS Alias created or deleted successfully.\r
@retval EFI_ACCESS_DENIED The alias is a built-in alias or already existed and Replace was set to\r
(EFIAPI *EFI_SHELL_SET_ALIAS)(\r
IN CONST CHAR16 *Command,\r
IN CONST CHAR16 *Alias,\r
- IN BOOLEAN Replace\r
+ IN BOOLEAN Replace,\r
+ IN BOOLEAN Volatile\r
+ );\r
+\r
+/**\r
+ This function returns the alias associated with a command.\r
+\r
+ @param[in] Command Points to the null-terminated shell command. \r
+ If this parameter is NULL, then all commands \r
+ aliases will be returned in ReturnedData.\r
+ @param[out] ReturnedData If Command is not NULL, ReturnedData points to \r
+ the null-terminated alias for the shell command. \r
+ If Command is NULL, ReturnedData points to a \91;\92 \r
+ delimited list of command and alias tuples (e.g. \r
+ ReturnedData = \93md;mkdir;rd;rm;cp;copy;fs0:\test\r
+ app\myfavoriteprogram.efi;mfp\94) that are null-terminated. \r
+\r
+ @retval EFI_SUCCESS Alias retrieved successfully.\r
+ @retval EFI_NOT_FOUND Alias could not be found for the specified Command.\r
+ @retval EFI_OUT_OF_RESOURCES Insufficient memory was available to complete the request.\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_SHELL_GET_ALIAS)(\r
+ IN CONST CHAR16 *Command,\r
+ OUT CONST CHAR16 *ReturnedData\r
);\r
\r
/**\r
If the current working directory or the current working file system is changed then the\r
%cwd% environment variable will be updated\r
\r
- @param FileSystem A pointer to the file system's mapped name. If NULL, then the current working\r
+ @param[in] FileSystem A pointer to the file system's mapped name. If NULL, then the current working\r
directory is changed.\r
- @param Dir Points to the null-terminated directory on the device specified by FileSystem.\r
+ @param[in] Dir Points to the null-terminated directory on the device specified by FileSystem.\r
\r
@return !=NULL The current directory.\r
@retval NULL Current directory does not exist.\r
For a description of volatile and non-volatile environment variables, see UEFI Shell \r
2.0 specification section 3.6.1.\r
\r
- @param Name Points to the null-terminated environment variable name.\r
- @param Value Points to the null-terminated environment variable value. If the value is an\r
+ @param[in] Name Points to the null-terminated environment variable name.\r
+ @param[in] Value Points to the null-terminated environment variable value. If the value is an\r
empty string then the environment variable is deleted.\r
- @param Volatile Indicates whether the variable is non-volatile (FALSE) or volatile (TRUE).\r
+ @param[in] Volatile Indicates whether the variable is non-volatile (FALSE) or volatile (TRUE).\r
\r
@retval EFI_SUCCESS The environment variable was successfully updated.\r
**/\r
\r
This function changes file information.\r
\r
- @param FileHandle A file handle\r
- @param FileInfo Points to new file information.\r
+ @param[in] FileHandle A file handle\r
+ @param[in] FileInfo Points to new file information.\r
\r
@retval EFI_SUCCESS The information was set.\r
@retval EFI_NO_MEDIA The device has no medium.\r
grow the file). Seeking to position 0xFFFFFFFFFFFFFFFF causes the current position\r
to be set to the end of the file.\r
\r
- @param FileHandle The file handle on which requested position will be set.\r
- @param Position Byte position from the start of the file\r
+ @param[in] FileHandle The file handle on which requested position will be set.\r
+ @param[in] Position Byte position from the start of the file\r
\r
@retval EFI_SUCCESS Data was written.\r
@retval EFI_UNSUPPORTED The seek request for nonzero is not valid on open directories.\r
/**\r
This function creates a mapping for a device path.\r
\r
- @param DevicePath Points to the device path. If this is NULL and Mapping points to a valid mapping,\r
+ @param[in] DevicePath Points to the device path. If this is NULL and Mapping points to a valid mapping,\r
then the mapping will be deleted.\r
- @param Mapping Points to the null-terminated mapping for the device path.\r
+ @param[in] Mapping Points to the null-terminated mapping for the device path.\r
\r
@retval EFI_SUCCESS Mapping created or deleted successfully.\r
@retval EFI_NO_MAPPING There is no handle that corresponds exactly to DevicePath. See the\r
\r
Direct writes to opened directories are not supported.\r
\r
- @param FileHandle The opened file handle for writing.\r
- @param BufferSize On input, size of Buffer.\r
- @param Buffer The buffer in which data to write.\r
+ @param[in] FileHandle The opened file handle for writing.\r
+ @param[in,out] BufferSize On input, size of Buffer.\r
+ @param[in] Buffer The buffer in which data to write.\r
\r
@retval EFI_SUCCESS Data was written.\r
@retval EFI_UNSUPPORTED Writes to open directory are not supported\r
EFI_SHELL_EXECUTE Execute;\r
EFI_SHELL_GET_ENV GetEnv;\r
EFI_SHELL_SET_ENV SetEnv;\r
+ EFI_SHELL_GET_ALIAS GetAlias;\r
EFI_SHELL_SET_ALIAS SetAlias;\r
EFI_SHELL_GET_HELP_TEXT GetHelpText;\r
EFI_SHELL_GET_DEVICE_PATH_FROM_MAP GetDevicePathFromMap;\r