]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Include/Protocol/EfiShell.h
ShellPkg: Standardized HP Copyright Message String
[mirror_edk2.git] / ShellPkg / Include / Protocol / EfiShell.h
index 82d228187d4ee1178fcc44afeab982cd838acbad..6c1d66a6696d4cbed2436d93b5007aa3fc9166fe 100644 (file)
@@ -1,21 +1,22 @@
 /** @file\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
-  are licensed and made available under the terms and conditions of the BSD License         \r
-  which accompanies this distribution.  The full text of the license may be found at        \r
-  http://opensource.org/licenses/bsd-license.php                                            \r
 \r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+  (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>\r
+  Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
+  This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
 **/\r
 \r
 #ifndef __EFI_SHELL_PROTOCOL__\r
 #define __EFI_SHELL_PROTOCOL__\r
 \r
-#include <Protocol/SimpleFileSystem.h>\r
+#include <ShellBase.h>\r
 #include <Guid/FileInfo.h>\r
 \r
 #define EFI_SHELL_PROTOCOL_GUID \\r
 // replaced EFI_LIST_ENTRY with LIST_ENTRY for simplicity.\r
 // they are identical outside of the name.\r
 typedef struct {\r
-  LIST_ENTRY      Link;       ///< Linked list members.\r
-  EFI_STATUS      Status;     ///< Status of opening the file.  Valid only if Handle != NULL.\r
-  CONST CHAR16    *FullName;  ///< Fully qualified filename.\r
-  CONST CHAR16    *FileName;  ///< name of this file.\r
-  EFI_FILE_HANDLE Handle;     ///< Handle for interacting with the opened file or NULL if closed.\r
-  EFI_FILE_INFO   *Info;      ///< Pointer to the FileInfo struct for this file or NULL.\r
+  LIST_ENTRY        Link;       ///< Linked list members.\r
+  EFI_STATUS        Status;     ///< Status of opening the file.  Valid only if Handle != NULL.\r
+  CONST CHAR16      *FullName;  ///< Fully qualified filename.\r
+  CONST CHAR16      *FileName;  ///< name of this file.\r
+  SHELL_FILE_HANDLE Handle;     ///< Handle for interacting with the opened file or NULL if closed.\r
+  EFI_FILE_INFO     *Info;      ///< Pointer to the FileInfo struct for this file or NULL.\r
 } EFI_SHELL_FILE_INFO;\r
 \r
 /**\r
@@ -50,18 +51,18 @@ BOOLEAN
 /**\r
   Closes the file handle.\r
 \r
-  This function closes a specified file handle. All 'dirty' cached file data is \r
-  flushed to the device, and the file is closed. In all cases, the handle is \r
+  This function closes a specified file handle. All 'dirty' cached file data is\r
+  flushed to the device, and the file is closed. In all cases, the handle is\r
   closed.\r
 \r
-  @param[in] 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
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_SHELL_CLOSE_FILE)(\r
-  IN EFI_FILE_HANDLE FileHandle\r
+  IN SHELL_FILE_HANDLE FileHandle\r
   );\r
 \r
 /**\r
@@ -70,22 +71,22 @@ EFI_STATUS
   This function creates an empty new file or directory with the specified attributes and\r
   returns the new file's handle. If the file already exists and is read-only, then\r
   EFI_INVALID_PARAMETER will be returned.\r
-  \r
+\r
   If the file already existed, it is truncated and its attributes updated. If the file is\r
   created successfully, the FileHandle is the file's handle, else, the FileHandle is NULL.\r
-  \r
+\r
   If the file name begins with >v, then the file handle which is returned refers to the\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[in] FileName           Pointer to null-terminated file path.\r
-  @param[in] 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[out] 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
-  @retval EFI_UNSUPPORTED       could not open the file path\r
+  @retval EFI_UNSUPPORTED       The file path could not be opened.\r
   @retval EFI_NOT_FOUND         The specified file could not be found on the device, or could not\r
                                 file the file system on the device.\r
   @retval EFI_NO_MEDIA          The device has no medium.\r
@@ -103,9 +104,9 @@ EFI_STATUS
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_SHELL_CREATE_FILE)(\r
-  IN CONST CHAR16 *FileName,\r
-  IN UINT64 FileAttribs,\r
-  OUT EFI_FILE_HANDLE *FileHandle\r
+  IN CONST CHAR16               *FileName,\r
+  IN UINT64                     FileAttribs,\r
+  OUT SHELL_FILE_HANDLE         *FileHandle\r
   );\r
 \r
 /**\r
@@ -117,13 +118,13 @@ EFI_STATUS
 \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_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
 EFI_STATUS\r
 (EFIAPI *EFI_SHELL_DELETE_FILE)(\r
-  IN EFI_FILE_HANDLE FileHandle\r
+  IN SHELL_FILE_HANDLE FileHandle\r
   );\r
 \r
 /**\r
@@ -131,9 +132,9 @@ EFI_STATUS
 \r
   This function deletes a file.\r
 \r
-  @param[in] 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 deleted.\r
   @retval EFI_WARN_DELETE_FAILURE The handle was closed but the file was not deleted.\r
 **/\r
 typedef\r
@@ -148,8 +149,8 @@ EFI_STATUS
 typedef\r
 VOID\r
 (EFIAPI *EFI_SHELL_DISABLE_PAGE_BREAK) (\r
-VOID\r
-);\r
+  VOID\r
+  );\r
 \r
 /**\r
   Enables the page break output mode.\r
@@ -157,8 +158,8 @@ VOID
 typedef\r
 VOID\r
 (EFIAPI *EFI_SHELL_ENABLE_PAGE_BREAK) (\r
-VOID\r
-);\r
+  VOID\r
+  );\r
 \r
 /**\r
   Execute the command line.\r
@@ -166,26 +167,26 @@ VOID
   This function creates a nested instance of the shell and executes the specified\r
   command (CommandLine) with the specified environment (Environment). Upon return,\r
   the status code returned by the specified command is placed in StatusCode.\r
-  \r
+\r
   If Environment is NULL, then the current environment is used and all changes made\r
   by the commands executed will be reflected in the current environment. If the\r
   Environment is non-NULL, then the changes made will be discarded.\r
-  \r
+\r
   The CommandLine is executed from the current working directory on the current\r
   device.\r
 \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
+  @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
+  @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
+  @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
@@ -194,10 +195,10 @@ VOID
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_SHELL_EXECUTE) (\r
-  IN EFI_HANDLE *ParentImageHandle,\r
-  IN CHAR16 *CommandLine OPTIONAL,\r
-  IN CHAR16 **Environment OPTIONAL,\r
-  OUT EFI_STATUS *StatusCode OPTIONAL\r
+  IN EFI_HANDLE                 *ParentImageHandle,\r
+  IN CHAR16                     *CommandLine OPTIONAL,\r
+  IN CHAR16                     **Environment OPTIONAL,\r
+  OUT EFI_STATUS                *StatusCode OPTIONAL\r
   );\r
 \r
 /**\r
@@ -210,9 +211,9 @@ EFI_STATUS
   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[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
+  @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
@@ -224,15 +225,15 @@ EFI_STATUS
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_SHELL_FIND_FILES)(\r
-  IN CONST CHAR16 *FilePattern,\r
-  OUT EFI_SHELL_FILE_INFO **FileList\r
+  IN CONST CHAR16               *FilePattern,\r
+  OUT EFI_SHELL_FILE_INFO       **FileList\r
   );\r
 \r
 /**\r
   Find all files in a specified directory.\r
 \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
+  @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
@@ -243,16 +244,16 @@ EFI_STATUS
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_SHELL_FIND_FILES_IN_DIR)(\r
-IN EFI_FILE_HANDLE FileDirHandle,\r
-OUT EFI_SHELL_FILE_INFO **FileList\r
+IN SHELL_FILE_HANDLE            FileDirHandle,\r
+OUT EFI_SHELL_FILE_INFO         **FileList\r
 );\r
 \r
 /**\r
   Flushes data back to a device.\r
-  \r
+\r
   This function flushes all modified data associated with a file to a device.\r
 \r
-  @param[in] 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
@@ -265,17 +266,17 @@ OUT EFI_SHELL_FILE_INFO **FileList
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_SHELL_FLUSH_FILE)(\r
-  IN EFI_FILE_HANDLE FileHandle\r
+  IN SHELL_FILE_HANDLE FileHandle\r
   );\r
 \r
 /**\r
   Frees the file list.\r
-  \r
+\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[in] FileList           The file list to free. Type EFI_SHELL_FILE_INFO is \r
-                                defined in OpenFileList()\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
 **/\r
@@ -293,9 +294,9 @@ EFI_STATUS
   FileSystemMapping. In both cases, the returned name includes the file system\r
   mapping (i.e. fs0:\current-dir).\r
 \r
-  @param[in] 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
+\r
   @retval !=NULL                The current directory.\r
   @retval NULL                  Current directory does not exist.\r
 **/\r
@@ -327,13 +328,13 @@ typedef UINT32 EFI_SHELL_DEVICE_NAME_FLAGS;
   EFI_DEVICE_NAME_USE_COMPONENT_NAME will have higher priority.\r
 \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
+  @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[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
+  @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
   @retval EFI_SUCCESS           Get the name successfully.\r
@@ -341,11 +342,11 @@ typedef UINT32 EFI_SHELL_DEVICE_NAME_FLAGS;
 **/\r
 typedef\r
 EFI_STATUS\r
-(*EFI_SHELL_GET_DEVICE_NAME) (\r
-  IN EFI_HANDLE DeviceHandle,\r
-  IN EFI_SHELL_DEVICE_NAME_FLAGS Flags,\r
-  IN CHAR8 *Language,\r
-  OUT CHAR16 **BestDeviceName\r
+(EFIAPI *EFI_SHELL_GET_DEVICE_NAME) (\r
+  IN EFI_HANDLE                   DeviceHandle,\r
+  IN EFI_SHELL_DEVICE_NAME_FLAGS  Flags,\r
+  IN CHAR8                        *Language,\r
+  OUT CHAR16                      **BestDeviceName\r
   );\r
 \r
 /**\r
@@ -355,10 +356,10 @@ EFI_STATUS
 \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
+  @retval !=NULL                Pointer to the device path that corresponds to the\r
+                                device mapping. The returned pointer does not need\r
                                 to be freed.\r
-  @retval NULL                  There is no device path associated with the \r
+  @retval NULL                  There is no device path associated with the\r
                                 specified mapping.\r
 **/\r
 typedef\r
@@ -375,7 +376,7 @@ CONST EFI_DEVICE_PATH_PROTOCOL *
 \r
   @param[in] Path               The pointer to the path.\r
 \r
-  @return                       The pointer of the file path. The file path is callee \r
+  @return                       The pointer of the file path. The file path is callee\r
                                 allocated and should be freed by the caller.\r
 **/\r
 typedef\r
@@ -385,28 +386,26 @@ EFI_DEVICE_PATH_PROTOCOL *
   );\r
 \r
 /**\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
+  If name is not NULL then this function returns the current value of the specified\r
   environment variable.\r
 \r
-  If Name is NULL than a list of all environment variable names is returned.  Each a \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[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
+  @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                A pointer to the returned string.\r
+  @return                       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
+  @retval NULL                  The environment variable doesn't exist or there are\r
                                 no environment variables.\r
 **/\r
 typedef\r
@@ -415,6 +414,35 @@ CONST CHAR16 *
   IN CONST CHAR16 *Name OPTIONAL\r
   );\r
 \r
+/**\r
+  Gets the environment variable and Attributes, or list of environment variables.  Can be \r
+  used instead of GetEnv().\r
+\r
+  This function returns the current value of the specified environment variable and\r
+  the Attributes. If no variable name was specified, then all of the known\r
+  variables will be returned.\r
+\r
+  @param[in] Name               A pointer to the environment variable name. If Name is NULL,\r
+                                then the function will return all of the defined shell \r
+                                environment variables. In the case where multiple environment\r
+                                variables are being returned, each variable will be terminated \r
+                                by a NULL, and the list will be terminated by a double NULL.\r
+  @param[out] Attributes        If not NULL, a pointer to the returned attributes bitmask for\r
+                                the environment variable. In the case where Name is NULL, and\r
+                                multiple environment variables are being returned, Attributes\r
+                                is undefined.\r
+\r
+  @retval NULL                  The environment variable doesn't exist.  \r
+  @return                       The environment variable's value. The returned pointer does not \r
+                                need to be freed by the caller.  \r
+**/\r
+typedef\r
+CONST CHAR16 *\r
+(EFIAPI *EFI_SHELL_GET_ENV_EX) (\r
+  IN  CONST CHAR16 *Name,\r
+  OUT       UINT32 *Attributes OPTIONAL\r
+  );\r
+\r
 /**\r
   Gets the file information from an open file handle.\r
 \r
@@ -423,13 +451,13 @@ CONST CHAR16 *
 \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
+  @retval NULL                  Cannot get the file info.\r
+  @return                       A pointer to a buffer with file information.\r
 **/\r
 typedef\r
 EFI_FILE_INFO *\r
 (EFIAPI *EFI_SHELL_GET_FILE_INFO)(\r
-  IN EFI_FILE_HANDLE FileHandle\r
+  IN SHELL_FILE_HANDLE FileHandle\r
   );\r
 \r
 /**\r
@@ -439,9 +467,9 @@ EFI_FILE_INFO *
   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[in] 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
+  @return                       The pointer of the NULL-terminated file path. The path\r
                                 is callee-allocated and should be freed by the caller.\r
 **/\r
 typedef\r
@@ -458,7 +486,7 @@ CHAR16 *
   operation is not supported.\r
 \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
+  @param[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
@@ -466,7 +494,7 @@ CHAR16 *
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_SHELL_GET_FILE_POSITION)(\r
-  IN EFI_FILE_HANDLE FileHandle,\r
+  IN SHELL_FILE_HANDLE FileHandle,\r
   OUT UINT64 *Position\r
   );\r
 \r
@@ -484,31 +512,79 @@ EFI_STATUS
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_SHELL_GET_FILE_SIZE)(\r
-  IN EFI_FILE_HANDLE FileHandle,\r
+  IN SHELL_FILE_HANDLE FileHandle,\r
   OUT UINT64 *Size\r
   );\r
 \r
+/**\r
+  Get the GUID value from a human readable name.\r
+\r
+  If GuidName is a known GUID name, then update Guid to have the correct value for\r
+  that GUID.\r
+\r
+  This function is only available when the major and minor versions in the\r
+  EfiShellProtocol are greater than or equal to 2 and 1, respectively.\r
+\r
+  @param[in]  GuidName   A pointer to the localized name for the GUID being queried.\r
+  @param[out] Guid       A pointer to the GUID structure to be filled in.\r
+\r
+  @retval EFI_SUCCESS             The operation was successful.\r
+  @retval EFI_INVALID_PARAMETER   Guid was NULL.\r
+  @retval EFI_INVALID_PARAMETER   GuidName was NULL.\r
+  @retval EFI_NOT_FOUND           GuidName is not a known GUID Name.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SHELL_GET_GUID_FROM_NAME)(\r
+  IN  CONST CHAR16   *GuidName,\r
+  OUT       EFI_GUID *Guid\r
+  );\r
+\r
+/**\r
+  Get the human readable name for a GUID from the value.\r
+\r
+  If Guid is assigned a name, then update *GuidName to point to the name. The callee\r
+  should not modify the value.\r
+\r
+  This function is only available when the major and minor versions in the\r
+  EfiShellProtocol are greater than or equal to 2 and 1, respectively.\r
+\r
+  @param[in]  Guid       A pointer to the GUID being queried.\r
+  @param[out] GuidName   A pointer to a pointer the localized to name for the GUID being requested\r
+\r
+  @retval EFI_SUCCESS             The operation was successful.\r
+  @retval EFI_INVALID_PARAMETER   Guid was NULL.\r
+  @retval EFI_INVALID_PARAMETER   GuidName was NULL.\r
+  @retval EFI_NOT_FOUND           Guid is not assigned a name.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SHELL_GET_GUID_NAME)(\r
+  IN  CONST EFI_GUID *Guid,\r
+  OUT CONST CHAR16   **GuidName\r
+  );\r
+\r
 /**\r
   Return help information about a specific command.\r
 \r
   This function returns the help information for the specified command. The help text\r
   can be internal to the shell or can be from a UEFI Shell manual page.\r
-  \r
+\r
   If Sections is specified, then each section name listed will be compared in a casesensitive\r
   manner, to the section names described in Appendix B. If the section exists,\r
   it will be appended to the returned help text. If the section does not exist, no\r
   information will be returned. If Sections is NULL, then all help text information\r
   available will be returned.\r
 \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
+  @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[out] 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
-  @retval EFI_OUT_OF_RESOURCES  The necessary buffer could not be allocated to hold the \r
+  @retval EFI_OUT_OF_RESOURCES  The necessary buffer could not be allocated to hold the\r
                                 returned help text.\r
   @retval EFI_INVALID_PARAMETER HelpText is NULL.\r
   @retval EFI_NOT_FOUND         There is no help text available for Command.\r
@@ -522,8 +598,6 @@ EFI_STATUS
   );\r
 \r
 /**\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
@@ -532,15 +606,15 @@ EFI_STATUS
   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
-  If there are multiple map names they will be semi-colon seperated in the \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
+  @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
   @retval NULL                  No mapping was found.\r
-  @retval !=NULL                Pointer to null-terminated mapping. The buffer \r
+  @retval !=NULL                Pointer to NULL-terminated mapping. The buffer\r
                                 is callee allocated and should be freed by the caller.\r
 **/\r
 typedef\r
@@ -582,34 +656,34 @@ VOID
 \r
   This function opens the specified file in the specified OpenMode and returns a file\r
   handle.\r
-  If the file name begins with >v, then the file handle which is returned refers to the\r
+  If the file name begins with '>v', then the file handle which is returned refers to the\r
   shell environment variable with the specified name. If the shell environment variable\r
   exists, is non-volatile and the OpenMode indicates EFI_FILE_MODE_WRITE, then\r
   EFI_INVALID_PARAMETER is returned.\r
 \r
-  If the file name is >i, then the file handle which is returned refers to the standard\r
+  If the file name is '>i', then the file handle which is returned refers to the standard\r
   input. If the OpenMode indicates EFI_FILE_MODE_WRITE, then EFI_INVALID_PARAMETER\r
   is returned.\r
 \r
-  If the file name is >o, then the file handle which is returned refers to the standard\r
+  If the file name is '>o', then the file handle which is returned refers to the standard\r
   output. If the OpenMode indicates EFI_FILE_MODE_READ, then EFI_INVALID_PARAMETER\r
   is returned.\r
 \r
-  If the file name is >e, then the file handle which is returned refers to the standard\r
+  If the file name is '>e', then the file handle which is returned refers to the standard\r
   error. If the OpenMode indicates EFI_FILE_MODE_READ, then EFI_INVALID_PARAMETER\r
   is returned.\r
 \r
-  If the file name is NUL, then the file handle that is returned refers to the standard NUL\r
+  If the file name is 'NUL', then the file handle that is returned refers to the standard NUL\r
   file. If the OpenMode indicates EFI_FILE_MODE_READ, then EFI_INVALID_PARAMETER is\r
   returned.\r
 \r
   If return EFI_SUCCESS, the FileHandle is the opened file's handle, else, the\r
   FileHandle is NULL.\r
 \r
-  @param[in] FileName           Points to the null-terminated UCS-2 encoded file name.\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
+  @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
   @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value. FileHandle is NULL.\r
@@ -633,7 +707,7 @@ typedef
 EFI_STATUS\r
 (EFIAPI *EFI_SHELL_OPEN_FILE_BY_NAME) (\r
   IN CONST CHAR16 *FileName,\r
-  OUT EFI_FILE_HANDLE *FileHandle,\r
+  OUT SHELL_FILE_HANDLE *FileHandle,\r
   IN UINT64 OpenMode\r
   );\r
 \r
@@ -641,13 +715,13 @@ EFI_STATUS
   Opens the files that match the path specified.\r
 \r
   This function opens all of the files specified by Path. Wildcards are processed\r
-  according to the rules specified in UEFI Shell 2.0 spec section 3.7.1. Each \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[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[in,out] FileList       Points to the start of a list of files opened.\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[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                       Can't create the file list.\r
@@ -680,7 +754,7 @@ typedef
 EFI_STATUS\r
 (EFIAPI *EFI_SHELL_OPEN_ROOT)(\r
   IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,\r
-  OUT EFI_FILE_HANDLE *FileHandle\r
+  OUT SHELL_FILE_HANDLE *FileHandle\r
   );\r
 \r
 /**\r
@@ -702,7 +776,7 @@ typedef
 EFI_STATUS\r
 (EFIAPI *EFI_SHELL_OPEN_ROOT_BY_HANDLE)(\r
   IN EFI_HANDLE DeviceHandle,\r
-  OUT EFI_FILE_HANDLE *FileHandle\r
+  OUT SHELL_FILE_HANDLE *FileHandle\r
   );\r
 \r
 /**\r
@@ -714,9 +788,9 @@ EFI_STATUS
   current position is increased by the number of bytes returned.\r
   If FileHandle is a directory, then an error is returned.\r
 \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
+  @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
@@ -727,11 +801,35 @@ EFI_STATUS
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_SHELL_READ_FILE) (\r
-  IN EFI_FILE_HANDLE FileHandle,\r
+  IN SHELL_FILE_HANDLE FileHandle,\r
   IN OUT UINTN *ReadSize,\r
   IN OUT VOID *Buffer\r
   );\r
 \r
+/**\r
+  Register a GUID and a localized human readable name for it.\r
+\r
+  If Guid is not assigned a name, then assign GuidName to Guid.  This list of GUID\r
+  names must be used whenever a shell command outputs GUID information.\r
+\r
+  This function is only available when the major and minor versions in the\r
+  EfiShellProtocol are greater than or equal to 2 and 1, respectively.\r
+\r
+  @param[in] Guid       A pointer to the GUID being registered.\r
+  @param[in] GuidName   A pointer to the localized name for the GUID being registered.\r
+\r
+  @retval EFI_SUCCESS             The operation was successful.\r
+  @retval EFI_INVALID_PARAMETER   Guid was NULL.\r
+  @retval EFI_INVALID_PARAMETER   GuidName was NULL.\r
+  @retval EFI_ACCESS_DENIED       Guid already is assigned a name.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SHELL_REGISTER_GUID_NAME)(\r
+  IN CONST EFI_GUID *Guid,\r
+  IN CONST CHAR16   *GuidName\r
+  );\r
+\r
 /**\r
   Deletes the duplicate file names files in the given file list.\r
 \r
@@ -745,23 +843,18 @@ EFI_STATUS
   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[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
+  @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[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
+  @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
@@ -781,20 +874,20 @@ EFI_STATUS
   This function returns the command associated with a alias or a list of all\r
   alias'.\r
 \r
-  @param[in] Alias              Points to the null-terminated shell alias. \r
-                                If this parameter is NULL, then all \r
+  @param[in] Alias              Points to the NULL-terminated shell alias.\r
+                                If this parameter is NULL, then all\r
                                 aliases will be returned in ReturnedData.\r
   @param[out] Volatile          Upon return of a single command if TRUE indicates\r
                                 this is stored in a volatile fashion.  FALSE otherwise.\r
-  @return                              If Alias is not NULL, it will return a pointer to \r
-                                the null-terminated command for that alias. \r
-                                If Alias is NULL, ReturnedData points to a \91;\92 \r
-                                delimited list of alias (e.g. \r
-                                ReturnedData = \93dir;del;copy;mfp\94) that is null-terminated.  \r
+  @return                              If Alias is not NULL, it will return a pointer to\r
+                                the NULL-terminated command for that alias.\r
+                                If Alias is NULL, ReturnedData points to a ';'\r
+                                delimited list of alias (e.g.\r
+                                ReturnedData = "dir;del;copy;mfp") that is NULL-terminated.\r
   @retval NULL                  An error ocurred.\r
   @retval NULL                  Alias was not a valid Alias.\r
 **/\r
-typedef \r
+typedef\r
 CONST CHAR16 *\r
 (EFIAPI *EFI_SHELL_GET_ALIAS)(\r
   IN  CONST CHAR16 *Alias,\r
@@ -816,14 +909,14 @@ CONST CHAR16 *
   directory on the specified file system.\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
+  %cwd% environment variable will be updated.\r
 \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[in] 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
+  @return                       The current directory.\r
 **/\r
 typedef\r
 EFI_STATUS\r
@@ -842,12 +935,12 @@ EFI_STATUS
   variable does not exist and the Value is an empty string, there is no action. If the\r
   environment variable does not exist and the Value is a non-empty string, then the\r
   environment variable is created and assigned the specified value.\r
-  \r
-  For a description of volatile and non-volatile environment variables, see UEFI Shell \r
+\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[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
+  @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[in] Volatile           Indicates whether the variable is non-volatile (FALSE) or volatile (TRUE).\r
 \r
@@ -864,9 +957,10 @@ EFI_STATUS
 /**\r
   Sets the file information to an opened file handle.\r
 \r
-  This function changes file information.\r
+  This function changes file information.  All file information in the EFI_FILE_INFO\r
+  struct will be updated to the passed in data.\r
 \r
-  @param[in] FileHandle         A file handle\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
@@ -881,7 +975,7 @@ EFI_STATUS
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_SHELL_SET_FILE_INFO)(\r
-  IN EFI_FILE_HANDLE FileHandle,\r
+  IN SHELL_FILE_HANDLE FileHandle,\r
   IN CONST EFI_FILE_INFO *FileInfo\r
   );\r
 \r
@@ -903,7 +997,7 @@ EFI_STATUS
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_SHELL_SET_FILE_POSITION)(\r
-  IN EFI_FILE_HANDLE FileHandle,\r
+  IN SHELL_FILE_HANDLE FileHandle,\r
   IN UINT64 Position\r
   );\r
 \r
@@ -912,7 +1006,7 @@ EFI_STATUS
 \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[in] 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
@@ -937,9 +1031,9 @@ EFI_STATUS
 \r
   Direct writes to opened directories are not supported.\r
 \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
+  @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
@@ -953,11 +1047,35 @@ EFI_STATUS
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_SHELL_WRITE_FILE)(\r
-  IN EFI_FILE_HANDLE            FileHandle,\r
+  IN SHELL_FILE_HANDLE          FileHandle,\r
   IN OUT UINTN                  *BufferSize,\r
   IN VOID                       *Buffer\r
   );\r
 \r
+//\r
+// EFI_SHELL_PROTOCOL has been updated since UEFI Shell Spec 2.0\r
+// Usage of this protocol will require version checking before attempting\r
+// to use any new members.  There is no need to check the version for\r
+// members that existed in UEFI Shell Spec 2.0.\r
+//\r
+// Update below for any future UEFI Shell spec changes to this protocol.\r
+//\r
+// Check EFI_SHELL_PROTOCOL MajorVersion and MinorVersion:\r
+// if ((2 == gEfiShellProtocol->MajorVersion) &&\r
+//     (0 == gEfiShellProtocol->MinorVersion)) {\r
+//   //\r
+//   // Cannot call:\r
+//   // RegisterGuidName - UEFI Shell 2.1\r
+//   // GetGuidName      - UEFI Shell 2.1\r
+//   // GetGuidFromName  - UEFI Shell 2.1\r
+//   // GetEnvEx         - UEFI Shell 2.1\r
+//   //\r
+// } else {\r
+//   //\r
+//   // Can use all members\r
+//   //\r
+// }\r
+//\r
 typedef struct _EFI_SHELL_PROTOCOL {\r
   EFI_SHELL_EXECUTE                         Execute;\r
   EFI_SHELL_GET_ENV                         GetEnv;\r
@@ -1001,13 +1119,18 @@ typedef struct _EFI_SHELL_PROTOCOL {
   EFI_EVENT                                 ExecutionBreak;\r
   UINT32                                    MajorVersion;\r
   UINT32                                    MinorVersion;\r
+  // Added for Shell 2.1\r
+  EFI_SHELL_REGISTER_GUID_NAME              RegisterGuidName;\r
+  EFI_SHELL_GET_GUID_NAME                   GetGuidName;\r
+  EFI_SHELL_GET_GUID_FROM_NAME              GetGuidFromName;\r
+  EFI_SHELL_GET_ENV_EX                      GetEnvEx;\r
 } EFI_SHELL_PROTOCOL;\r
 \r
 extern EFI_GUID gEfiShellProtocolGuid;\r
 \r
 enum ShellVersion {\r
   SHELL_MAJOR_VERSION = 2,\r
-  SHELL_MINOR_VERSION = 0\r
+  SHELL_MINOR_VERSION = 1\r
 };\r
 \r
 #endif\r