StdIn, StdOut, StdErr, etc...).\r
\r
Copyright 2016 Dell Inc.\r
- Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
(C) Copyright 2013 Hewlett-Packard Development Company, L.P.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
#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
@param[in] InputString The command line to expand.\r
@param[in] StringLen Length of the command line.\r
@param[in] BufferSize Buffer size.\r
- @param[out] TabCompletionList Return the TAB completion list.\r
- @param[out] TabUpdatePos Return the TAB update position.\r
+ @param[in, out] TabCompletionList Return the TAB completion list.\r
+ @param[in, out] TabUpdatePos Return the TAB update position.\r
**/\r
EFI_STATUS\r
-EFIAPI\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 NewSize;\r
EFI_STATUS Status;\r
BOOLEAN Volatile;\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 = NULL;\r
NewSize = 0;\r
+ TotalSize = 0;\r
\r
Status = IsVolatileEnv (((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name, &Volatile);\r
if (EFI_ERROR (Status)) {\r
\r
Status = SHELL_GET_ENVIRONMENT_VARIABLE(((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name, &NewSize, NewBuffer);\r
if (Status == EFI_BUFFER_TOO_SMALL) {\r
- NewBuffer = AllocateZeroPool(NewSize + sizeof(CHAR16));\r
+ TotalSize = NewSize + sizeof (CHAR16);\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
- if (StrSize(NewBuffer) > 6)\r
- {\r
- if ((((CHAR16*)NewBuffer)[(StrSize(NewBuffer)/2) - 2] == CHAR_LINEFEED) \r
- && (((CHAR16*)NewBuffer)[(StrSize(NewBuffer)/2) - 3] == CHAR_CARRIAGE_RETURN)) {\r
- ((CHAR16*)NewBuffer)[(StrSize(NewBuffer)/2) - 3] = CHAR_NULL; \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
+ ((CHAR16*)NewBuffer)[TotalSize / sizeof (CHAR16) - 3] = CHAR_NULL;\r
+ //\r
+ // If the NewBuffer end with \r\n\0, We will repace '\r' by '\0' and then update TotalSize.\r
+ //\r
+ TotalSize -= sizeof(CHAR16) * 2;\r
}\r
\r
if (Volatile) {\r
- Status = SHELL_SET_ENVIRONMENT_VARIABLE_V(((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name, StrSize(NewBuffer), NewBuffer);\r
+ Status = SHELL_SET_ENVIRONMENT_VARIABLE_V (\r
+ ((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name,\r
+ TotalSize - sizeof (CHAR16),\r
+ NewBuffer\r
+ );\r
+\r
+ if (!EFI_ERROR(Status)) {\r
+ Status = ShellAddEnvVarToList (\r
+ ((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name,\r
+ NewBuffer,\r
+ TotalSize,\r
+ EFI_VARIABLE_BOOTSERVICE_ACCESS\r
+ );\r
+ }\r
} else {\r
- Status = SHELL_SET_ENVIRONMENT_VARIABLE_NV(((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name, StrSize(NewBuffer), NewBuffer);\r
+ Status = SHELL_SET_ENVIRONMENT_VARIABLE_NV (\r
+ ((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name,\r
+ TotalSize - sizeof (CHAR16),\r
+ NewBuffer\r
+ );\r
+\r
+ if (!EFI_ERROR(Status)) {\r
+ Status = ShellAddEnvVarToList (\r
+ ((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name,\r
+ NewBuffer,\r
+ TotalSize,\r
+ EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS\r
+ );\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
/**\r
File style interface for Volatile Environment Variable (Write).\r
- \r
+ This function also caches the environment variable into gShellEnvVarList.\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
- @retval EFI_SUCCESS The data was read.\r
+\r
+ @retval EFI_SUCCESS The data was successfully write to variable.\r
+ @retval SHELL_OUT_OF_RESOURCES A memory allocation failed.\r
**/\r
EFI_STATUS\r
EFIAPI\r
VOID* NewBuffer;\r
UINTN NewSize;\r
EFI_STATUS Status;\r
+ UINTN TotalSize;\r
\r
NewBuffer = NULL;\r
NewSize = 0;\r
+ TotalSize = 0;\r
\r
Status = SHELL_GET_ENVIRONMENT_VARIABLE(((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name, &NewSize, NewBuffer);\r
- if (Status == EFI_BUFFER_TOO_SMALL){\r
- NewBuffer = AllocateZeroPool(NewSize + *BufferSize + sizeof(CHAR16));\r
+ if (Status == EFI_BUFFER_TOO_SMALL) {\r
+ TotalSize = NewSize + *BufferSize + sizeof (CHAR16);\r
+ } else if (Status == EFI_NOT_FOUND) {\r
+ TotalSize = *BufferSize + sizeof(CHAR16);\r
+ } else {\r
+ return Status;\r
+ }\r
+\r
+ NewBuffer = AllocateZeroPool (TotalSize);\r
+ if (NewBuffer == NULL) {\r
+ return EFI_OUT_OF_RESOURCES;\r
+ }\r
+\r
+ if (Status == EFI_BUFFER_TOO_SMALL) {\r
Status = SHELL_GET_ENVIRONMENT_VARIABLE(((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name, &NewSize, NewBuffer);\r
}\r
- if (!EFI_ERROR(Status) && NewBuffer != NULL) {\r
- while (((CHAR16*)NewBuffer)[NewSize/2] == CHAR_NULL) {\r
- //\r
- // We want to overwrite the CHAR_NULL\r
- //\r
- NewSize -= 2;\r
- }\r
- CopyMem((UINT8*)NewBuffer + NewSize + 2, Buffer, *BufferSize);\r
- Status = SHELL_SET_ENVIRONMENT_VARIABLE_V(((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name, StrSize(NewBuffer), NewBuffer);\r
- FreePool(NewBuffer);\r
- return (Status);\r
- } else {\r
- SHELL_FREE_NON_NULL(NewBuffer);\r
- return (SHELL_SET_ENVIRONMENT_VARIABLE_V(((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name, *BufferSize, Buffer));\r
+\r
+ if (EFI_ERROR (Status) && Status != EFI_NOT_FOUND) {\r
+ FreePool (NewBuffer);\r
+ return Status;\r
+ }\r
+\r
+ CopyMem ((UINT8*)NewBuffer + NewSize, Buffer, *BufferSize);\r
+ Status = ShellAddEnvVarToList (\r
+ ((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name,\r
+ NewBuffer,\r
+ TotalSize,\r
+ EFI_VARIABLE_BOOTSERVICE_ACCESS\r
+ );\r
+ if (EFI_ERROR(Status)) {\r
+ FreePool (NewBuffer);\r
+ return Status;\r
+ }\r
+\r
+ Status = SHELL_SET_ENVIRONMENT_VARIABLE_V (\r
+ ((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name,\r
+ TotalSize - sizeof (CHAR16),\r
+ NewBuffer\r
+ );\r
+ if (EFI_ERROR(Status)) {\r
+ ShellRemvoeEnvVarFromList (((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name);\r
}\r
+\r
+ FreePool (NewBuffer);\r
+ return Status;\r
}\r
\r
\r
/**\r
File style interface for Non Volatile Environment Variable (Write).\r
- \r
+ This function also caches the environment variable into gShellEnvVarList.\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
- @retval EFI_SUCCESS The data was read.\r
+\r
+ @retval EFI_SUCCESS The data was successfully write to variable.\r
+ @retval SHELL_OUT_OF_RESOURCES A memory allocation failed.\r
**/\r
EFI_STATUS\r
EFIAPI\r
VOID* NewBuffer;\r
UINTN NewSize;\r
EFI_STATUS Status;\r
+ UINTN TotalSize;\r
\r
NewBuffer = NULL;\r
NewSize = 0;\r
+ TotalSize = 0;\r
\r
Status = SHELL_GET_ENVIRONMENT_VARIABLE(((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name, &NewSize, NewBuffer);\r
- if (Status == EFI_BUFFER_TOO_SMALL){\r
- NewBuffer = AllocateZeroPool(NewSize + *BufferSize);\r
+ if (Status == EFI_BUFFER_TOO_SMALL) {\r
+ TotalSize = NewSize + *BufferSize + sizeof (CHAR16);\r
+ } else if (Status == EFI_NOT_FOUND) {\r
+ TotalSize = *BufferSize + sizeof (CHAR16);\r
+ } else {\r
+ return Status;\r
+ }\r
+\r
+ NewBuffer = AllocateZeroPool (TotalSize);\r
+ if (NewBuffer == NULL) {\r
+ return EFI_OUT_OF_RESOURCES;\r
+ }\r
+\r
+ if (Status == EFI_BUFFER_TOO_SMALL) {\r
Status = SHELL_GET_ENVIRONMENT_VARIABLE(((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name, &NewSize, NewBuffer);\r
}\r
- if (!EFI_ERROR(Status)) {\r
- CopyMem((UINT8*)NewBuffer + NewSize, Buffer, *BufferSize);\r
- return (SHELL_SET_ENVIRONMENT_VARIABLE_NV(\r
- ((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name,\r
- NewSize + *BufferSize,\r
- NewBuffer));\r
- } else {\r
- return (SHELL_SET_ENVIRONMENT_VARIABLE_NV(\r
- ((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name,\r
- *BufferSize,\r
- Buffer));\r
+\r
+ if (EFI_ERROR(Status) && Status != EFI_NOT_FOUND) {\r
+ FreePool (NewBuffer);\r
+ return Status;\r
+ }\r
+\r
+ CopyMem ((UINT8*) NewBuffer + NewSize, Buffer, *BufferSize);\r
+ Status = ShellAddEnvVarToList (\r
+ ((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name,\r
+ NewBuffer,\r
+ TotalSize,\r
+ EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ FreePool (NewBuffer);\r
+ return Status;\r
}\r
+\r
+ Status = SHELL_SET_ENVIRONMENT_VARIABLE_NV (\r
+ ((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name,\r
+ TotalSize - sizeof (CHAR16),\r
+ NewBuffer\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ ShellRemvoeEnvVarFromList (((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name);\r
+ }\r
+\r
+ FreePool (NewBuffer);\r
+ return Status;\r
}\r
\r
/**\r
@return other a pointer to an EFI_FILE_PROTOCOL structure\r
**/\r
EFI_FILE_PROTOCOL*\r
-EFIAPI\r
CreateFileInterfaceEnv(\r
IN CONST CHAR16 *EnvName\r
)\r
EnvFileInterface->Flush = FileInterfaceNopGeneric;\r
EnvFileInterface->Delete = FileInterfaceEnvDelete;\r
EnvFileInterface->Read = FileInterfaceEnvRead;\r
- \r
+\r
CopyMem(EnvFileInterface->Name, EnvName, EnvNameSize);\r
\r
//\r
@param[in, out] Row Current row of the cursor position\r
**/\r
VOID\r
-EFIAPI\r
MoveCursorBackward (\r
IN UINTN LineLength,\r
IN OUT UINTN *Column,\r
@param[in, out] Row Current row of the cursor position\r
**/\r
VOID\r
-EFIAPI\r
MoveCursorForward (\r
IN UINTN LineLength,\r
IN UINTN TotalRow,\r
@param[in] StartColumn which column to start at\r
**/\r
VOID\r
-EFIAPI\r
PrintCommandHistory (\r
IN CONST UINTN TotalCols,\r
IN CONST UINTN TotalRows,\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
return (EFI_SUCCESS);\r
}\r
\r
+/**\r
+ File style interface for Mem (GetInfo).\r
+\r
+ @param This Protocol instance pointer.\r
+ @param InformationType Type of information to return in Buffer.\r
+ @param BufferSize On input size of buffer, on output amount of data in buffer.\r
+ @param Buffer The buffer to return data.\r
+\r
+ @retval EFI_SUCCESS Data was returned.\r
+ @retval EFI_UNSUPPORT InformationType is not supported.\r
+ @retval EFI_NO_MEDIA The device has no media.\r
+ @retval EFI_DEVICE_ERROR The device reported an error.\r
+ @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.\r
+ @retval EFI_WRITE_PROTECTED The device is write protected.\r
+ @retval EFI_ACCESS_DENIED The file was open for read only.\r
+ @retval EFI_BUFFER_TOO_SMALL Buffer was too small; required size returned in BufferSize.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+FileInterfaceMemGetInfo(\r
+ IN EFI_FILE_PROTOCOL *This,\r
+ IN EFI_GUID *InformationType,\r
+ IN OUT UINTN *BufferSize,\r
+ OUT VOID *Buffer\r
+ )\r
+{\r
+ EFI_FILE_INFO *FileInfo;\r
+\r
+ if (CompareGuid (InformationType, &gEfiFileInfoGuid)) {\r
+ if (*BufferSize < sizeof (EFI_FILE_INFO)) {\r
+ *BufferSize = sizeof (EFI_FILE_INFO);\r
+ return EFI_BUFFER_TOO_SMALL;\r
+ }\r
+ if (Buffer == NULL) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+ FileInfo = (EFI_FILE_INFO *)Buffer;\r
+ FileInfo->Size = sizeof (*FileInfo);\r
+ ZeroMem (FileInfo, sizeof (*FileInfo));\r
+ FileInfo->FileSize = ((EFI_FILE_PROTOCOL_MEM*)This)->FileSize;\r
+ FileInfo->PhysicalSize = FileInfo->FileSize;\r
+ return EFI_SUCCESS;\r
+ }\r
+\r
+ return EFI_UNSUPPORTED;\r
+}\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
@return other A pointer to an EFI_FILE_PROTOCOL structure.\r
**/\r
EFI_FILE_PROTOCOL*\r
-EFIAPI\r
CreateFileInterfaceMem(\r
IN CONST BOOLEAN Unicode\r
)\r
FileInterface->Close = FileInterfaceMemClose;\r
FileInterface->GetPosition = FileInterfaceMemGetPosition;\r
FileInterface->SetPosition = FileInterfaceMemSetPosition;\r
- FileInterface->GetInfo = FileInterfaceNopGetInfo;\r
+ FileInterface->GetInfo = FileInterfaceMemGetInfo;\r
FileInterface->SetInfo = FileInterfaceNopSetInfo;\r
FileInterface->Flush = FileInterfaceNopGeneric;\r
FileInterface->Delete = FileInterfaceNopGeneric;\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