TianoCore EDK2 master
Loading...
Searching...
No Matches
FileHandleWrappers.c File Reference
#include "Shell.h"
#include "FileHandleInternal.h"

Go to the source code of this file.

Data Structures

struct  EFI_FILE_PROTOCOL_ENVIRONMENT
 
struct  EFI_FILE_PROTOCOL_MEM
 
struct  EFI_FILE_PROTOCOL_FILE
 

Macros

#define MEM_WRITE_REALLOC_OVERHEAD   1024
 
#define SIZE_OF_EFI_FILE_PROTOCOL_ENVIRONMENT   EFI_FIELD_OFFSET (EFI_FILE_PROTOCOL_ENVIRONMENT, Name)
 

Functions

EFI_STATUS EFIAPI FileInterfaceOpenNotFound (IN EFI_FILE_PROTOCOL *This, OUT EFI_FILE_PROTOCOL **NewHandle, IN CHAR16 *FileName, IN UINT64 OpenMode, IN UINT64 Attributes)
 
EFI_STATUS EFIAPI FileInterfaceNopGeneric (IN EFI_FILE_PROTOCOL *This)
 
EFI_STATUS EFIAPI FileInterfaceNopGetPosition (IN EFI_FILE_PROTOCOL *This, OUT UINT64 *Position)
 
EFI_STATUS EFIAPI FileInterfaceNopSetPosition (IN EFI_FILE_PROTOCOL *This, IN UINT64 Position)
 
EFI_STATUS EFIAPI FileInterfaceNopGetInfo (IN EFI_FILE_PROTOCOL *This, IN EFI_GUID *InformationType, IN OUT UINTN *BufferSize, OUT VOID *Buffer)
 
EFI_STATUS EFIAPI FileInterfaceNopSetInfo (IN EFI_FILE_PROTOCOL *This, IN EFI_GUID *InformationType, IN UINTN BufferSize, IN VOID *Buffer)
 
EFI_STATUS EFIAPI FileInterfaceStdOutWrite (IN EFI_FILE_PROTOCOL *This, IN OUT UINTN *BufferSize, IN VOID *Buffer)
 
EFI_STATUS EFIAPI FileInterfaceStdInWrite (IN EFI_FILE_PROTOCOL *This, IN OUT UINTN *BufferSize, IN VOID *Buffer)
 
EFI_STATUS EFIAPI FileInterfaceStdErrWrite (IN EFI_FILE_PROTOCOL *This, IN OUT UINTN *BufferSize, IN VOID *Buffer)
 
EFI_STATUS EFIAPI FileInterfaceStdOutRead (IN EFI_FILE_PROTOCOL *This, IN OUT UINTN *BufferSize, OUT VOID *Buffer)
 
EFI_STATUS EFIAPI FileInterfaceStdErrRead (IN EFI_FILE_PROTOCOL *This, IN OUT UINTN *BufferSize, OUT VOID *Buffer)
 
EFI_STATUS EFIAPI FileInterfaceNulRead (IN EFI_FILE_PROTOCOL *This, IN OUT UINTN *BufferSize, OUT VOID *Buffer)
 
EFI_STATUS EFIAPI FileInterfaceNulWrite (IN EFI_FILE_PROTOCOL *This, IN OUT UINTN *BufferSize, IN VOID *Buffer)
 
EFI_STATUS CreateTabCompletionList (IN CONST CHAR16 *InputString, IN CONST UINTN StringLen, IN CONST UINTN BufferSize, IN OUT EFI_SHELL_FILE_INFO **TabCompletionList, IN OUT UINTN *TabUpdatePos)
 
EFI_STATUS EFIAPI FileInterfaceStdInRead (IN EFI_FILE_PROTOCOL *This, IN OUT UINTN *BufferSize, OUT VOID *Buffer)
 
EFI_STATUS EFIAPI FileInterfaceEnvClose (IN EFI_FILE_PROTOCOL *This)
 
EFI_STATUS EFIAPI FileInterfaceEnvDelete (IN EFI_FILE_PROTOCOL *This)
 
EFI_STATUS EFIAPI FileInterfaceEnvRead (IN EFI_FILE_PROTOCOL *This, IN OUT UINTN *BufferSize, OUT VOID *Buffer)
 
EFI_STATUS EFIAPI FileInterfaceEnvVolWrite (IN EFI_FILE_PROTOCOL *This, IN OUT UINTN *BufferSize, IN VOID *Buffer)
 
EFI_STATUS EFIAPI FileInterfaceEnvNonVolWrite (IN EFI_FILE_PROTOCOL *This, IN OUT UINTN *BufferSize, IN VOID *Buffer)
 
EFI_FILE_PROTOCOLCreateFileInterfaceEnv (IN CONST CHAR16 *EnvName)
 
VOID MoveCursorBackward (IN UINTN LineLength, IN OUT UINTN *Column, IN OUT UINTN *Row)
 
VOID MoveCursorForward (IN UINTN LineLength, IN UINTN TotalRow, IN OUT UINTN *Column, IN OUT UINTN *Row)
 
VOID PrintCommandHistory (IN CONST UINTN TotalCols, IN CONST UINTN TotalRows, IN CONST UINTN StartColumn)
 
EFI_STATUS EFIAPI FileInterfaceMemSetPosition (IN EFI_FILE_PROTOCOL *This, OUT UINT64 Position)
 
EFI_STATUS EFIAPI FileInterfaceMemGetPosition (IN EFI_FILE_PROTOCOL *This, OUT UINT64 *Position)
 
EFI_STATUS EFIAPI FileInterfaceMemGetInfo (IN EFI_FILE_PROTOCOL *This, IN EFI_GUID *InformationType, IN OUT UINTN *BufferSize, OUT VOID *Buffer)
 
EFI_STATUS EFIAPI FileInterfaceMemWrite (IN EFI_FILE_PROTOCOL *This, IN OUT UINTN *BufferSize, IN VOID *Buffer)
 
EFI_STATUS EFIAPI FileInterfaceMemRead (IN EFI_FILE_PROTOCOL *This, IN OUT UINTN *BufferSize, IN VOID *Buffer)
 
EFI_STATUS EFIAPI FileInterfaceMemClose (IN EFI_FILE_PROTOCOL *This)
 
EFI_FILE_PROTOCOLCreateFileInterfaceMem (IN CONST BOOLEAN Unicode)
 
EFI_STATUS EFIAPI FileInterfaceFileSetPosition (IN EFI_FILE_PROTOCOL *This, IN UINT64 Position)
 
EFI_STATUS EFIAPI FileInterfaceFileGetPosition (IN EFI_FILE_PROTOCOL *This, OUT UINT64 *Position)
 
EFI_STATUS EFIAPI FileInterfaceFileGetInfo (IN EFI_FILE_PROTOCOL *This, IN EFI_GUID *InformationType, IN OUT UINTN *BufferSize, OUT VOID *Buffer)
 
EFI_STATUS EFIAPI FileInterfaceFileSetInfo (IN EFI_FILE_PROTOCOL *This, IN EFI_GUID *InformationType, IN UINTN BufferSize, IN VOID *Buffer)
 
EFI_STATUS EFIAPI FileInterfaceFileFlush (IN EFI_FILE_PROTOCOL *This)
 
EFI_STATUS EFIAPI FileInterfaceFileRead (IN EFI_FILE_PROTOCOL *This, IN OUT UINTN *BufferSize, OUT VOID *Buffer)
 
EFI_STATUS EFIAPI FileInterfaceFileOpen (IN EFI_FILE_PROTOCOL *This, OUT EFI_FILE_PROTOCOL **NewHandle, IN CHAR16 *FileName, IN UINT64 OpenMode, IN UINT64 Attributes)
 
EFI_STATUS EFIAPI FileInterfaceFileDelete (IN EFI_FILE_PROTOCOL *This)
 
EFI_STATUS EFIAPI FileInterfaceFileClose (IN EFI_FILE_PROTOCOL *This)
 
EFI_STATUS EFIAPI FileInterfaceFileWrite (IN EFI_FILE_PROTOCOL *This, IN OUT UINTN *BufferSize, IN VOID *Buffer)
 
EFI_FILE_PROTOCOLCreateFileInterfaceFile (IN CONST EFI_FILE_PROTOCOL *Template, IN CONST BOOLEAN Unicode)
 

Variables

EFI_FILE_PROTOCOL FileInterfaceStdIn
 
EFI_FILE_PROTOCOL FileInterfaceStdOut
 
EFI_FILE_PROTOCOL FileInterfaceStdErr
 
EFI_FILE_PROTOCOL FileInterfaceNulFile
 

Detailed Description

EFI_FILE_PROTOCOL wrappers for other items (Like Environment Variables, StdIn, StdOut, StdErr, etc...).

Copyright 2016 Dell Inc. Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
(C) Copyright 2013 Hewlett-Packard Development Company, L.P.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file FileHandleWrappers.c.

Macro Definition Documentation

◆ MEM_WRITE_REALLOC_OVERHEAD

#define MEM_WRITE_REALLOC_OVERHEAD   1024

Definition at line 15 of file FileHandleWrappers.c.

◆ SIZE_OF_EFI_FILE_PROTOCOL_ENVIRONMENT

#define SIZE_OF_EFI_FILE_PROTOCOL_ENVIRONMENT   EFI_FIELD_OFFSET (EFI_FILE_PROTOCOL_ENVIRONMENT, Name)

Definition at line 1035 of file FileHandleWrappers.c.

Function Documentation

◆ CreateFileInterfaceEnv()

EFI_FILE_PROTOCOL * CreateFileInterfaceEnv ( IN CONST CHAR16 *  EnvName)

Creates a EFI_FILE_PROTOCOL (almost) object for using to access environment variables through file operations.

Parameters
EnvNameThe name of the Environment Variable to be operated on.
Return values
NULLMemory could not be allocated.
Returns
other a pointer to an EFI_FILE_PROTOCOL structure

Definition at line 1359 of file FileHandleWrappers.c.

◆ CreateFileInterfaceFile()

EFI_FILE_PROTOCOL * CreateFileInterfaceFile ( IN CONST EFI_FILE_PROTOCOL Template,
IN CONST BOOLEAN  Unicode 
)

Create a file interface with unicode information.

This will create a new EFI_FILE_PROTOCOL identical to the Templace except that the new one has Unicode and Ascii knowledge.

Parameters
[in]TemplateA pointer to the EFI_FILE_PROTOCOL object.
[in]UnicodeTRUE for UCS-2, FALSE for ASCII.
Returns
a new EFI_FILE_PROTOCOL object to be used instead of the template.

Definition at line 2171 of file FileHandleWrappers.c.

◆ CreateFileInterfaceMem()

EFI_FILE_PROTOCOL * CreateFileInterfaceMem ( IN CONST BOOLEAN  Unicode)

Creates a EFI_FILE_PROTOCOL (almost) object for using to access a file entirely in memory through file operations.

Parameters
[in]UnicodeBoolean value with TRUE for Unicode and FALSE for Ascii.
Return values
NULLMemory could not be allocated.
Returns
other A pointer to an EFI_FILE_PROTOCOL structure.

Definition at line 1767 of file FileHandleWrappers.c.

◆ CreateTabCompletionList()

EFI_STATUS CreateTabCompletionList ( IN CONST CHAR16 *  InputString,
IN CONST UINTN  StringLen,
IN CONST UINTN  BufferSize,
IN OUT EFI_SHELL_FILE_INFO **  TabCompletionList,
IN OUT UINTN TabUpdatePos 
)

Create the TAB completion list.

Parameters
[in]InputStringThe command line to expand.
[in]StringLenLength of the command line.
[in]BufferSizeBuffer size.
[in,out]TabCompletionListReturn the TAB completion list.
[in,out]TabUpdatePosReturn the TAB update position.

Definition at line 301 of file FileHandleWrappers.c.

◆ FileInterfaceEnvClose()

EFI_STATUS EFIAPI FileInterfaceEnvClose ( IN EFI_FILE_PROTOCOL This)

File style interface for Environment Variable (Close).

Frees the memory for this object.

Parameters
[in]ThisThe pointer to the EFI_FILE_PROTOCOL object.
Return values
EFI_SUCCESS

Definition at line 1048 of file FileHandleWrappers.c.

◆ FileInterfaceEnvDelete()

EFI_STATUS EFIAPI FileInterfaceEnvDelete ( IN EFI_FILE_PROTOCOL This)

File style interface for Environment Variable (Delete).

Parameters
[in]ThisThe pointer to the EFI_FILE_PROTOCOL object.
Return values
Thereturn value from FileInterfaceEnvClose().

Definition at line 1145 of file FileHandleWrappers.c.

◆ FileInterfaceEnvNonVolWrite()

EFI_STATUS EFIAPI FileInterfaceEnvNonVolWrite ( IN EFI_FILE_PROTOCOL This,
IN OUT UINTN BufferSize,
IN VOID *  Buffer 
)

File style interface for Non Volatile Environment Variable (Write). This function also caches the environment variable into gShellEnvVarList.

Parameters
[in]ThisThe pointer to the EFI_FILE_PROTOCOL object.
[in,out]BufferSizeSize in bytes of Buffer.
[in]BufferThe pointer to the buffer to write.
Return values
EFI_SUCCESSThe data was successfully write to variable.
SHELL_OUT_OF_RESOURCESA memory allocation failed.

Definition at line 1286 of file FileHandleWrappers.c.

◆ FileInterfaceEnvRead()

EFI_STATUS EFIAPI FileInterfaceEnvRead ( IN EFI_FILE_PROTOCOL This,
IN OUT UINTN BufferSize,
OUT VOID *  Buffer 
)

File style interface for Environment Variable (Read).

Parameters
[in]ThisThe pointer to the EFI_FILE_PROTOCOL object.
[in,out]BufferSizeSize in bytes of Buffer.
[out]BufferThe pointer to the buffer to fill.
Return values
EFI_SUCCESSThe data was read.

Definition at line 1164 of file FileHandleWrappers.c.

◆ FileInterfaceEnvVolWrite()

EFI_STATUS EFIAPI FileInterfaceEnvVolWrite ( IN EFI_FILE_PROTOCOL This,
IN OUT UINTN BufferSize,
IN VOID *  Buffer 
)

File style interface for Volatile Environment Variable (Write). This function also caches the environment variable into gShellEnvVarList.

Parameters
[in]ThisThe pointer to the EFI_FILE_PROTOCOL object.
[in,out]BufferSizeSize in bytes of Buffer.
[in]BufferThe pointer to the buffer to write.
Return values
EFI_SUCCESSThe data was successfully write to variable.
SHELL_OUT_OF_RESOURCESA memory allocation failed.

Definition at line 1210 of file FileHandleWrappers.c.

◆ FileInterfaceFileClose()

EFI_STATUS EFIAPI FileInterfaceFileClose ( IN EFI_FILE_PROTOCOL This)

File style interface for File (Close).

Parameters
[in]ThisThe pointer to the EFI_FILE_PROTOCOL object.
Return values
EFI_SUCCESSThe file was closed.

Definition at line 2102 of file FileHandleWrappers.c.

◆ FileInterfaceFileDelete()

EFI_STATUS EFIAPI FileInterfaceFileDelete ( IN EFI_FILE_PROTOCOL This)

Close and delete the file handle.

Parameters
ThisProtocol instance pointer.
Return values
EFI_SUCCESSThe device was opened.
EFI_WARN_DELETE_FAILUREThe handle was closed but the file was not deleted.

Definition at line 2082 of file FileHandleWrappers.c.

◆ FileInterfaceFileFlush()

EFI_STATUS EFIAPI FileInterfaceFileFlush ( IN EFI_FILE_PROTOCOL This)

Flush data back for the file handle.

Parameters
ThisProtocol instance pointer.
Return values
EFI_SUCCESSData was written.
EFI_UNSUPPORTWrites to Open directory are not supported.
EFI_NO_MEDIAThe device has no media.
EFI_DEVICE_ERRORThe device reported an error.
EFI_VOLUME_CORRUPTEDThe file system structures are corrupted.
EFI_WRITE_PROTECTEDThe device is write protected.
EFI_ACCESS_DENIEDThe file was open for read only.
EFI_VOLUME_FULLThe volume is full.

Definition at line 1948 of file FileHandleWrappers.c.

◆ FileInterfaceFileGetInfo()

EFI_STATUS EFIAPI FileInterfaceFileGetInfo ( IN EFI_FILE_PROTOCOL This,
IN EFI_GUID InformationType,
IN OUT UINTN BufferSize,
OUT VOID *  Buffer 
)

Get information about a file.

Parameters
ThisProtocol instance pointer.
InformationTypeType of information to return in Buffer.
BufferSizeOn input size of buffer, on output amount of data in buffer.
BufferThe buffer to return data.
Return values
EFI_SUCCESSData was returned.
EFI_UNSUPPORTInformationType is not supported.
EFI_NO_MEDIAThe device has no media.
EFI_DEVICE_ERRORThe device reported an error.
EFI_VOLUME_CORRUPTEDThe file system structures are corrupted.
EFI_WRITE_PROTECTEDThe device is write protected.
EFI_ACCESS_DENIEDThe file was open for read only.
EFI_BUFFER_TOO_SMALLBuffer was too small; required size returned in BufferSize.

Definition at line 1892 of file FileHandleWrappers.c.

◆ FileInterfaceFileGetPosition()

EFI_STATUS EFIAPI FileInterfaceFileGetPosition ( IN EFI_FILE_PROTOCOL This,
OUT UINT64 *  Position 
)

Get a file's current position

Parameters
ThisProtocol instance pointer.
PositionByte position from the start of the file.
Return values
EFI_SUCCESSData was written.
EFI_UNSUPPORTEDSeek request for non-zero is not valid on open..

Definition at line 1864 of file FileHandleWrappers.c.

◆ FileInterfaceFileOpen()

EFI_STATUS EFIAPI FileInterfaceFileOpen ( IN EFI_FILE_PROTOCOL This,
OUT EFI_FILE_PROTOCOL **  NewHandle,
IN CHAR16 *  FileName,
IN UINT64  OpenMode,
IN UINT64  Attributes 
)

Opens a new file relative to the source file's location.

Parameters
[in]ThisThe protocol instance pointer.
[out]NewHandleReturns File Handle for FileName.
[in]FileNameNull terminated string. "\", ".", and ".." are supported.
[in]OpenModeOpen mode for file.
[in]AttributesOnly used for EFI_FILE_MODE_CREATE.
Return values
EFI_SUCCESSThe device was opened.
EFI_NOT_FOUNDThe specified file could not be found on the device.
EFI_NO_MEDIAThe device has no media.
EFI_MEDIA_CHANGEDThe media has changed.
EFI_DEVICE_ERRORThe device reported an error.
EFI_VOLUME_CORRUPTEDThe file system structures are corrupted.
EFI_ACCESS_DENIEDThe service denied access to the file.
EFI_OUT_OF_RESOURCESThe volume was not opened due to lack of resources.
EFI_VOLUME_FULLThe volume is full.

Definition at line 2060 of file FileHandleWrappers.c.

◆ FileInterfaceFileRead()

EFI_STATUS EFIAPI FileInterfaceFileRead ( IN EFI_FILE_PROTOCOL This,
IN OUT UINTN BufferSize,
OUT VOID *  Buffer 
)

Read data from the file.

Parameters
ThisProtocol instance pointer.
BufferSizeOn input size of buffer, on output amount of data in buffer.
BufferThe buffer in which data is read.
Return values
EFI_SUCCESSData was read.
EFI_NO_MEDIAThe device has no media.
EFI_DEVICE_ERRORThe device reported an error.
EFI_VOLUME_CORRUPTEDThe file system structures are corrupted.
EFI_BUFFER_TO_SMALLBufferSize is too small. BufferSize contains required size.

Definition at line 1971 of file FileHandleWrappers.c.

◆ FileInterfaceFileSetInfo()

EFI_STATUS EFIAPI FileInterfaceFileSetInfo ( IN EFI_FILE_PROTOCOL This,
IN EFI_GUID InformationType,
IN UINTN  BufferSize,
IN VOID *  Buffer 
)

Set information about a file

Parameters
ThisProtocol instance pointer.
InformationTypeType of information in Buffer.
BufferSizeSize of buffer.
BufferThe data to write.
Return values
EFI_SUCCESSData was returned.
EFI_UNSUPPORTInformationType is not supported.
EFI_NO_MEDIAThe device has no media.
EFI_DEVICE_ERRORThe device reported an error.
EFI_VOLUME_CORRUPTEDThe file system structures are corrupted.
EFI_WRITE_PROTECTEDThe device is write protected.
EFI_ACCESS_DENIEDThe file was open for read only.

Definition at line 1921 of file FileHandleWrappers.c.

◆ FileInterfaceFileSetPosition()

EFI_STATUS EFIAPI FileInterfaceFileSetPosition ( IN EFI_FILE_PROTOCOL This,
IN UINT64  Position 
)

Set a files current position

Parameters
ThisProtocol instance pointer.
PositionByte position from the start of the file.
Return values
EFI_SUCCESSData was written.
EFI_UNSUPPORTEDSeek request for non-zero is not valid on open.

Definition at line 1844 of file FileHandleWrappers.c.

◆ FileInterfaceFileWrite()

EFI_STATUS EFIAPI FileInterfaceFileWrite ( IN EFI_FILE_PROTOCOL This,
IN OUT UINTN BufferSize,
IN VOID *  Buffer 
)

File style interface for File (Write).

If the file was opened with ASCII mode the data will be processed through AsciiSPrint before writing.

Parameters
[in]ThisThe pointer to the EFI_FILE_PROTOCOL object.
[in,out]BufferSizeSize in bytes of Buffer.
[in]BufferThe pointer to the buffer to write.
Return values
EFI_SUCCESSThe data was written.

Definition at line 2127 of file FileHandleWrappers.c.

◆ FileInterfaceMemClose()

EFI_STATUS EFIAPI FileInterfaceMemClose ( IN EFI_FILE_PROTOCOL This)

File style interface for Mem (Close).

Frees all memory associated with this object.

Parameters
[in]ThisThe pointer to the EFI_FILE_PROTOCOL object.
Return values
EFI_SUCCESSThe 'file' was closed.

Definition at line 1748 of file FileHandleWrappers.c.

◆ FileInterfaceMemGetInfo()

EFI_STATUS EFIAPI FileInterfaceMemGetInfo ( IN EFI_FILE_PROTOCOL This,
IN EFI_GUID InformationType,
IN OUT UINTN BufferSize,
OUT VOID *  Buffer 
)

File style interface for Mem (GetInfo).

Parameters
ThisProtocol instance pointer.
InformationTypeType of information to return in Buffer.
BufferSizeOn input size of buffer, on output amount of data in buffer.
BufferThe buffer to return data.
Return values
EFI_SUCCESSData was returned.
EFI_UNSUPPORTInformationType is not supported.
EFI_NO_MEDIAThe device has no media.
EFI_DEVICE_ERRORThe device reported an error.
EFI_VOLUME_CORRUPTEDThe file system structures are corrupted.
EFI_WRITE_PROTECTEDThe device is write protected.
EFI_ACCESS_DENIEDThe file was open for read only.
EFI_BUFFER_TOO_SMALLBuffer was too small; required size returned in BufferSize.

Definition at line 1611 of file FileHandleWrappers.c.

◆ FileInterfaceMemGetPosition()

EFI_STATUS EFIAPI FileInterfaceMemGetPosition ( IN EFI_FILE_PROTOCOL This,
OUT UINT64 *  Position 
)

File style interface for Mem (GetPosition).

Parameters
[in]ThisThe pointer to the EFI_FILE_PROTOCOL object.
[out]PositionThe pointer to the position.
Return values
EFI_SUCCESSThe position was retrieved.

Definition at line 1582 of file FileHandleWrappers.c.

◆ FileInterfaceMemRead()

EFI_STATUS EFIAPI FileInterfaceMemRead ( IN EFI_FILE_PROTOCOL This,
IN OUT UINTN BufferSize,
IN VOID *  Buffer 
)

File style interface for Mem (Read).

Parameters
[in]ThisThe pointer to the EFI_FILE_PROTOCOL object.
[in,out]BufferSizeSize in bytes of Buffer.
[in]BufferThe pointer to the buffer to fill.
Return values
EFI_SUCCESSThe data was read.

Definition at line 1719 of file FileHandleWrappers.c.

◆ FileInterfaceMemSetPosition()

EFI_STATUS EFIAPI FileInterfaceMemSetPosition ( IN EFI_FILE_PROTOCOL This,
OUT UINT64  Position 
)

File style interface for Mem (SetPosition).

Parameters
[in]ThisThe pointer to the EFI_FILE_PROTOCOL object.
[out]PositionThe position to set.
Return values
EFI_SUCCESSThe position was successfully changed.
EFI_INVALID_PARAMETERThe Position was invalid.

Definition at line 1559 of file FileHandleWrappers.c.

◆ FileInterfaceMemWrite()

EFI_STATUS EFIAPI FileInterfaceMemWrite ( IN EFI_FILE_PROTOCOL This,
IN OUT UINTN BufferSize,
IN VOID *  Buffer 
)

File style interface for Mem (Write).

Parameters
[in]ThisThe pointer to the EFI_FILE_PROTOCOL object.
[in,out]BufferSizeSize in bytes of Buffer.
[in]BufferThe pointer to the buffer to write.
Return values
EFI_OUT_OF_RESOURCESThe operation failed due to lack of resources.
EFI_SUCCESSThe data was written.

Definition at line 1653 of file FileHandleWrappers.c.

◆ FileInterfaceNopGeneric()

EFI_STATUS EFIAPI FileInterfaceNopGeneric ( IN EFI_FILE_PROTOCOL This)

File style interface for console (Close, Delete, & Flush)

Parameters
[in]ThisIgnored.
Return values
EFI_SUCCESS

Definition at line 50 of file FileHandleWrappers.c.

◆ FileInterfaceNopGetInfo()

EFI_STATUS EFIAPI FileInterfaceNopGetInfo ( IN EFI_FILE_PROTOCOL This,
IN EFI_GUID InformationType,
IN OUT UINTN BufferSize,
OUT VOID *  Buffer 
)

File style interface for console (GetInfo).

Parameters
[in]ThisIgnored.
[in]InformationTypeIgnored.
[in,out]BufferSizeIgnored.
[out]BufferIgnored.
Return values
EFI_UNSUPPORTED

Definition at line 105 of file FileHandleWrappers.c.

◆ FileInterfaceNopGetPosition()

EFI_STATUS EFIAPI FileInterfaceNopGetPosition ( IN EFI_FILE_PROTOCOL This,
OUT UINT64 *  Position 
)

File style interface for console (GetPosition).

Parameters
[in]ThisIgnored.
[out]PositionIgnored.
Return values
EFI_UNSUPPORTED

Definition at line 67 of file FileHandleWrappers.c.

◆ FileInterfaceNopSetInfo()

EFI_STATUS EFIAPI FileInterfaceNopSetInfo ( IN EFI_FILE_PROTOCOL This,
IN EFI_GUID InformationType,
IN UINTN  BufferSize,
IN VOID *  Buffer 
)

File style interface for console (SetInfo).

Parameters
[in]ThisIgnored.
[in]InformationTypeIgnored.
[in]BufferSizeIgnored.
[in]BufferIgnored.
Return values
EFI_UNSUPPORTED

Definition at line 127 of file FileHandleWrappers.c.

◆ FileInterfaceNopSetPosition()

EFI_STATUS EFIAPI FileInterfaceNopSetPosition ( IN EFI_FILE_PROTOCOL This,
IN UINT64  Position 
)

File style interface for console (SetPosition).

Parameters
[in]ThisIgnored.
[in]PositionIgnored.
Return values
EFI_UNSUPPORTED

Definition at line 85 of file FileHandleWrappers.c.

◆ FileInterfaceNulRead()

EFI_STATUS EFIAPI FileInterfaceNulRead ( IN EFI_FILE_PROTOCOL This,
IN OUT UINTN BufferSize,
OUT VOID *  Buffer 
)

File style interface for NUL file (Read).

Parameters
[in]ThisIgnored.
[in,out]BufferSizePoiner to 0 upon return.
[out]BufferIgnored.
Return values
EFI_SUCCESSAlways.

Definition at line 261 of file FileHandleWrappers.c.

◆ FileInterfaceNulWrite()

EFI_STATUS EFIAPI FileInterfaceNulWrite ( IN EFI_FILE_PROTOCOL This,
IN OUT UINTN BufferSize,
IN VOID *  Buffer 
)

File style interface for NUL file (Write).

Parameters
[in]ThisIgnored.
[in,out]BufferSizeIgnored.
[in]BufferIgnored.
Return values
EFI_SUCCESS

Definition at line 282 of file FileHandleWrappers.c.

◆ FileInterfaceOpenNotFound()

EFI_STATUS EFIAPI FileInterfaceOpenNotFound ( IN EFI_FILE_PROTOCOL This,
OUT EFI_FILE_PROTOCOL **  NewHandle,
IN CHAR16 *  FileName,
IN UINT64  OpenMode,
IN UINT64  Attributes 
)

File style interface for console (Open).

Parameters
[in]ThisIgnored.
[out]NewHandleIgnored.
[in]FileNameIgnored.
[in]OpenModeIgnored.
[in]AttributesIgnored.
Return values
EFI_NOT_FOUND

Definition at line 30 of file FileHandleWrappers.c.

◆ FileInterfaceStdErrRead()

EFI_STATUS EFIAPI FileInterfaceStdErrRead ( IN EFI_FILE_PROTOCOL This,
IN OUT UINTN BufferSize,
OUT VOID *  Buffer 
)

File style interface for console StdErr (Read).

Parameters
[in]ThisIgnored.
[in,out]BufferSizeIgnored.
[out]BufferIgnored.
Return values
EFI_UNSUPPORTEDAlways.

Definition at line 241 of file FileHandleWrappers.c.

◆ FileInterfaceStdErrWrite()

EFI_STATUS EFIAPI FileInterfaceStdErrWrite ( IN EFI_FILE_PROTOCOL This,
IN OUT UINTN BufferSize,
IN VOID *  Buffer 
)

File style interface for console StdErr (Write).

Writes error to the error output.

Parameters
[in]ThisThe pointer to the EFI_FILE_PROTOCOL object.
[in,out]BufferSizeSize in bytes of Buffer.
[in]BufferThe pointer to the buffer to write.
Returns
A return value from gST->StdErr->OutputString.

Definition at line 201 of file FileHandleWrappers.c.

◆ FileInterfaceStdInRead()

EFI_STATUS EFIAPI FileInterfaceStdInRead ( IN EFI_FILE_PROTOCOL This,
IN OUT UINTN BufferSize,
OUT VOID *  Buffer 
)

File style interface for console (Read).

This will return a single line of input from the console.

Parameters
ThisA pointer to the EFI_FILE_PROTOCOL instance that is the file handle to read data from. Not used.
BufferSizeOn input, the size of the Buffer. On output, the amount of data returned in Buffer. In both cases, the size is measured in bytes.
BufferThe buffer into which the data is read.
Return values
EFI_SUCCESSThe data was read.
EFI_NO_MEDIAThe device has no medium.
EFI_DEVICE_ERRORThe device reported an error.
EFI_DEVICE_ERRORAn attempt was made to read from a deleted file.
EFI_DEVICE_ERROROn entry, the current file position is beyond the end of the file.
EFI_VOLUME_CORRUPTEDThe file system structures are corrupted.
EFI_BUFFER_TOO_SMALLThe BufferSize is too small to read the current directory entry. BufferSize has been updated with the size needed to complete the request.
EFI_OUT_OF_RESOURCESA memory allocation failed.

Definition at line 458 of file FileHandleWrappers.c.

◆ FileInterfaceStdInWrite()

EFI_STATUS EFIAPI FileInterfaceStdInWrite ( IN EFI_FILE_PROTOCOL This,
IN OUT UINTN BufferSize,
IN VOID *  Buffer 
)

File style interface for StdIn (Write).

Parameters
[in]ThisIgnored.
[in,out]BufferSizeIgnored.
[in]BufferIgnored.
Return values
EFI_UNSUPPORTED

Definition at line 179 of file FileHandleWrappers.c.

◆ FileInterfaceStdOutRead()

EFI_STATUS EFIAPI FileInterfaceStdOutRead ( IN EFI_FILE_PROTOCOL This,
IN OUT UINTN BufferSize,
OUT VOID *  Buffer 
)

File style interface for console StdOut (Read).

Parameters
[in]ThisIgnored.
[in,out]BufferSizeIgnored.
[out]BufferIgnored.
Return values
EFI_UNSUPPORTED

Definition at line 221 of file FileHandleWrappers.c.

◆ FileInterfaceStdOutWrite()

EFI_STATUS EFIAPI FileInterfaceStdOutWrite ( IN EFI_FILE_PROTOCOL This,
IN OUT UINTN BufferSize,
IN VOID *  Buffer 
)

File style interface for StdOut (Write).

Writes data to the screen.

Parameters
[in]ThisThe pointer to the EFI_FILE_PROTOCOL object.
[in,out]BufferSizeSize in bytes of Buffer.
[in]BufferThe pointer to the buffer to write.
Return values
EFI_UNSUPPORTEDNo output console is supported.
Returns
A return value from gST->ConOut->OutputString.

Definition at line 151 of file FileHandleWrappers.c.

◆ MoveCursorBackward()

VOID MoveCursorBackward ( IN UINTN  LineLength,
IN OUT UINTN Column,
IN OUT UINTN Row 
)

Move the cursor position one character backward.

Parameters
[in]LineLengthLength of a line. Get it by calling QueryMode
[in,out]ColumnCurrent column of the cursor position
[in,out]RowCurrent row of the cursor position

Definition at line 1422 of file FileHandleWrappers.c.

◆ MoveCursorForward()

VOID MoveCursorForward ( IN UINTN  LineLength,
IN UINTN  TotalRow,
IN OUT UINTN Column,
IN OUT UINTN Row 
)

Move the cursor position one character forward.

Parameters
[in]LineLengthLength of a line.
[in]TotalRowTotal row of a screen
[in,out]ColumnCurrent column of the cursor position
[in,out]RowCurrent row of the cursor position

Definition at line 1453 of file FileHandleWrappers.c.

◆ PrintCommandHistory()

VOID PrintCommandHistory ( IN CONST UINTN  TotalCols,
IN CONST UINTN  TotalRows,
IN CONST UINTN  StartColumn 
)

Prints out each previously typed command in the command list history log.

When each screen is full it will pause for a key before continuing.

Parameters
[in]TotalColsHow many columns are on the screen
[in]TotalRowsHow many rows are on the screen
[in]StartColumnwhich column to start at

Definition at line 1484 of file FileHandleWrappers.c.

Variable Documentation

◆ FileInterfaceNulFile

EFI_FILE_PROTOCOL FileInterfaceNulFile
Initial value:
= {
EFI_FILE_REVISION,
}
EFI_STATUS EFIAPI FileInterfaceOpenNotFound(IN EFI_FILE_PROTOCOL *This, OUT EFI_FILE_PROTOCOL **NewHandle, IN CHAR16 *FileName, IN UINT64 OpenMode, IN UINT64 Attributes)
EFI_STATUS EFIAPI FileInterfaceNopSetInfo(IN EFI_FILE_PROTOCOL *This, IN EFI_GUID *InformationType, IN UINTN BufferSize, IN VOID *Buffer)
EFI_STATUS EFIAPI FileInterfaceNulWrite(IN EFI_FILE_PROTOCOL *This, IN OUT UINTN *BufferSize, IN VOID *Buffer)
EFI_STATUS EFIAPI FileInterfaceNulRead(IN EFI_FILE_PROTOCOL *This, IN OUT UINTN *BufferSize, OUT VOID *Buffer)
EFI_STATUS EFIAPI FileInterfaceNopGetInfo(IN EFI_FILE_PROTOCOL *This, IN EFI_GUID *InformationType, IN OUT UINTN *BufferSize, OUT VOID *Buffer)
EFI_STATUS EFIAPI FileInterfaceNopGeneric(IN EFI_FILE_PROTOCOL *This)
EFI_STATUS EFIAPI FileInterfaceNopGetPosition(IN EFI_FILE_PROTOCOL *This, OUT UINT64 *Position)
EFI_STATUS EFIAPI FileInterfaceNopSetPosition(IN EFI_FILE_PROTOCOL *This, IN UINT64 Position)

FILE style interface for NUL file.

Definition at line 1001 of file FileHandleWrappers.c.

◆ FileInterfaceStdErr

EFI_FILE_PROTOCOL FileInterfaceStdErr
Initial value:
= {
EFI_FILE_REVISION,
}
EFI_STATUS EFIAPI FileInterfaceStdErrRead(IN EFI_FILE_PROTOCOL *This, IN OUT UINTN *BufferSize, OUT VOID *Buffer)
EFI_STATUS EFIAPI FileInterfaceStdErrWrite(IN EFI_FILE_PROTOCOL *This, IN OUT UINTN *BufferSize, IN VOID *Buffer)

FILE styte interfaces for StdErr.

Definition at line 987 of file FileHandleWrappers.c.

◆ FileInterfaceStdIn

EFI_FILE_PROTOCOL FileInterfaceStdIn
Initial value:
= {
EFI_FILE_REVISION,
}
EFI_STATUS EFIAPI FileInterfaceStdInWrite(IN EFI_FILE_PROTOCOL *This, IN OUT UINTN *BufferSize, IN VOID *Buffer)
EFI_STATUS EFIAPI FileInterfaceStdInRead(IN EFI_FILE_PROTOCOL *This, IN OUT UINTN *BufferSize, OUT VOID *Buffer)

FILE styte interfaces for StdIn.

Definition at line 959 of file FileHandleWrappers.c.

◆ FileInterfaceStdOut

EFI_FILE_PROTOCOL FileInterfaceStdOut
Initial value:
= {
EFI_FILE_REVISION,
}
EFI_STATUS EFIAPI FileInterfaceStdOutRead(IN EFI_FILE_PROTOCOL *This, IN OUT UINTN *BufferSize, OUT VOID *Buffer)
EFI_STATUS EFIAPI FileInterfaceStdOutWrite(IN EFI_FILE_PROTOCOL *This, IN OUT UINTN *BufferSize, IN VOID *Buffer)

FILE styte interfaces for StdOut.

Definition at line 973 of file FileHandleWrappers.c.