\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[out] Buffer The buffer to put read data into.\r
\r
- @retval EFI_SUCCESS Data was read.\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_BUFFER_TO_SMALL Buffer is too small. ReadSize contains required\r
+ @retval EFI_SUCCESS Data was read.\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_BUFFER_TO_SMALL Buffer is too small. ReadSize contains required\r
size.\r
\r
**/\r
the number of bytes written.\r
@param[in] Buffer The buffer containing data to write is stored.\r
\r
- @retval EFI_SUCCESS Data was written.\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 opened for read only.\r
- @retval EFI_VOLUME_FULL The volume is full.\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 opened 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 successfully.\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
/**\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
IN EFI_FILE_HANDLE DirHandle\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 information in the\r
- directory. The caller the uses 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[in] DirHandle The file handle of the directory to search.\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
IN EFI_FILE_HANDLE DirHandle,\r
OUT EFI_FILE_INFO **Buffer\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[in] DirHandle The file handle of the directory.\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
\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
ShellSetFileInfo (\r
- IN SHELL_FILE_HANDLE FileHandle,\r
+ IN SHELL_FILE_HANDLE FileHandle,\r
IN EFI_FILE_INFO *FileInfo\r
);\r
\r
@param[in] OpenMode The mode to open the file with.\r
@param[in] Attributes The file's file attributes.\r
\r
- @retval EFI_SUCCESS The information was set.\r
- @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r
+ @retval EFI_SUCCESS The information was set.\r
+ @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r
@retval EFI_UNSUPPORTED Could not open the file path.\r
- @retval EFI_NOT_FOUND The specified file could not be found on the\r
+ @retval EFI_NOT_FOUND The specified file could not be found on the\r
device or the file system could not be found on\r
the device.\r
@retval EFI_NO_MEDIA The device has no medium.\r
@retval EFI_MEDIA_CHANGED The device has a different medium in it or the\r
medium is no longer supported.\r
@retval EFI_DEVICE_ERROR The device reported an error.\r
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.\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_OUT_OF_RESOURCES Not enough resources were available to open the\r
+ @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the\r
file.\r
@retval EFI_VOLUME_FULL The volume is full.\r
**/\r
EFI_STATUS\r
EFIAPI\r
ShellOpenFileByDevicePath(\r
- IN OUT EFI_DEVICE_PATH_PROTOCOL **FilePath,\r
- OUT EFI_HANDLE *DeviceHandle,\r
- OUT SHELL_FILE_HANDLE *FileHandle,\r
- IN UINT64 OpenMode,\r
- IN UINT64 Attributes\r
+ IN OUT EFI_DEVICE_PATH_PROTOCOL **FilePath,\r
+ OUT EFI_HANDLE *DeviceHandle,\r
+ OUT SHELL_FILE_HANDLE *FileHandle,\r
+ IN UINT64 OpenMode,\r
+ IN UINT64 Attributes\r
);\r
\r
/**\r
@param[in] OpenMode The mode to open the file with.\r
@param[in] Attributes The file's file attributes.\r
\r
- @retval EFI_SUCCESS The information was set.\r
- @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r
+ @retval EFI_SUCCESS The information was set.\r
+ @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r
@retval EFI_UNSUPPORTED Could not open the file path.\r
- @retval EFI_NOT_FOUND The specified file could not be found on the\r
+ @retval EFI_NOT_FOUND The specified file could not be found on the\r
device or the file system could not be found\r
on the device.\r
@retval EFI_NO_MEDIA The device has no medium.\r
@retval EFI_MEDIA_CHANGED The device has a different medium in it or the\r
medium is no longer supported.\r
@retval EFI_DEVICE_ERROR The device reported an error.\r
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.\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_OUT_OF_RESOURCES Not enough resources were available to open the\r
+ @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the\r
file.\r
@retval EFI_VOLUME_FULL The volume is full.\r
**/\r
EFI_STATUS\r
EFIAPI\r
ShellOpenFileByName(\r
- IN CONST CHAR16 *FilePath,\r
+ IN CONST CHAR16 *FilePath,\r
OUT SHELL_FILE_HANDLE *FileHandle,\r
IN UINT64 OpenMode,\r
- IN UINT64 Attributes\r
+ IN UINT64 Attributes\r
);\r
\r
/**\r
@param[in] DirectoryName The pointer to Directory name.\r
@param[out] FileHandle The pointer to the file handle.\r
\r
- @retval EFI_SUCCESS The information was set.\r
- @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r
+ @retval EFI_SUCCESS The information was set.\r
+ @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r
@retval EFI_UNSUPPORTED Could not open the file path.\r
- @retval EFI_NOT_FOUND The specified file could not be found on the\r
+ @retval EFI_NOT_FOUND The specified file could not be found on the\r
device, or the file system could not be found\r
on the device.\r
@retval EFI_NO_MEDIA The device has no medium.\r
@retval EFI_MEDIA_CHANGED The device has a different medium in it or the\r
medium is no longer supported.\r
@retval EFI_DEVICE_ERROR The device reported an error.\r
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.\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_OUT_OF_RESOURCES Not enough resources were available to open the\r
+ @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the\r
file.\r
@retval EFI_VOLUME_FULL The volume is full.\r
**/\r
@param[out] Buffer The buffer to put read data into.\r
\r
@retval EFI_SUCCESS Data was read.\r
- @retval EFI_NO_MEDIA The device has no media.\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_VOLUME_CORRUPTED The file system structures are corrupted.\r
@retval EFI_BUFFER_TO_SMALL Buffer is too small. ReadSize contains required\r
size.\r
\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_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_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
EFI_STATUS\r
EFIAPI\r
ShellSetFilePosition (\r
- IN SHELL_FILE_HANDLE FileHandle,\r
- IN UINT64 Position\r
+ IN SHELL_FILE_HANDLE FileHandle,\r
+ IN UINT64 Position\r
);\r
\r
/**\r
IN SHELL_FILE_HANDLE FileHandle\r
);\r
\r
-/**\r
- Retrieves the first file from a directory\r
+/** Retrieve first entry from a directory.\r
\r
- This function takes an open directory handle and gets the first file\r
- in the directory's info. Caller can use ShellFindNextFile() to get\r
- subsequent files.\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 ShellFindNextFile() to get subsequent directory entries.\r
\r
- Caller must use FreePool on *Buffer opon completion of all file searching.\r
+ The buffer will be freed by ShellFindNextFile() 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[in] DirHandle The file handle of the directory to search.\r
@param[out] Buffer The pointer to the buffer for the file's information.\r
\r
@retval EFI_SUCCESS Found the first file.\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
+ @return Others Status of ShellGetFileInfo, ShellSetFilePosition,\r
+ or ShellReadFile.\r
+\r
@sa ShellReadFile\r
**/\r
EFI_STATUS\r
EFIAPI\r
ShellFindFirstFile (\r
- IN SHELL_FILE_HANDLE DirHandle,\r
- OUT EFI_FILE_INFO **Buffer\r
+ IN SHELL_FILE_HANDLE DirHandle,\r
+ OUT EFI_FILE_INFO **Buffer\r
);\r
\r
-/**\r
- Retrieves the next file in a directory.\r
+/** Retrieve next entries from a directory.\r
\r
- To use this function, caller must call the ShellFindFirstFile() 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 ShellFindNextFile() 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
- data in Buffer is meaningless.\r
+ To use this function, the caller must first call the ShellFindFirstFile()\r
+ function to get the first directory entry. Subsequent directory entries are\r
+ retrieved by using the ShellFindNextFile() function. This function can\r
+ be called several times to get each entry from the directory. If the call of\r
+ ShellFindNextFile() retrieved the last directory entry, the next call of\r
+ this function will set *NoFile to TRUE and free the buffer.\r
\r
- @param[in] DirHandle The file handle of the directory.\r
- @param[in, out] Buffer The pointer to buffer for file's information.\r
- @param[in, out] NoFile The 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.\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
+\r
@sa ShellReadFile\r
**/\r
EFI_STATUS\r
EFIAPI\r
ShellFindNextFile(\r
- IN SHELL_FILE_HANDLE DirHandle,\r
- IN OUT EFI_FILE_INFO *Buffer,\r
- IN OUT BOOLEAN *NoFile\r
+ IN SHELL_FILE_HANDLE DirHandle,\r
+ IN OUT EFI_FILE_INFO *Buffer,\r
+ IN OUT BOOLEAN *NoFile\r
);\r
\r
/**\r
Function to determine whether a string is decimal or hex representation of a number\r
and return the number converted from the string.\r
\r
- Note: this function cannot be used when (UINTN)(-1), (0xFFFFFFFF) may be a valid \r
+ Note: this function cannot be used when (UINTN)(-1), (0xFFFFFFFF) may be a valid\r
result. Use ShellConvertStringToUint64 instead.\r
\r
@param[in] String String representation of a number.\r
@param[in] String The string to evaluate.\r
@param[out] Value Upon a successful return the value of the conversion.\r
@param[in] ForceHex TRUE - always assume hex.\r
- @param[in] StopAtSpace TRUE to halt upon finding a space, FALSE to \r
+ @param[in] StopAtSpace TRUE to halt upon finding a space, FALSE to\r
process the entire String.\r
- \r
+\r
@retval EFI_SUCCESS The conversion was successful.\r
@retval EFI_INVALID_PARAMETER String contained an invalid character.\r
@retval EFI_NOT_FOUND String was a number, but Value was NULL.\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 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
- 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
+ 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 DirHandle The file handle of the directory to search\r
- @param Buffer Pointer to buffer for file's information\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
}\r
\r
/**\r
- Function to do most of the work of the constructor. Allows for calling \r
+ Function to do most of the work of the constructor. Allows for calling\r
multiple times without complete re-initialization.\r
\r
@param[in] ImageHandle A copy of the ImageHandle.\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
ShellSetFileInfo (\r
- IN SHELL_FILE_HANDLE FileHandle,\r
+ IN SHELL_FILE_HANDLE FileHandle,\r
IN EFI_FILE_INFO *FileInfo\r
)\r
{\r
This function opens a file with the open mode according to the file path. The\r
Attributes is valid only for EFI_FILE_MODE_CREATE.\r
\r
- @param FilePath on input the device path to the file. On output\r
+ @param FilePath on input the device path to the file. On output\r
the remaining device path.\r
- @param DeviceHandle pointer to the system device handle.\r
- @param FileHandle pointer to the file handle.\r
- @param OpenMode the mode to open the file with.\r
- @param Attributes the file's file attributes.\r
-\r
- @retval EFI_SUCCESS The information was set.\r
- @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r
- @retval EFI_UNSUPPORTED Could not open the file path.\r
- @retval EFI_NOT_FOUND The specified file could not be found on the\r
+ @param DeviceHandle pointer to the system device handle.\r
+ @param FileHandle pointer to the file handle.\r
+ @param OpenMode the mode to open the file with.\r
+ @param Attributes the file's file attributes.\r
+\r
+ @retval EFI_SUCCESS The information was set.\r
+ @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r
+ @retval EFI_UNSUPPORTED Could not open the file path.\r
+ @retval EFI_NOT_FOUND The specified file could not be found on the\r
device or the file system could not be found on\r
the device.\r
- @retval EFI_NO_MEDIA The device has no medium.\r
- @retval EFI_MEDIA_CHANGED The device has a different medium in it or the\r
+ @retval EFI_NO_MEDIA The device has no medium.\r
+ @retval EFI_MEDIA_CHANGED The device has a different medium in it or the\r
medium is no longer supported.\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_OUT_OF_RESOURCES Not enough resources were available to open the\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_OUT_OF_RESOURCES Not enough resources were available to open the\r
file.\r
- @retval EFI_VOLUME_FULL The volume is full.\r
+ @retval EFI_VOLUME_FULL The volume is full.\r
**/\r
EFI_STATUS\r
EFIAPI\r
ShellOpenFileByDevicePath(\r
- IN OUT EFI_DEVICE_PATH_PROTOCOL **FilePath,\r
- OUT EFI_HANDLE *DeviceHandle,\r
+ IN OUT EFI_DEVICE_PATH_PROTOCOL **FilePath,\r
+ OUT EFI_HANDLE *DeviceHandle,\r
OUT SHELL_FILE_HANDLE *FileHandle,\r
- IN UINT64 OpenMode,\r
- IN UINT64 Attributes\r
+ IN UINT64 OpenMode,\r
+ IN UINT64 Attributes\r
)\r
{\r
CHAR16 *FileName;\r
\r
if FileName is NULL then ASSERT()\r
\r
- @param FileName pointer to file name\r
- @param FileHandle pointer to the file handle.\r
- @param OpenMode the mode to open the file with.\r
- @param Attributes the file's file attributes.\r
+ @param FileName pointer to file name\r
+ @param FileHandle pointer to the file handle.\r
+ @param OpenMode the mode to open the file with.\r
+ @param Attributes the file's file attributes.\r
\r
- @retval EFI_SUCCESS The information was set.\r
- @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r
- @retval EFI_UNSUPPORTED Could not open the file path.\r
- @retval EFI_NOT_FOUND The specified file could not be found on the\r
+ @retval EFI_SUCCESS The information was set.\r
+ @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r
+ @retval EFI_UNSUPPORTED Could not open the file path.\r
+ @retval EFI_NOT_FOUND The specified file could not be found on the\r
device or the file system could not be found\r
on the device.\r
- @retval EFI_NO_MEDIA The device has no medium.\r
- @retval EFI_MEDIA_CHANGED The device has a different medium in it or the\r
+ @retval EFI_NO_MEDIA The device has no medium.\r
+ @retval EFI_MEDIA_CHANGED The device has a different medium in it or the\r
medium is no longer supported.\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_OUT_OF_RESOURCES Not enough resources were available to open the\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_OUT_OF_RESOURCES Not enough resources were available to open the\r
file.\r
- @retval EFI_VOLUME_FULL The volume is full.\r
+ @retval EFI_VOLUME_FULL The volume is full.\r
**/\r
EFI_STATUS\r
EFIAPI\r
ShellOpenFileByName(\r
- IN CONST CHAR16 *FileName,\r
+ IN CONST CHAR16 *FileName,\r
OUT SHELL_FILE_HANDLE *FileHandle,\r
IN UINT64 OpenMode,\r
- IN UINT64 Attributes\r
+ IN UINT64 Attributes\r
)\r
{\r
EFI_HANDLE DeviceHandle;\r
otherwise, the Filehandle is NULL. If the directory already existed, this\r
function opens the existing directory.\r
\r
- @param DirectoryName pointer to directory name\r
- @param FileHandle pointer to the file handle.\r
+ @param DirectoryName pointer to directory name\r
+ @param FileHandle pointer to the file handle.\r
\r
- @retval EFI_SUCCESS The information was set.\r
- @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r
- @retval EFI_UNSUPPORTED Could not open the file path.\r
- @retval EFI_NOT_FOUND The specified file could not be found on the\r
+ @retval EFI_SUCCESS The information was set.\r
+ @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r
+ @retval EFI_UNSUPPORTED Could not open the file path.\r
+ @retval EFI_NOT_FOUND The specified file could not be found on the\r
device or the file system could not be found\r
on the device.\r
- @retval EFI_NO_MEDIA The device has no medium.\r
- @retval EFI_MEDIA_CHANGED The device has a different medium in it or the\r
+ @retval EFI_NO_MEDIA The device has no medium.\r
+ @retval EFI_MEDIA_CHANGED The device has a different medium in it or the\r
medium is no longer supported.\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_OUT_OF_RESOURCES Not enough resources were available to open the\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_OUT_OF_RESOURCES Not enough resources were available to open the\r
file.\r
- @retval EFI_VOLUME_FULL The volume is full.\r
+ @retval EFI_VOLUME_FULL The volume is full.\r
@sa ShellOpenFileByName\r
**/\r
EFI_STATUS\r
the number of bytes written.\r
@param Buffer the buffer to put read data into.\r
\r
- @retval EFI_SUCCESS Data was read.\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_BUFFER_TO_SMALL Buffer is too small. ReadSize contains required\r
+ @retval EFI_SUCCESS Data was read.\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_BUFFER_TO_SMALL Buffer is too small. ReadSize contains required\r
size.\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
ShellDeleteFile (\r
- IN SHELL_FILE_HANDLE *FileHandle\r
+ IN SHELL_FILE_HANDLE *FileHandle\r
)\r
{\r
return (FileFunctionMap.DeleteFile(*FileHandle));\r
EFI_STATUS\r
EFIAPI\r
ShellSetFilePosition (\r
- IN SHELL_FILE_HANDLE FileHandle,\r
- IN UINT64 Position\r
+ IN SHELL_FILE_HANDLE FileHandle,\r
+ IN UINT64 Position\r
)\r
{\r
return (FileFunctionMap.SetFilePosition(FileHandle, Position));\r
return (FileFunctionMap.FlushFile(FileHandle));\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 ShellFindNextFile() 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 ShellFindNextFile() 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 ShellFindNextFile() 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 the buffer for the file's information.\r
\r
@retval EFI_SUCCESS Found the first file.\r
@retval EFI_NOT_FOUND Cannot find the directory.\r
//\r
return (FileHandleFindFirstFile(DirHandle, Buffer));\r
}\r
-/**\r
- Retrieves the next file in a directory.\r
+/** Retrieve next entries from a directory.\r
\r
- To use this function, caller must call the ShellFindFirstFile() 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 ShellFindNextFile() 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
+ To use this function, the caller must first call the ShellFindFirstFile()\r
+ function to get the first directory entry. Subsequent directory entries are\r
+ retrieved by using the ShellFindNextFile() function. This function can\r
+ be called several times to get each entry from the directory. If the call of\r
+ ShellFindNextFile() 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
// If the Type is TypeStart only check the first characters of the passed in param\r
// If it matches set the type and return TRUE\r
//\r
- if (TempListItem->Type == TypeStart) { \r
+ if (TempListItem->Type == TypeStart) {\r
if (StrnCmp(Name, TempListItem->Name, StrLen(TempListItem->Name)) == 0) {\r
*Type = TempListItem->Type;\r
return (TRUE);\r
//\r
\r
TempPointer = Argv[LoopCounter];\r
- if ((*TempPointer == L'^' && *(TempPointer+1) == L'-') \r
+ if ((*TempPointer == L'^' && *(TempPointer+1) == L'-')\r
|| (*TempPointer == L'^' && *(TempPointer+1) == L'/')\r
|| (*TempPointer == L'^' && *(TempPointer+1) == L'+')\r
){\r
if (ProblemParam != NULL) {\r
*ProblemParam = AllocateZeroPool(StrSize(Argv[LoopCounter]));\r
if (*ProblemParam != NULL) {\r
- StrCpy(*ProblemParam, Argv[LoopCounter]); \r
+ StrCpy(*ProblemParam, Argv[LoopCounter]);\r
}\r
}\r
ShellCommandLineFreeVarList(*CheckPackage);\r
if (String != NULL && *String == L'-') {\r
String++;\r
}\r
- \r
+\r
if (String == NULL) {\r
return (FALSE);\r
}\r
}\r
\r
/**\r
- Convert a Unicode character to upper case only if \r
+ Convert a Unicode character to upper case only if\r
it maps to a valid small-case ASCII character.\r
\r
This internal function only deal with Unicode character\r
\r
This internal function only deal with Unicode character\r
which maps to a valid hexadecimal ASII character, i.e.\r
- L'0' to L'9', L'a' to L'f' or L'A' to L'F'. For other \r
+ L'0' to L'9', L'a' to L'f' or L'A' to L'F'. For other\r
Unicode character, the value returned does not make sense.\r
\r
@param Char The character to convert.\r
if (String == NULL || StrSize(String) == 0 || Value == NULL) {\r
return (EFI_INVALID_PARAMETER);\r
}\r
- \r
+\r
//\r
- // Ignore the pad spaces (space or tab) \r
+ // Ignore the pad spaces (space or tab)\r
//\r
while ((*String == L' ') || (*String == L'\t')) {\r
String++;\r
}\r
\r
Result = 0;\r
- \r
+\r
//\r
// Skip spaces if requested\r
//\r
while (StopAtSpace && *String == L' ') {\r
String++;\r
}\r
- \r
+\r
while (ShellIsHexaDecimalDigitCharacter (*String)) {\r
//\r
- // If the Hex Number represented by String overflows according \r
+ // If the Hex Number represented by String overflows according\r
// to the range defined by UINTN, then ASSERT().\r
//\r
if (!(Result <= (RShiftU64((((UINT64) ~0) - InternalShellHexCharToUintn (*String)), 4)))) {\r
}\r
while (ShellIsDecimalDigitCharacter (*String)) {\r
//\r
- // If the number represented by String overflows according \r
+ // If the number represented by String overflows according\r
// to the range defined by UINT64, then ASSERT().\r
//\r
- \r
+\r
if (!(Result <= (DivU64x32((((UINT64) ~0) - (*String - L'0')),10)))) {\r
return (EFI_DEVICE_ERROR);\r
}\r
}\r
\r
*Value = Result;\r
- \r
+\r
return (EFI_SUCCESS);\r
}\r
\r
@param[out] Value Upon a successful return the value of the conversion.\r
@param[in] ForceHex TRUE - always assume hex.\r
@param[in] StopAtSpace FALSE to skip spaces.\r
- \r
+\r
@retval EFI_SUCCESS The conversion was successful.\r
@retval EFI_INVALID_PARAMETER String contained an invalid character.\r
@retval EFI_NOT_FOUND String was a number, but Value was NULL.\r
//\r
if (Walker == NULL || *Walker == CHAR_NULL || !InternalShellIsHexOrDecimalNumber(Walker, Hex, StopAtSpace)) {\r
return (EFI_INVALID_PARAMETER);\r
- } \r
+ }\r
\r
//\r
// do the conversion.\r
return (NULL);\r
}\r
Status = ShellFileHandleReadLine(Handle, RetVal, &Size, FALSE, Ascii);\r
- \r
+\r
}\r
if (EFI_ERROR(Status) && (RetVal != NULL)) {\r
FreePool(RetVal);\r