/** @file\r
Provides interface to EFI_FILE_HANDLE functionality.\r
\r
- Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved. <BR>\r
+ Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved. <BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
\r
@param[in] FileInfo The information to set.\r
\r
- @retval EFI_SUCCESS The information was set.\r
+ @retval EFI_SUCCESS The information was set.\r
@retval EFI_INVALID_PARAMETER A parameter was out of range or invalid.\r
@retval EFI_UNSUPPORTED The FileHandle does not support FileInfo.\r
- @retval EFI_NO_MEDIA The device has no medium.\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 file or medium is write protected.\r
+ @retval EFI_NO_MEDIA The device has no medium.\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 file or medium is write protected.\r
@retval EFI_ACCESS_DENIED The file was opened read only.\r
@retval EFI_VOLUME_FULL The volume is full.\r
**/\r
EFI_STATUS\r
EFIAPI\r
FileHandleSetInfo (\r
- IN EFI_FILE_HANDLE FileHandle,\r
+ IN EFI_FILE_HANDLE FileHandle,\r
IN CONST EFI_FILE_INFO *FileInfo\r
)\r
{\r
the number of bytes written.\r
@param Buffer the buffer containing data to write is stored.\r
\r
- @retval EFI_SUCCESS Data was written.\r
- @retval EFI_UNSUPPORTED Writes to an open directory are 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_VOLUME_FULL The volume is full.\r
+ @retval EFI_SUCCESS Data was written.\r
+ @retval EFI_UNSUPPORTED Writes to an open directory are 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_VOLUME_FULL The volume is full.\r
**/\r
EFI_STATUS\r
EFIAPI\r
@retval EFI_SUCCESS the file was closed sucessfully\r
@retval EFI_WARN_DELETE_FAILURE the handle was closed, but the file was not\r
deleted\r
- @retval INVALID_PARAMETER One of the parameters has an invalid value.\r
+ @retval INVALID_PARAMETER One of the parameters has an invalid value.\r
**/\r
EFI_STATUS\r
EFIAPI\r
FileHandleDelete (\r
- IN EFI_FILE_HANDLE FileHandle\r
+ IN EFI_FILE_HANDLE FileHandle\r
)\r
{\r
EFI_STATUS Status;\r
EFI_STATUS\r
EFIAPI\r
FileHandleSetPosition (\r
- IN EFI_FILE_HANDLE FileHandle,\r
- IN UINT64 Position\r
+ IN EFI_FILE_HANDLE FileHandle,\r
+ IN UINT64 Position\r
)\r
{\r
//\r
return (EFI_SUCCESS);\r
}\r
\r
-/**\r
- Retrieves the first file from a directory\r
+/** Retrieve first entry from a directory.\r
\r
- This function opens a directory and gets the first file's info in the\r
- directory. Caller can use FileHandleFindNextFile() to get other files. When\r
- complete the caller is responsible for calling FreePool() on Buffer.\r
+ This function takes an open directory handle and gets information from the\r
+ first entry in the directory. A buffer is allocated to contain\r
+ the information and a pointer to the buffer is returned in *Buffer. The\r
+ caller can use FileHandleFindNextFile() to get subsequent directory entries.\r
\r
- @param DirHandle The file handle of the directory to search\r
- @param Buffer Pointer to buffer for file's information\r
+ The buffer will be freed by FileHandleFindNextFile() when the last directory\r
+ entry is read. Otherwise, the caller must free the buffer, using FreePool,\r
+ when finished with it.\r
+\r
+ @param[in] DirHandle The file handle of the directory to search.\r
+ @param[out] Buffer The pointer to pointer to buffer for file's information.\r
\r
@retval EFI_SUCCESS Found the first file.\r
@retval EFI_NOT_FOUND Cannot find the directory.\r
}\r
return (EFI_SUCCESS);\r
}\r
-/**\r
- Retrieves the next file in a directory.\r
\r
- To use this function, caller must call the FileHandleFindFirstFile() to get the\r
- first file, and then use this function get other files. This function can be\r
- called for several times to get each file's information in the directory. If\r
- the call of FileHandleFindNextFile() got the last file in the directory, the next\r
- call of this function has no file to get. *NoFile will be set to TRUE and the\r
- Buffer memory will be automatically freed.\r
+/** Retrieve next entries from a directory.\r
+\r
+ To use this function, the caller must first call the FileHandleFindFirstFile()\r
+ function to get the first directory entry. Subsequent directory entries are\r
+ retrieved by using the FileHandleFindNextFile() function. This function can\r
+ be called several times to get each entry from the directory. If the call of\r
+ FileHandleFindNextFile() retrieved the last directory entry, the next call of\r
+ this function will set *NoFile to TRUE and free the buffer.\r
\r
- @param DirHandle the file handle of the directory\r
- @param Buffer pointer to buffer for file's information\r
- @param NoFile pointer to boolean when last file is found\r
+ @param[in] DirHandle The file handle of the directory.\r
+ @param[out] Buffer The pointer to buffer for file's information.\r
+ @param[out] NoFile The pointer to boolean when last file is found.\r
\r
@retval EFI_SUCCESS Found the next file, or reached last file\r
@retval EFI_NO_MEDIA The device has no media.\r
EFI_STATUS\r
EFIAPI\r
FileHandleFindNextFile(\r
- IN EFI_FILE_HANDLE DirHandle,\r
- OUT EFI_FILE_INFO *Buffer,\r
- OUT BOOLEAN *NoFile\r
+ IN EFI_FILE_HANDLE DirHandle,\r
+ OUT EFI_FILE_INFO *Buffer,\r
+ OUT BOOLEAN *NoFile\r
)\r
{\r
EFI_STATUS Status;\r
CHAR16 *Buffer;\r
EFI_STATUS Status;\r
\r
- VA_START (Marker, Format);\r
-\r
//\r
// Get a buffer to print into\r
//\r
//\r
// Print into our buffer\r
//\r
+ VA_START (Marker, Format);\r
UnicodeVSPrint (Buffer, PcdGet16 (PcdShellPrintBufferSize), Format, Marker);\r
+ VA_END (Marker);\r
\r
//\r
// Print buffer into file\r