#define MEM_WRITE_REALLOC_OVERHEAD 1024\r
\r
/**\r
- File style interface for console (Open). \r
- \r
+ File style interface for console (Open).\r
+\r
@param[in] This Ignored.\r
@param[out] NewHandle Ignored.\r
@param[in] FileName Ignored.\r
@param[in] OpenMode Ignored.\r
@param[in] Attributes Ignored.\r
- \r
+\r
@retval EFI_NOT_FOUND\r
**/\r
EFI_STATUS\r
\r
/**\r
File style interface for console (Close, Delete, & Flush)\r
- \r
+\r
@param[in] This Ignored.\r
- \r
+\r
@retval EFI_SUCCESS\r
**/\r
EFI_STATUS\r
\r
@param[in] This Ignored.\r
@param[out] Position Ignored.\r
- \r
+\r
@retval EFI_UNSUPPORTED\r
**/\r
EFI_STATUS\r
\r
/**\r
File style interface for console (SetPosition).\r
- \r
+\r
@param[in] This Ignored.\r
@param[in] Position Ignored.\r
- \r
+\r
@retval EFI_UNSUPPORTED\r
**/\r
EFI_STATUS\r
\r
/**\r
File style interface for console (GetInfo).\r
- \r
+\r
@param[in] This Ignored.\r
@param[in] InformationType Ignored.\r
@param[in, out] BufferSize Ignored.\r
@param[out] Buffer Ignored.\r
- \r
+\r
@retval EFI_UNSUPPORTED\r
**/\r
EFI_STATUS\r
\r
/**\r
File style interface for console (SetInfo).\r
- \r
+\r
@param[in] This Ignored.\r
@param[in] InformationType Ignored.\r
@param[in] BufferSize Ignored.\r
@param[in] Buffer Ignored.\r
- \r
+\r
@retval EFI_UNSUPPORTED\r
**/\r
EFI_STATUS\r
File style interface for StdOut (Write).\r
\r
Writes data to the screen.\r
- \r
+\r
@param[in] This The pointer to the EFI_FILE_PROTOCOL object.\r
@param[in, out] BufferSize Size in bytes of Buffer.\r
@param[in] Buffer The pointer to the buffer to write.\r
- \r
+\r
@retval EFI_UNSUPPORTED No output console is supported.\r
@return A return value from gST->ConOut->OutputString.\r
**/\r
\r
/**\r
File style interface for StdIn (Write).\r
- \r
+\r
@param[in] This Ignored.\r
@param[in, out] BufferSize Ignored.\r
@param[in] Buffer Ignored.\r
- \r
+\r
@retval EFI_UNSUPPORTED\r
**/\r
EFI_STATUS\r
File style interface for console StdErr (Write).\r
\r
Writes error to the error output.\r
- \r
+\r
@param[in] This The pointer to the EFI_FILE_PROTOCOL object.\r
@param[in, out] BufferSize Size in bytes of Buffer.\r
@param[in] Buffer The pointer to the buffer to write.\r
- \r
+\r
@return A return value from gST->StdErr->OutputString.\r
**/\r
EFI_STATUS\r
\r
/**\r
File style interface for console StdOut (Read).\r
- \r
+\r
@param[in] This Ignored.\r
@param[in, out] BufferSize Ignored.\r
@param[out] Buffer Ignored.\r
- \r
+\r
@retval EFI_UNSUPPORTED\r
**/\r
EFI_STATUS\r
\r
/**\r
File style interface for console StdErr (Read).\r
- \r
+\r
@param[in] This Ignored.\r
@param[in, out] BufferSize Ignored.\r
@param[out] Buffer Ignored.\r
- \r
+\r
@retval EFI_UNSUPPORTED Always.\r
**/\r
EFI_STATUS\r
\r
/**\r
File style interface for NUL file (Read).\r
- \r
+\r
@param[in] This Ignored.\r
@param[in, out] BufferSize Poiner to 0 upon return.\r
@param[out] Buffer Ignored.\r
- \r
+\r
@retval EFI_SUCCESS Always.\r
**/\r
EFI_STATUS\r
\r
/**\r
File style interface for NUL file (Write).\r
- \r
+\r
@param[in] This Ignored.\r
@param[in, out] BufferSize Ignored.\r
@param[in] Buffer Ignored.\r
- \r
+\r
@retval EFI_SUCCESS\r
**/\r
EFI_STATUS\r
EFI_STATUS\r
CreateTabCompletionList (\r
IN CONST CHAR16 *InputString,\r
- IN CONST UINTN StringLen, \r
+ IN CONST UINTN StringLen,\r
IN CONST UINTN BufferSize,\r
IN OUT EFI_SHELL_FILE_INFO **TabCompletionList,\r
IN OUT UINTN *TabUpdatePos\r
File style interface for Environment Variable (Close).\r
\r
Frees the memory for this object.\r
- \r
+\r
@param[in] This The pointer to the EFI_FILE_PROTOCOL object.\r
- \r
+\r
@retval EFI_SUCCESS\r
**/\r
EFI_STATUS\r
UINTN TotalSize;\r
\r
//\r
- // Most if not all UEFI commands will have an '\r\n' at the end of any output. \r
- // Since the output was redirected to a variable, it does not make sense to \r
+ // Most if not all UEFI commands will have an '\r\n' at the end of any output.\r
+ // Since the output was redirected to a variable, it does not make sense to\r
// keep this. So, before closing, strip the trailing '\r\n' from the variable\r
// if it exists.\r
//\r
NewBuffer = AllocateZeroPool (TotalSize);\r
if (NewBuffer == NULL) {\r
return EFI_OUT_OF_RESOURCES;\r
- } \r
+ }\r
Status = SHELL_GET_ENVIRONMENT_VARIABLE(((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name, &NewSize, NewBuffer);\r
}\r
- \r
+\r
if (!EFI_ERROR(Status) && NewBuffer != NULL) {\r
- \r
+\r
if (TotalSize / sizeof (CHAR16) >= 3) {\r
if ( (((CHAR16*)NewBuffer)[TotalSize / sizeof (CHAR16) - 2] == CHAR_LINEFEED) &&\r
(((CHAR16*)NewBuffer)[TotalSize / sizeof (CHAR16) - 3] == CHAR_CARRIAGE_RETURN)\r
}\r
}\r
}\r
- } \r
- \r
+ }\r
+\r
SHELL_FREE_NON_NULL(NewBuffer);\r
FreePool((EFI_FILE_PROTOCOL_ENVIRONMENT*)This);\r
return (Status);\r
\r
/**\r
File style interface for Environment Variable (Delete).\r
- \r
+\r
@param[in] This The pointer to the EFI_FILE_PROTOCOL object.\r
- \r
+\r
@retval The return value from FileInterfaceEnvClose().\r
**/\r
EFI_STATUS\r
\r
/**\r
File style interface for Environment Variable (Read).\r
- \r
+\r
@param[in] This The pointer to the EFI_FILE_PROTOCOL object.\r
@param[in, out] BufferSize Size in bytes of Buffer.\r
@param[out] Buffer The pointer to the buffer to fill.\r
- \r
+\r
@retval EFI_SUCCESS The data was read.\r
**/\r
EFI_STATUS\r
/**\r
File style interface for Volatile Environment Variable (Write).\r
This function also caches the environment variable into gShellEnvVarList.\r
- \r
+\r
@param[in] This The pointer to the EFI_FILE_PROTOCOL object.\r
@param[in, out] BufferSize Size in bytes of Buffer.\r
@param[in] Buffer The pointer to the buffer to write.\r
- \r
+\r
@retval EFI_SUCCESS The data was successfully write to variable.\r
@retval SHELL_OUT_OF_RESOURCES A memory allocation failed.\r
**/\r
/**\r
File style interface for Non Volatile Environment Variable (Write).\r
This function also caches the environment variable into gShellEnvVarList.\r
- \r
+\r
@param[in] This The pointer to the EFI_FILE_PROTOCOL object.\r
@param[in, out] BufferSize Size in bytes of Buffer.\r
@param[in] Buffer The pointer to the buffer to write.\r
- \r
+\r
@retval EFI_SUCCESS The data was successfully write to variable.\r
@retval SHELL_OUT_OF_RESOURCES A memory allocation failed.\r
**/\r
EnvFileInterface->Flush = FileInterfaceNopGeneric;\r
EnvFileInterface->Delete = FileInterfaceEnvDelete;\r
EnvFileInterface->Read = FileInterfaceEnvRead;\r
- \r
+\r
CopyMem(EnvFileInterface->Name, EnvName, EnvNameSize);\r
\r
//\r
\r
/**\r
File style interface for Mem (SetPosition).\r
- \r
+\r
@param[in] This The pointer to the EFI_FILE_PROTOCOL object.\r
@param[out] Position The position to set.\r
- \r
+\r
@retval EFI_SUCCESS The position was successfully changed.\r
@retval EFI_INVALID_PARAMETER The Position was invalid.\r
**/\r
\r
/**\r
File style interface for Mem (GetPosition).\r
- \r
+\r
@param[in] This The pointer to the EFI_FILE_PROTOCOL object.\r
@param[out] Position The pointer to the position.\r
- \r
+\r
@retval EFI_SUCCESS The position was retrieved.\r
-**/ \r
+**/\r
EFI_STATUS\r
EFIAPI\r
FileInterfaceMemGetPosition(\r
\r
/**\r
File style interface for Mem (Write).\r
- \r
+\r
@param[in] This The pointer to the EFI_FILE_PROTOCOL object.\r
@param[in, out] BufferSize Size in bytes of Buffer.\r
@param[in] Buffer The pointer to the buffer to write.\r
- \r
+\r
@retval EFI_OUT_OF_RESOURCES The operation failed due to lack of resources.\r
@retval EFI_SUCCESS The data was written.\r
**/\r
\r
/**\r
File style interface for Mem (Read).\r
- \r
+\r
@param[in] This The pointer to the EFI_FILE_PROTOCOL object.\r
@param[in, out] BufferSize Size in bytes of Buffer.\r
@param[in] Buffer The pointer to the buffer to fill.\r
- \r
+\r
@retval EFI_SUCCESS The data was read.\r
**/\r
EFI_STATUS\r
File style interface for Mem (Close).\r
\r
Frees all memory associated with this object.\r
- \r
+\r
@param[in] This The pointer to the EFI_FILE_PROTOCOL object.\r
- \r
+\r
@retval EFI_SUCCESS The 'file' was closed.\r
-**/ \r
+**/\r
EFI_STATUS\r
EFIAPI\r
FileInterfaceMemClose(\r
\r
@param This Protocol instance pointer.\r
@param Position Byte position from the start of the file.\r
- \r
+\r
@retval EFI_SUCCESS Data was written.\r
@retval EFI_UNSUPPORTED Seek request for non-zero is not valid on open.\r
\r
\r
@param This Protocol instance pointer.\r
@param Position Byte position from the start of the file.\r
- \r
+\r
@retval EFI_SUCCESS Data was written.\r
@retval EFI_UNSUPPORTED Seek request for non-zero is not valid on open..\r
\r
Close and delete the file handle.\r
\r
@param This Protocol instance pointer.\r
- \r
+\r
@retval EFI_SUCCESS The device was opened.\r
@retval EFI_WARN_DELETE_FAILURE The handle was closed but the file was not deleted.\r
\r
\r
/**\r
File style interface for File (Close).\r
- \r
+\r
@param[in] This The pointer to the EFI_FILE_PROTOCOL object.\r
- \r
+\r
@retval EFI_SUCCESS The file was closed.\r
**/\r
EFI_STATUS\r
/**\r
File style interface for File (Write).\r
\r
- If the file was opened with ASCII mode the data will be processed through \r
+ If the file was opened with ASCII mode the data will be processed through\r
AsciiSPrint before writing.\r
- \r
+\r
@param[in] This The pointer to the EFI_FILE_PROTOCOL object.\r
@param[in, out] BufferSize Size in bytes of Buffer.\r
@param[in] Buffer The pointer to the buffer to write.\r
- \r
+\r
@retval EFI_SUCCESS The data was written.\r
**/\r
EFI_STATUS\r
\r
This will create a new EFI_FILE_PROTOCOL identical to the Templace\r
except that the new one has Unicode and Ascii knowledge.\r
- \r
+\r
@param[in] Template A pointer to the EFI_FILE_PROTOCOL object.\r
@param[in] Unicode TRUE for UCS-2, FALSE for ASCII.\r
- \r
+\r
@return a new EFI_FILE_PROTOCOL object to be used instead of the template.\r
**/\r
EFI_FILE_PROTOCOL*\r