2009-05-07 20:46:18 +02:00
|
|
|
/** @file
|
2009-11-10 21:23:01 +01:00
|
|
|
EFI Shell protocol as defined in the UEFI Shell 2.0 specification including errata.
|
2009-05-07 20:46:18 +02:00
|
|
|
|
2015-02-04 23:25:01 +01:00
|
|
|
(C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
|
2017-03-31 16:23:13 +02:00
|
|
|
Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
|
2010-01-25 21:05:08 +01:00
|
|
|
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.
|
2009-05-07 20:46:18 +02:00
|
|
|
|
|
|
|
**/
|
|
|
|
|
2016-10-18 10:37:30 +02:00
|
|
|
#ifndef __EFI_SHELL_PROTOCOL_H__
|
|
|
|
#define __EFI_SHELL_PROTOCOL_H__
|
2009-05-07 20:46:18 +02:00
|
|
|
|
|
|
|
#include <Guid/FileInfo.h>
|
|
|
|
|
|
|
|
#define EFI_SHELL_PROTOCOL_GUID \
|
|
|
|
{ \
|
|
|
|
0x6302d008, 0x7f9b, 0x4f30, { 0x87, 0xac, 0x60, 0xc9, 0xfe, 0xf5, 0xda, 0x4e } \
|
|
|
|
}
|
2016-10-18 10:37:30 +02:00
|
|
|
typedef VOID *SHELL_FILE_HANDLE;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
///
|
|
|
|
/// The operation completed successfully.
|
|
|
|
///
|
|
|
|
SHELL_SUCCESS = 0,
|
|
|
|
|
|
|
|
///
|
|
|
|
/// The image failed to load.
|
|
|
|
///
|
|
|
|
SHELL_LOAD_ERROR = 1,
|
|
|
|
|
|
|
|
///
|
|
|
|
/// The parameter was incorrect.
|
|
|
|
///
|
|
|
|
SHELL_INVALID_PARAMETER = 2,
|
|
|
|
|
|
|
|
///
|
|
|
|
/// The operation is not supported.
|
|
|
|
///
|
|
|
|
SHELL_UNSUPPORTED = 3,
|
|
|
|
|
|
|
|
///
|
|
|
|
/// The buffer was not the proper size for the request.
|
|
|
|
///
|
|
|
|
SHELL_BAD_BUFFER_SIZE = 4,
|
|
|
|
|
|
|
|
///
|
|
|
|
/// The buffer was not large enough to hold the requested data.
|
|
|
|
/// The required buffer size is returned in the appropriate
|
|
|
|
/// parameter when this error occurs.
|
|
|
|
///
|
|
|
|
SHELL_BUFFER_TOO_SMALL = 5,
|
|
|
|
|
|
|
|
///
|
|
|
|
/// There is no data pending upon return.
|
|
|
|
///
|
|
|
|
SHELL_NOT_READY = 6,
|
|
|
|
|
|
|
|
///
|
|
|
|
/// The physical device reported an error while attempting the
|
|
|
|
/// operation.
|
|
|
|
///
|
|
|
|
SHELL_DEVICE_ERROR = 7,
|
|
|
|
|
|
|
|
///
|
|
|
|
/// The device cannot be written to.
|
|
|
|
///
|
|
|
|
SHELL_WRITE_PROTECTED = 8,
|
|
|
|
|
|
|
|
///
|
|
|
|
/// The resource has run out.
|
|
|
|
///
|
|
|
|
SHELL_OUT_OF_RESOURCES = 9,
|
|
|
|
|
|
|
|
///
|
|
|
|
/// An inconsistency was detected on the file system causing the
|
|
|
|
/// operation to fail.
|
|
|
|
///
|
|
|
|
SHELL_VOLUME_CORRUPTED = 10,
|
|
|
|
|
|
|
|
///
|
|
|
|
/// There is no more space on the file system.
|
|
|
|
///
|
|
|
|
SHELL_VOLUME_FULL = 11,
|
|
|
|
|
|
|
|
///
|
|
|
|
/// The device does not contain any medium to perform the
|
|
|
|
/// operation.
|
|
|
|
///
|
|
|
|
SHELL_NO_MEDIA = 12,
|
|
|
|
|
|
|
|
///
|
|
|
|
/// The medium in the device has changed since the last
|
|
|
|
/// access.
|
|
|
|
///
|
|
|
|
SHELL_MEDIA_CHANGED = 13,
|
|
|
|
|
|
|
|
///
|
|
|
|
/// The item was not found.
|
|
|
|
///
|
|
|
|
SHELL_NOT_FOUND = 14,
|
|
|
|
|
|
|
|
///
|
|
|
|
/// Access was denied.
|
|
|
|
///
|
|
|
|
SHELL_ACCESS_DENIED = 15,
|
|
|
|
|
|
|
|
// note the skipping of 16 and 17
|
|
|
|
|
|
|
|
///
|
|
|
|
/// A timeout time expired.
|
|
|
|
///
|
|
|
|
SHELL_TIMEOUT = 18,
|
|
|
|
|
|
|
|
///
|
|
|
|
/// The protocol has not been started.
|
|
|
|
///
|
|
|
|
SHELL_NOT_STARTED = 19,
|
|
|
|
|
|
|
|
///
|
|
|
|
/// The protocol has already been started.
|
|
|
|
///
|
|
|
|
SHELL_ALREADY_STARTED = 20,
|
|
|
|
|
|
|
|
///
|
|
|
|
/// The operation was aborted.
|
|
|
|
///
|
|
|
|
SHELL_ABORTED = 21,
|
|
|
|
|
|
|
|
// note the skipping of 22, 23, and 24
|
|
|
|
|
|
|
|
///
|
|
|
|
/// A function encountered an internal version that was
|
|
|
|
/// incompatible with a version requested by the caller.
|
|
|
|
///
|
|
|
|
SHELL_INCOMPATIBLE_VERSION = 25,
|
|
|
|
|
|
|
|
///
|
|
|
|
/// The function was not performed due to a security violation.
|
|
|
|
///
|
|
|
|
SHELL_SECURITY_VIOLATION = 26,
|
|
|
|
|
|
|
|
///
|
|
|
|
/// The function was performed and resulted in an unequal
|
|
|
|
/// comparison..
|
|
|
|
///
|
|
|
|
SHELL_NOT_EQUAL = 27
|
|
|
|
} SHELL_STATUS;
|
|
|
|
|
2009-05-07 20:46:18 +02:00
|
|
|
|
2009-05-11 20:02:16 +02:00
|
|
|
// replaced EFI_LIST_ENTRY with LIST_ENTRY for simplicity.
|
|
|
|
// they are identical outside of the name.
|
2009-05-07 20:46:18 +02:00
|
|
|
typedef struct {
|
2010-09-14 07:18:09 +02:00
|
|
|
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.
|
2009-05-07 20:46:18 +02:00
|
|
|
} EFI_SHELL_FILE_INFO;
|
2009-11-20 19:21:03 +01:00
|
|
|
|
2009-05-07 20:46:18 +02:00
|
|
|
/**
|
|
|
|
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.
|
|
|
|
|
2010-01-25 21:05:08 +01:00
|
|
|
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
|
2009-05-07 20:46:18 +02:00
|
|
|
closed.
|
|
|
|
|
2010-01-25 21:05:08 +01:00
|
|
|
@param[in] FileHandle The file handle to be closed.
|
2009-05-07 20:46:18 +02:00
|
|
|
|
2009-11-20 19:21:03 +01:00
|
|
|
@retval EFI_SUCCESS The file closed sucessfully.
|
2009-05-07 20:46:18 +02:00
|
|
|
**/
|
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
|
|
|
(EFIAPI *EFI_SHELL_CLOSE_FILE)(
|
2010-09-14 07:18:09 +02:00
|
|
|
IN SHELL_FILE_HANDLE FileHandle
|
2009-05-07 20:46:18 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
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.
|
2010-01-25 21:05:08 +01:00
|
|
|
|
2009-05-07 20:46:18 +02:00
|
|
|
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.
|
2010-01-25 21:05:08 +01:00
|
|
|
|
2009-05-07 20:46:18 +02:00
|
|
|
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.
|
|
|
|
|
2010-01-25 21:05:08 +01:00
|
|
|
@param[in] FileName Pointer to NULL-terminated file path.
|
2010-09-14 07:18:09 +02:00
|
|
|
@param[in] FileAttribs The new file's attrbiutes. The different attributes are
|
2009-11-20 19:21:03 +01:00
|
|
|
described in EFI_FILE_PROTOCOL.Open().
|
2010-09-14 07:18:09 +02:00
|
|
|
@param[out] FileHandle On return, points to the created file handle or directory's handle.
|
2009-05-07 20:46:18 +02:00
|
|
|
|
2009-11-20 19:21:03 +01:00
|
|
|
@retval EFI_SUCCESS The file was opened. FileHandle points to the new file's handle.
|
2009-05-07 20:46:18 +02:00
|
|
|
@retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
|
2010-01-25 21:05:08 +01:00
|
|
|
@retval EFI_UNSUPPORTED The file path could not be opened.
|
2009-11-20 19:21:03 +01:00
|
|
|
@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.
|
2009-05-07 20:46:18 +02:00
|
|
|
**/
|
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
|
|
|
(EFIAPI *EFI_SHELL_CREATE_FILE)(
|
2010-09-14 07:18:09 +02:00
|
|
|
IN CONST CHAR16 *FileName,
|
|
|
|
IN UINT64 FileAttribs,
|
|
|
|
OUT SHELL_FILE_HANDLE *FileHandle
|
2009-05-07 20:46:18 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
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.
|
|
|
|
|
2009-11-10 21:23:01 +01:00
|
|
|
@param[in] FileHandle The file handle to delete.
|
2009-05-07 20:46:18 +02:00
|
|
|
|
2010-01-25 21:05:08 +01:00
|
|
|
@retval EFI_SUCCESS The file was closed and deleted and the handle was closed.
|
2009-05-07 20:46:18 +02:00
|
|
|
@retval EFI_WARN_DELETE_FAILURE The handle was closed but the file was not deleted.
|
|
|
|
**/
|
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
|
|
|
(EFIAPI *EFI_SHELL_DELETE_FILE)(
|
2010-09-14 07:18:09 +02:00
|
|
|
IN SHELL_FILE_HANDLE FileHandle
|
2009-05-07 20:46:18 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Deletes the file specified by the file name.
|
|
|
|
|
|
|
|
This function deletes a file.
|
|
|
|
|
2010-01-25 21:05:08 +01:00
|
|
|
@param[in] FileName Points to the NULL-terminated file name.
|
2009-05-07 20:46:18 +02:00
|
|
|
|
2010-01-25 21:05:08 +01:00
|
|
|
@retval EFI_SUCCESS The file was deleted.
|
2009-05-07 20:46:18 +02:00
|
|
|
@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) (
|
2010-01-25 21:05:08 +01:00
|
|
|
VOID
|
|
|
|
);
|
2009-05-07 20:46:18 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
Enables the page break output mode.
|
|
|
|
**/
|
|
|
|
typedef
|
|
|
|
VOID
|
|
|
|
(EFIAPI *EFI_SHELL_ENABLE_PAGE_BREAK) (
|
2010-01-25 21:05:08 +01:00
|
|
|
VOID
|
|
|
|
);
|
2009-05-07 20:46:18 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
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.
|
2010-01-25 21:05:08 +01:00
|
|
|
|
2009-05-07 20:46:18 +02:00
|
|
|
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.
|
2010-01-25 21:05:08 +01:00
|
|
|
|
2009-05-07 20:46:18 +02:00
|
|
|
The CommandLine is executed from the current working directory on the current
|
|
|
|
device.
|
|
|
|
|
2010-01-25 21:05:08 +01:00
|
|
|
@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
|
2009-11-10 21:23:01 +01:00
|
|
|
containing the command line. If NULL then the command-
|
|
|
|
line will be empty.
|
2010-01-25 21:05:08 +01:00
|
|
|
@param[in] Environment Points to a NULL-terminated array of environment
|
|
|
|
variables with the format 'x=y', where x is the
|
2009-11-10 21:23:01 +01:00
|
|
|
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.
|
|
|
|
|
2010-01-25 21:05:08 +01:00
|
|
|
@retval EFI_SUCCESS The command executed successfully. The status code
|
2009-11-10 21:23:01 +01:00
|
|
|
returned by the command is pointed to by StatusCode.
|
2009-05-07 20:46:18 +02:00
|
|
|
@retval EFI_INVALID_PARAMETER The parameters are invalid.
|
2009-11-10 21:23:01 +01:00
|
|
|
@retval EFI_OUT_OF_RESOURCES Out of resources.
|
|
|
|
@retval EFI_UNSUPPORTED Nested shell invocations are not allowed.
|
2009-05-07 20:46:18 +02:00
|
|
|
**/
|
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
|
|
|
(EFIAPI *EFI_SHELL_EXECUTE) (
|
2010-09-14 07:18:09 +02:00
|
|
|
IN EFI_HANDLE *ParentImageHandle,
|
|
|
|
IN CHAR16 *CommandLine OPTIONAL,
|
|
|
|
IN CHAR16 **Environment OPTIONAL,
|
|
|
|
OUT EFI_STATUS *StatusCode OPTIONAL
|
2009-05-07 20:46:18 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
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.
|
|
|
|
|
2010-01-25 21:05:08 +01:00
|
|
|
@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
|
2009-11-10 21:23:01 +01:00
|
|
|
were found.
|
2009-05-07 20:46:18 +02:00
|
|
|
|
2009-11-10 21:23:01 +01:00
|
|
|
@retval EFI_SUCCESS Files found.
|
|
|
|
@retval EFI_NOT_FOUND No files found.
|
2009-11-20 19:21:03 +01:00
|
|
|
@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.
|
2009-05-07 20:46:18 +02:00
|
|
|
**/
|
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
|
|
|
(EFIAPI *EFI_SHELL_FIND_FILES)(
|
2010-09-14 07:18:09 +02:00
|
|
|
IN CONST CHAR16 *FilePattern,
|
|
|
|
OUT EFI_SHELL_FILE_INFO **FileList
|
2009-05-07 20:46:18 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Find all files in a specified directory.
|
|
|
|
|
2009-11-10 21:23:01 +01:00
|
|
|
@param[in] FileDirHandle Handle of the directory to search.
|
2010-01-25 21:05:08 +01:00
|
|
|
@param[out] FileList On return, points to the list of files in the directory
|
2009-11-10 21:23:01 +01:00
|
|
|
or NULL if there are no files in the directory.
|
2009-05-07 20:46:18 +02:00
|
|
|
|
2009-11-10 21:23:01 +01:00
|
|
|
@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.
|
2009-05-07 20:46:18 +02:00
|
|
|
**/
|
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
|
|
|
(EFIAPI *EFI_SHELL_FIND_FILES_IN_DIR)(
|
2010-09-14 07:18:09 +02:00
|
|
|
IN SHELL_FILE_HANDLE FileDirHandle,
|
|
|
|
OUT EFI_SHELL_FILE_INFO **FileList
|
2009-05-07 20:46:18 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
2009-11-20 19:21:03 +01:00
|
|
|
Flushes data back to a device.
|
2010-01-25 21:05:08 +01:00
|
|
|
|
2009-05-07 20:46:18 +02:00
|
|
|
This function flushes all modified data associated with a file to a device.
|
|
|
|
|
2010-01-25 21:05:08 +01:00
|
|
|
@param[in] FileHandle The handle of the file to flush.
|
2009-05-07 20:46:18 +02:00
|
|
|
|
|
|
|
@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)(
|
2010-09-14 07:18:09 +02:00
|
|
|
IN SHELL_FILE_HANDLE FileHandle
|
2009-05-07 20:46:18 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Frees the file list.
|
2010-01-25 21:05:08 +01:00
|
|
|
|
2009-05-07 20:46:18 +02:00
|
|
|
This function cleans up the file list and any related data structures. It has no
|
|
|
|
impact on the files themselves.
|
|
|
|
|
2010-01-25 21:05:08 +01:00
|
|
|
@param[in] FileList The file list to free. Type EFI_SHELL_FILE_INFO is
|
|
|
|
defined in OpenFileList().
|
2009-05-07 20:46:18 +02:00
|
|
|
|
|
|
|
@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).
|
|
|
|
|
2015-10-23 04:03:20 +02:00
|
|
|
Note that the current directory string should exclude the tailing backslash character.
|
|
|
|
|
2010-01-25 21:05:08 +01:00
|
|
|
@param[in] FileSystemMapping A pointer to the file system mapping. If NULL,
|
2009-05-07 20:46:18 +02:00
|
|
|
then the current working directory is returned.
|
2010-01-25 21:05:08 +01:00
|
|
|
|
2009-05-07 20:46:18 +02:00
|
|
|
@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
|
2009-11-20 19:21:03 +01:00
|
|
|
|
2009-05-07 20:46:18 +02:00
|
|
|
/**
|
|
|
|
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.
|
|
|
|
|
2009-05-11 20:02:16 +02:00
|
|
|
If EFI_DEVICE_NAME_USE_COMPONENT_NAME is set, then the function will return the
|
2009-05-20 16:42:48 +02:00
|
|
|
device's name using the EFI_COMPONENT_NAME2_PROTOCOL, if present on
|
2009-05-11 20:02:16 +02:00
|
|
|
DeviceHandle.
|
|
|
|
|
|
|
|
If EFI_DEVICE_NAME_USE_DEVICE_PATH is set, then the function will return the
|
2009-05-20 16:42:48 +02:00
|
|
|
device's name using the EFI_DEVICE_PATH_PROTOCOL, if present on DeviceHandle.
|
2009-05-11 20:02:16 +02:00
|
|
|
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.
|
|
|
|
|
2009-11-10 21:23:01 +01:00
|
|
|
@param[in] DeviceHandle The handle of the device.
|
2010-01-25 21:05:08 +01:00
|
|
|
@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
|
2009-11-20 19:21:03 +01:00
|
|
|
specification, Appendix M.
|
2010-01-25 21:05:08 +01:00
|
|
|
@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
|
2009-05-07 20:46:18 +02:00
|
|
|
freed by the caller...
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS Get the name successfully.
|
|
|
|
@retval EFI_NOT_FOUND Fail to get the device name.
|
|
|
|
**/
|
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
2010-09-17 22:08:57 +02:00
|
|
|
(EFIAPI *EFI_SHELL_GET_DEVICE_NAME) (
|
2010-09-14 07:18:09 +02:00
|
|
|
IN EFI_HANDLE DeviceHandle,
|
|
|
|
IN EFI_SHELL_DEVICE_NAME_FLAGS Flags,
|
|
|
|
IN CHAR8 *Language,
|
|
|
|
OUT CHAR16 **BestDeviceName
|
2009-05-07 20:46:18 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the device path from the mapping.
|
|
|
|
|
|
|
|
This function gets the device path associated with a mapping.
|
|
|
|
|
2009-11-10 21:23:01 +01:00
|
|
|
@param[in] Mapping A pointer to the mapping
|
2009-05-07 20:46:18 +02:00
|
|
|
|
2010-01-25 21:05:08 +01:00
|
|
|
@retval !=NULL Pointer to the device path that corresponds to the
|
|
|
|
device mapping. The returned pointer does not need
|
2009-05-07 20:46:18 +02:00
|
|
|
to be freed.
|
2010-01-25 21:05:08 +01:00
|
|
|
@retval NULL There is no device path associated with the
|
2009-05-07 20:46:18 +02:00
|
|
|
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.
|
|
|
|
|
2009-11-20 19:21:03 +01:00
|
|
|
@param[in] Path The pointer to the path.
|
2009-05-07 20:46:18 +02:00
|
|
|
|
2010-01-25 21:05:08 +01:00
|
|
|
@return The pointer of the file path. The file path is callee
|
2009-05-07 20:46:18 +02:00
|
|
|
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
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
2009-11-10 21:23:01 +01:00
|
|
|
Gets either a single or list of environment variables.
|
|
|
|
|
2010-01-25 21:05:08 +01:00
|
|
|
If name is not NULL then this function returns the current value of the specified
|
2009-11-10 21:23:01 +01:00
|
|
|
environment variable.
|
2009-05-07 20:46:18 +02:00
|
|
|
|
2010-01-25 21:05:08 +01:00
|
|
|
If Name is NULL than a list of all environment variable names is returned. Each a
|
2009-11-10 21:23:01 +01:00
|
|
|
NULL terminated string with a double NULL terminating the list.
|
2009-05-07 20:46:18 +02:00
|
|
|
|
2010-01-25 21:05:08 +01:00
|
|
|
@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
|
2009-11-10 21:23:01 +01:00
|
|
|
NULL.
|
2009-05-07 20:46:18 +02:00
|
|
|
|
2010-01-25 21:05:08 +01:00
|
|
|
@return A pointer to the returned string.
|
2009-11-10 21:23:01 +01:00
|
|
|
The returned pointer does not need to be freed by the caller.
|
|
|
|
|
2010-01-25 21:05:08 +01:00
|
|
|
@retval NULL The environment variable doesn't exist or there are
|
2009-11-10 21:23:01 +01:00
|
|
|
no environment variables.
|
2009-05-07 20:46:18 +02:00
|
|
|
**/
|
|
|
|
typedef
|
|
|
|
CONST CHAR16 *
|
|
|
|
(EFIAPI *EFI_SHELL_GET_ENV) (
|
2009-11-10 21:23:01 +01:00
|
|
|
IN CONST CHAR16 *Name OPTIONAL
|
2009-05-07 20:46:18 +02:00
|
|
|
);
|
|
|
|
|
2014-08-05 19:52:18 +02:00
|
|
|
/**
|
|
|
|
Gets the environment variable and Attributes, or list of environment variables. Can be
|
|
|
|
used instead of GetEnv().
|
|
|
|
|
|
|
|
This function returns the current value of the specified environment variable and
|
|
|
|
the Attributes. If no variable name was specified, then all of the known
|
|
|
|
variables will be returned.
|
|
|
|
|
|
|
|
@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.
|
|
|
|
@param[out] Attributes If not NULL, a pointer to the returned attributes bitmask for
|
|
|
|
the environment variable. In the case where Name is NULL, and
|
|
|
|
multiple environment variables are being returned, Attributes
|
|
|
|
is undefined.
|
|
|
|
|
2014-08-18 02:48:22 +02:00
|
|
|
@retval NULL The environment variable doesn't exist.
|
|
|
|
@return The environment variable's value. The returned pointer does not
|
2014-08-05 19:52:18 +02:00
|
|
|
need to be freed by the caller.
|
|
|
|
**/
|
|
|
|
typedef
|
|
|
|
CONST CHAR16 *
|
|
|
|
(EFIAPI *EFI_SHELL_GET_ENV_EX) (
|
|
|
|
IN CONST CHAR16 *Name,
|
|
|
|
OUT UINT32 *Attributes OPTIONAL
|
|
|
|
);
|
|
|
|
|
2009-05-07 20:46:18 +02:00
|
|
|
/**
|
|
|
|
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.
|
|
|
|
|
2009-11-20 19:21:03 +01:00
|
|
|
@param[in] FileHandle A File Handle.
|
2009-05-07 20:46:18 +02:00
|
|
|
|
2010-01-25 21:05:08 +01:00
|
|
|
@retval NULL Cannot get the file info.
|
|
|
|
@return A pointer to a buffer with file information.
|
2009-05-07 20:46:18 +02:00
|
|
|
**/
|
|
|
|
typedef
|
|
|
|
EFI_FILE_INFO *
|
|
|
|
(EFIAPI *EFI_SHELL_GET_FILE_INFO)(
|
2010-09-14 07:18:09 +02:00
|
|
|
IN SHELL_FILE_HANDLE FileHandle
|
2009-05-07 20:46:18 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
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.
|
|
|
|
|
2010-01-25 21:05:08 +01:00
|
|
|
@param[in] Path The pointer to the device path.
|
2009-05-07 20:46:18 +02:00
|
|
|
|
2010-01-25 21:05:08 +01:00
|
|
|
@return The pointer of the NULL-terminated file path. The path
|
2009-05-07 20:46:18 +02:00
|
|
|
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
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
2009-11-20 19:21:03 +01:00
|
|
|
Gets a file's current position.
|
2009-05-07 20:46:18 +02:00
|
|
|
|
|
|
|
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.
|
|
|
|
|
2009-11-10 21:23:01 +01:00
|
|
|
@param[in] FileHandle The file handle on which to get the current position.
|
2010-01-25 21:05:08 +01:00
|
|
|
@param[out] Position Byte position from the start of the file.
|
2009-05-07 20:46:18 +02:00
|
|
|
|
|
|
|
@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)(
|
2010-09-14 07:18:09 +02:00
|
|
|
IN SHELL_FILE_HANDLE FileHandle,
|
2009-05-07 20:46:18 +02:00
|
|
|
OUT UINT64 *Position
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the size of a file.
|
|
|
|
|
|
|
|
This function returns the size of the file specified by FileHandle.
|
|
|
|
|
2009-11-10 21:23:01 +01:00
|
|
|
@param[in] FileHandle The handle of the file.
|
|
|
|
@param[out] Size The size of this file.
|
2009-05-07 20:46:18 +02:00
|
|
|
|
|
|
|
@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)(
|
2010-09-14 07:18:09 +02:00
|
|
|
IN SHELL_FILE_HANDLE FileHandle,
|
2009-05-07 20:46:18 +02:00
|
|
|
OUT UINT64 *Size
|
|
|
|
);
|
|
|
|
|
2014-08-05 19:52:18 +02:00
|
|
|
/**
|
|
|
|
Get the GUID value from a human readable name.
|
|
|
|
|
|
|
|
If GuidName is a known GUID name, then update Guid to have the correct value for
|
|
|
|
that GUID.
|
|
|
|
|
|
|
|
This function is only available when the major and minor versions in the
|
|
|
|
EfiShellProtocol are greater than or equal to 2 and 1, respectively.
|
|
|
|
|
|
|
|
@param[in] GuidName A pointer to the localized name for the GUID being queried.
|
|
|
|
@param[out] Guid A pointer to the GUID structure to be filled in.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS The operation was successful.
|
|
|
|
@retval EFI_INVALID_PARAMETER Guid was NULL.
|
|
|
|
@retval EFI_INVALID_PARAMETER GuidName was NULL.
|
|
|
|
@retval EFI_NOT_FOUND GuidName is not a known GUID Name.
|
|
|
|
**/
|
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
|
|
|
(EFIAPI *EFI_SHELL_GET_GUID_FROM_NAME)(
|
|
|
|
IN CONST CHAR16 *GuidName,
|
|
|
|
OUT EFI_GUID *Guid
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Get the human readable name for a GUID from the value.
|
|
|
|
|
|
|
|
If Guid is assigned a name, then update *GuidName to point to the name. The callee
|
|
|
|
should not modify the value.
|
|
|
|
|
|
|
|
This function is only available when the major and minor versions in the
|
|
|
|
EfiShellProtocol are greater than or equal to 2 and 1, respectively.
|
|
|
|
|
|
|
|
@param[in] Guid A pointer to the GUID being queried.
|
|
|
|
@param[out] GuidName A pointer to a pointer the localized to name for the GUID being requested
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS The operation was successful.
|
|
|
|
@retval EFI_INVALID_PARAMETER Guid was NULL.
|
|
|
|
@retval EFI_INVALID_PARAMETER GuidName was NULL.
|
|
|
|
@retval EFI_NOT_FOUND Guid is not assigned a name.
|
|
|
|
**/
|
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
|
|
|
(EFIAPI *EFI_SHELL_GET_GUID_NAME)(
|
|
|
|
IN CONST EFI_GUID *Guid,
|
|
|
|
OUT CONST CHAR16 **GuidName
|
|
|
|
);
|
|
|
|
|
2009-05-07 20:46:18 +02:00
|
|
|
/**
|
|
|
|
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.
|
2010-01-25 21:05:08 +01:00
|
|
|
|
2009-05-07 20:46:18 +02:00
|
|
|
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.
|
|
|
|
|
2010-01-25 21:05:08 +01:00
|
|
|
@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
|
2009-05-07 20:46:18 +02:00
|
|
|
sections will be returned.
|
2010-01-25 21:05:08 +01:00
|
|
|
@param[out] HelpText On return, points to a callee-allocated buffer
|
2009-05-07 20:46:18 +02:00
|
|
|
containing all specified help text.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS The help text was returned.
|
2010-01-25 21:05:08 +01:00
|
|
|
@retval EFI_OUT_OF_RESOURCES The necessary buffer could not be allocated to hold the
|
2009-05-07 20:46:18 +02:00
|
|
|
returned help text.
|
2009-11-20 19:21:03 +01:00
|
|
|
@retval EFI_INVALID_PARAMETER HelpText is NULL.
|
2009-05-07 20:46:18 +02:00
|
|
|
@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,
|
2009-06-16 02:23:19 +02:00
|
|
|
IN CONST CHAR16 *Sections OPTIONAL,
|
2009-05-07 20:46:18 +02:00
|
|
|
OUT CHAR16 **HelpText
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
2009-11-10 21:23:01 +01:00
|
|
|
Gets the mapping(s) that most closely matches the device path.
|
2009-05-07 20:46:18 +02:00
|
|
|
|
|
|
|
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.
|
|
|
|
|
2010-01-25 21:05:08 +01:00
|
|
|
If there are multiple map names they will be semi-colon seperated in the
|
2009-11-10 21:23:01 +01:00
|
|
|
NULL-terminated string.
|
|
|
|
|
2011-09-02 10:05:34 +02:00
|
|
|
@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.
|
2009-05-07 20:46:18 +02:00
|
|
|
|
|
|
|
@retval NULL No mapping was found.
|
2010-01-25 21:05:08 +01:00
|
|
|
@retval !=NULL Pointer to NULL-terminated mapping. The buffer
|
2009-05-07 20:46:18 +02:00
|
|
|
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.
|
|
|
|
|
2009-11-20 19:21:03 +01:00
|
|
|
@retval TRUE The page break output mode is enabled.
|
|
|
|
@retval FALSE The page break output mode is disabled.
|
2009-05-07 20:46:18 +02:00
|
|
|
**/
|
|
|
|
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.
|
2010-01-25 21:05:08 +01:00
|
|
|
If the file name begins with '>v', then the file handle which is returned refers to the
|
2009-05-07 20:46:18 +02:00
|
|
|
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.
|
|
|
|
|
2010-01-25 21:05:08 +01:00
|
|
|
If the file name is '>i', then the file handle which is returned refers to the standard
|
2009-05-07 20:46:18 +02:00
|
|
|
input. If the OpenMode indicates EFI_FILE_MODE_WRITE, then EFI_INVALID_PARAMETER
|
|
|
|
is returned.
|
|
|
|
|
2010-01-25 21:05:08 +01:00
|
|
|
If the file name is '>o', then the file handle which is returned refers to the standard
|
2009-05-07 20:46:18 +02:00
|
|
|
output. If the OpenMode indicates EFI_FILE_MODE_READ, then EFI_INVALID_PARAMETER
|
|
|
|
is returned.
|
|
|
|
|
2010-01-25 21:05:08 +01:00
|
|
|
If the file name is '>e', then the file handle which is returned refers to the standard
|
2009-05-07 20:46:18 +02:00
|
|
|
error. If the OpenMode indicates EFI_FILE_MODE_READ, then EFI_INVALID_PARAMETER
|
|
|
|
is returned.
|
|
|
|
|
2010-01-25 21:05:08 +01:00
|
|
|
If the file name is 'NUL', then the file handle that is returned refers to the standard NUL
|
2009-05-07 20:46:18 +02:00
|
|
|
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.
|
|
|
|
|
2010-01-25 21:05:08 +01:00
|
|
|
@param[in] FileName Points to the NULL-terminated UCS-2 encoded file name.
|
2009-11-10 21:23:01 +01:00
|
|
|
@param[out] FileHandle On return, points to the file handle.
|
2010-01-25 21:05:08 +01:00
|
|
|
@param[in] OpenMode File open mode. Either EFI_FILE_MODE_READ or
|
|
|
|
EFI_FILE_MODE_WRITE from section 12.4 of the UEFI
|
2009-05-07 20:46:18 +02:00
|
|
|
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,
|
2010-09-14 07:18:09 +02:00
|
|
|
OUT SHELL_FILE_HANDLE *FileHandle,
|
2009-05-07 20:46:18 +02:00
|
|
|
IN UINT64 OpenMode
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Opens the files that match the path specified.
|
|
|
|
|
|
|
|
This function opens all of the files specified by Path. Wildcards are processed
|
2010-01-25 21:05:08 +01:00
|
|
|
according to the rules specified in UEFI Shell 2.0 spec section 3.7.1. Each
|
2009-05-07 20:46:18 +02:00
|
|
|
matching file has an EFI_SHELL_FILE_INFO structure created in a linked list.
|
|
|
|
|
2011-09-02 10:05:34 +02:00
|
|
|
@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.
|
2009-05-07 20:46:18 +02:00
|
|
|
|
|
|
|
@retval EFI_SUCCESS Create the file list successfully.
|
2009-11-20 19:21:03 +01:00
|
|
|
@return Can't create the file list.
|
2009-05-07 20:46:18 +02:00
|
|
|
**/
|
|
|
|
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.
|
|
|
|
|
2009-11-10 21:23:01 +01:00
|
|
|
@param[in] DevicePath Points to the device path corresponding to the device where the
|
2009-05-07 20:46:18 +02:00
|
|
|
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is installed.
|
2009-11-10 21:23:01 +01:00
|
|
|
@param[out] FileHandle On exit, points to the file handle corresponding to the root directory on the
|
2009-05-07 20:46:18 +02:00
|
|
|
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.
|
2009-11-20 19:21:03 +01:00
|
|
|
@retval EFI_DEVICE_ERROR The device had an error.
|
2009-05-07 20:46:18 +02:00
|
|
|
**/
|
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
|
|
|
(EFIAPI *EFI_SHELL_OPEN_ROOT)(
|
|
|
|
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
|
2010-09-14 07:18:09 +02:00
|
|
|
OUT SHELL_FILE_HANDLE *FileHandle
|
2009-05-07 20:46:18 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
2009-11-20 19:21:03 +01:00
|
|
|
Opens the root directory of a device on a handle.
|
2009-05-07 20:46:18 +02:00
|
|
|
|
|
|
|
This function opens the root directory of a device and returns a file handle to it.
|
|
|
|
|
2009-11-10 21:23:01 +01:00
|
|
|
@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
|
2009-05-07 20:46:18 +02:00
|
|
|
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.
|
2009-11-20 19:21:03 +01:00
|
|
|
@retval EFI_DEVICE_ERROR The device had an error.
|
2009-05-07 20:46:18 +02:00
|
|
|
**/
|
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
|
|
|
(EFIAPI *EFI_SHELL_OPEN_ROOT_BY_HANDLE)(
|
|
|
|
IN EFI_HANDLE DeviceHandle,
|
2010-09-14 07:18:09 +02:00
|
|
|
OUT SHELL_FILE_HANDLE *FileHandle
|
2009-05-07 20:46:18 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
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.
|
|
|
|
|
2011-09-02 10:05:34 +02:00
|
|
|
@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.
|
2009-05-07 20:46:18 +02:00
|
|
|
|
|
|
|
@retval EFI_SUCCESS Data was read.
|
2009-11-20 19:21:03 +01:00
|
|
|
@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.
|
2009-05-07 20:46:18 +02:00
|
|
|
**/
|
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
|
|
|
(EFIAPI *EFI_SHELL_READ_FILE) (
|
2010-09-14 07:18:09 +02:00
|
|
|
IN SHELL_FILE_HANDLE FileHandle,
|
2009-05-07 20:46:18 +02:00
|
|
|
IN OUT UINTN *ReadSize,
|
2009-11-10 21:23:01 +01:00
|
|
|
IN OUT VOID *Buffer
|
2009-05-07 20:46:18 +02:00
|
|
|
);
|
|
|
|
|
2014-08-05 19:52:18 +02:00
|
|
|
/**
|
|
|
|
Register a GUID and a localized human readable name for it.
|
|
|
|
|
|
|
|
If Guid is not assigned a name, then assign GuidName to Guid. This list of GUID
|
|
|
|
names must be used whenever a shell command outputs GUID information.
|
|
|
|
|
|
|
|
This function is only available when the major and minor versions in the
|
|
|
|
EfiShellProtocol are greater than or equal to 2 and 1, respectively.
|
|
|
|
|
|
|
|
@param[in] Guid A pointer to the GUID being registered.
|
|
|
|
@param[in] GuidName A pointer to the localized name for the GUID being registered.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS The operation was successful.
|
|
|
|
@retval EFI_INVALID_PARAMETER Guid was NULL.
|
|
|
|
@retval EFI_INVALID_PARAMETER GuidName was NULL.
|
|
|
|
@retval EFI_ACCESS_DENIED Guid already is assigned a name.
|
|
|
|
**/
|
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
|
|
|
(EFIAPI *EFI_SHELL_REGISTER_GUID_NAME)(
|
|
|
|
IN CONST EFI_GUID *Guid,
|
|
|
|
IN CONST CHAR16 *GuidName
|
|
|
|
);
|
|
|
|
|
2009-05-07 20:46:18 +02:00
|
|
|
/**
|
|
|
|
Deletes the duplicate file names files in the given file list.
|
|
|
|
|
2009-11-10 21:23:01 +01:00
|
|
|
@param[in] FileList A pointer to the first entry in the file list.
|
2009-05-07 20:46:18 +02:00
|
|
|
|
|
|
|
@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.
|
|
|
|
|
2010-01-25 21:05:08 +01:00
|
|
|
@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
|
2009-05-07 20:46:18 +02:00
|
|
|
Command refers to an alias, that alias will be deleted.
|
2009-11-10 21:23:01 +01:00
|
|
|
@param[in] Replace If TRUE and the alias already exists, then the existing alias will be replaced. If
|
2009-05-07 20:46:18 +02:00
|
|
|
FALSE and the alias already exists, then the existing alias is unchanged and
|
|
|
|
EFI_ACCESS_DENIED is returned.
|
2010-01-25 21:05:08 +01:00
|
|
|
@param[in] Volatile if TRUE the Alias being set will be stored in a volatile fashion. if FALSE the
|
2009-11-10 21:23:01 +01:00
|
|
|
Alias being set will be stored in a non-volatile fashion.
|
2009-05-07 20:46:18 +02:00
|
|
|
|
|
|
|
@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,
|
2009-11-10 21:23:01 +01:00
|
|
|
IN BOOLEAN Replace,
|
|
|
|
IN BOOLEAN Volatile
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
2009-11-11 23:05:04 +01:00
|
|
|
This function returns the command associated with a alias or a list of all
|
|
|
|
alias'.
|
2009-11-10 21:23:01 +01:00
|
|
|
|
2010-01-25 21:05:08 +01:00
|
|
|
@param[in] Alias Points to the NULL-terminated shell alias.
|
|
|
|
If this parameter is NULL, then all
|
2009-11-10 21:23:01 +01:00
|
|
|
aliases will be returned in ReturnedData.
|
2009-11-20 19:21:03 +01:00
|
|
|
@param[out] Volatile Upon return of a single command if TRUE indicates
|
2009-11-11 23:05:04 +01:00
|
|
|
this is stored in a volatile fashion. FALSE otherwise.
|
2010-01-25 21:05:08 +01:00
|
|
|
@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.
|
2009-11-20 22:13:41 +01:00
|
|
|
@retval NULL An error ocurred.
|
2009-11-20 19:21:03 +01:00
|
|
|
@retval NULL Alias was not a valid Alias.
|
2009-11-10 21:23:01 +01:00
|
|
|
**/
|
2010-01-25 21:05:08 +01:00
|
|
|
typedef
|
2009-11-11 19:23:31 +01:00
|
|
|
CONST CHAR16 *
|
2009-11-10 21:23:01 +01:00
|
|
|
(EFIAPI *EFI_SHELL_GET_ALIAS)(
|
2009-11-11 23:05:04 +01:00
|
|
|
IN CONST CHAR16 *Alias,
|
|
|
|
OUT BOOLEAN *Volatile OPTIONAL
|
2009-05-07 20:46:18 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
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
|
2010-01-25 21:05:08 +01:00
|
|
|
%cwd% environment variable will be updated.
|
2009-05-07 20:46:18 +02:00
|
|
|
|
2009-11-10 21:23:01 +01:00
|
|
|
@param[in] FileSystem A pointer to the file system's mapped name. If NULL, then the current working
|
2009-05-07 20:46:18 +02:00
|
|
|
directory is changed.
|
2010-01-25 21:05:08 +01:00
|
|
|
@param[in] Dir Points to the NULL-terminated directory on the device specified by FileSystem.
|
2009-05-07 20:46:18 +02:00
|
|
|
|
|
|
|
@retval NULL Current directory does not exist.
|
2010-01-25 21:05:08 +01:00
|
|
|
@return The current directory.
|
2009-05-07 20:46:18 +02:00
|
|
|
**/
|
|
|
|
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.
|
2010-01-25 21:05:08 +01:00
|
|
|
|
|
|
|
For a description of volatile and non-volatile environment variables, see UEFI Shell
|
2009-05-07 20:46:18 +02:00
|
|
|
2.0 specification section 3.6.1.
|
|
|
|
|
2010-01-25 21:05:08 +01:00
|
|
|
@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
|
2009-05-07 20:46:18 +02:00
|
|
|
empty string then the environment variable is deleted.
|
2009-11-18 22:36:50 +01:00
|
|
|
@param[in] Volatile Indicates whether the variable is non-volatile (FALSE) or volatile (TRUE).
|
2009-05-07 20:46:18 +02:00
|
|
|
|
|
|
|
@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.
|
|
|
|
|
2010-01-25 21:05:08 +01:00
|
|
|
This function changes file information. All file information in the EFI_FILE_INFO
|
|
|
|
struct will be updated to the passed in data.
|
2009-05-07 20:46:18 +02:00
|
|
|
|
2010-01-25 21:05:08 +01:00
|
|
|
@param[in] FileHandle A file handle.
|
2009-11-20 19:21:03 +01:00
|
|
|
@param[in] FileInfo Points to new file information.
|
2009-05-07 20:46:18 +02:00
|
|
|
|
|
|
|
@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)(
|
2010-09-14 07:18:09 +02:00
|
|
|
IN SHELL_FILE_HANDLE FileHandle,
|
2009-05-07 20:46:18 +02:00
|
|
|
IN CONST EFI_FILE_INFO *FileInfo
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
2009-11-20 19:21:03 +01:00
|
|
|
Sets a file's current position.
|
2009-05-07 20:46:18 +02:00
|
|
|
|
|
|
|
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.
|
|
|
|
|
2009-11-20 19:21:03 +01:00
|
|
|
@param[in] FileHandle The file handle on which requested position will be set.
|
|
|
|
@param[in] Position Byte position from the start of the file.
|
2009-05-07 20:46:18 +02:00
|
|
|
|
|
|
|
@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)(
|
2010-09-14 07:18:09 +02:00
|
|
|
IN SHELL_FILE_HANDLE FileHandle,
|
2009-05-07 20:46:18 +02:00
|
|
|
IN UINT64 Position
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
This function creates a mapping for a device path.
|
|
|
|
|
2009-11-20 19:21:03 +01:00
|
|
|
@param[in] DevicePath Points to the device path. If this is NULL and Mapping points to a valid mapping,
|
2009-05-07 20:46:18 +02:00
|
|
|
then the mapping will be deleted.
|
2010-01-25 21:05:08 +01:00
|
|
|
@param[in] Mapping Points to the NULL-terminated mapping for the device path.
|
2009-05-07 20:46:18 +02:00
|
|
|
|
|
|
|
@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.
|
|
|
|
|
2011-09-02 10:05:34 +02:00
|
|
|
@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.
|
2009-05-07 20:46:18 +02:00
|
|
|
|
2009-11-20 19:21:03 +01:00
|
|
|
@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.
|
2009-05-07 20:46:18 +02:00
|
|
|
**/
|
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
|
|
|
(EFIAPI *EFI_SHELL_WRITE_FILE)(
|
2010-09-14 07:18:09 +02:00
|
|
|
IN SHELL_FILE_HANDLE FileHandle,
|
2009-06-15 20:42:13 +02:00
|
|
|
IN OUT UINTN *BufferSize,
|
|
|
|
IN VOID *Buffer
|
2009-05-07 20:46:18 +02:00
|
|
|
);
|
|
|
|
|
2014-08-05 19:52:18 +02:00
|
|
|
//
|
2014-08-18 22:00:08 +02:00
|
|
|
// EFI_SHELL_PROTOCOL has been updated since UEFI Shell Spec 2.0
|
|
|
|
// Usage of this protocol will require version checking before attempting
|
|
|
|
// to use any new members. There is no need to check the version for
|
|
|
|
// members that existed in UEFI Shell Spec 2.0.
|
|
|
|
//
|
|
|
|
// Update below for any future UEFI Shell spec changes to this protocol.
|
2014-08-05 19:52:18 +02:00
|
|
|
//
|
2014-08-18 22:00:08 +02:00
|
|
|
// Check EFI_SHELL_PROTOCOL MajorVersion and MinorVersion:
|
|
|
|
// if ((2 == gEfiShellProtocol->MajorVersion) &&
|
|
|
|
// (0 == gEfiShellProtocol->MinorVersion)) {
|
|
|
|
// //
|
|
|
|
// // Cannot call:
|
|
|
|
// // RegisterGuidName - UEFI Shell 2.1
|
|
|
|
// // GetGuidName - UEFI Shell 2.1
|
|
|
|
// // GetGuidFromName - UEFI Shell 2.1
|
|
|
|
// // GetEnvEx - UEFI Shell 2.1
|
|
|
|
// //
|
|
|
|
// } else {
|
|
|
|
// //
|
|
|
|
// // Can use all members
|
|
|
|
// //
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
typedef struct _EFI_SHELL_PROTOCOL {
|
2014-08-05 19:52:18 +02:00
|
|
|
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;
|
|
|
|
// Added for Shell 2.1
|
2014-08-18 22:00:08 +02:00
|
|
|
EFI_SHELL_REGISTER_GUID_NAME RegisterGuidName;
|
|
|
|
EFI_SHELL_GET_GUID_NAME GetGuidName;
|
|
|
|
EFI_SHELL_GET_GUID_FROM_NAME GetGuidFromName;
|
|
|
|
EFI_SHELL_GET_ENV_EX GetEnvEx;
|
|
|
|
} EFI_SHELL_PROTOCOL;
|
2014-08-05 19:52:18 +02:00
|
|
|
|
2009-05-07 20:46:18 +02:00
|
|
|
extern EFI_GUID gEfiShellProtocolGuid;
|
|
|
|
|
2009-05-11 20:02:16 +02:00
|
|
|
enum ShellVersion {
|
|
|
|
SHELL_MAJOR_VERSION = 2,
|
2017-03-31 16:23:13 +02:00
|
|
|
SHELL_MINOR_VERSION = 2
|
2009-05-11 20:02:16 +02:00
|
|
|
};
|
|
|
|
|
2009-05-07 20:46:18 +02:00
|
|
|
#endif
|