-/*++\r
+/** @file\r
+ Routines dealing with setting/getting file/volume info\r
\r
Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials are licensed and made available\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
\r
-Module Name:\r
\r
- Info.c\r
+**/\r
\r
-Abstract:\r
+#include "Fat.h"\r
\r
- Routines dealing with setting/getting file/volume info\r
+/**\r
\r
-Revision History\r
+ Get the volume's info into Buffer.\r
\r
---*/\r
+ @param Volume - FAT file system volume.\r
+ @param BufferSize - Size of Buffer.\r
+ @param Buffer - Buffer containing volume info.\r
\r
-#include "Fat.h"\r
+ @retval EFI_SUCCESS - Get the volume info successfully.\r
+ @retval EFI_BUFFER_TOO_SMALL - The buffer is too small.\r
\r
+**/\r
EFI_STATUS\r
FatGetVolumeInfo (\r
IN FAT_VOLUME *Volume,\r
OUT VOID *Buffer\r
);\r
\r
+/**\r
+\r
+ Set the volume's info.\r
+\r
+ @param Volume - FAT file system volume.\r
+ @param BufferSize - Size of Buffer.\r
+ @param Buffer - Buffer containing the new volume info.\r
+\r
+ @retval EFI_SUCCESS - Set the volume info successfully.\r
+ @retval EFI_BAD_BUFFER_SIZE - The buffer size is error.\r
+ @retval EFI_WRITE_PROTECTED - The volume is read only.\r
+ @return other - An error occurred when operation the disk.\r
+\r
+**/\r
EFI_STATUS\r
FatSetVolumeInfo (\r
IN FAT_VOLUME *Volume,\r
IN VOID *Buffer\r
);\r
\r
+/**\r
+\r
+ Set or Get the some types info of the file into Buffer.\r
+\r
+ @param IsSet - TRUE:The access is set, else is get\r
+ @param FHand - The handle of file\r
+ @param Type - The type of the info\r
+ @param BufferSize - Size of Buffer\r
+ @param Buffer - Buffer containing volume info\r
+\r
+ @retval EFI_SUCCESS - Get the info successfully\r
+ @retval EFI_DEVICE_ERROR - Can not find the OFile for the file\r
+\r
+**/\r
EFI_STATUS\r
FatSetOrGetInfo (\r
IN BOOLEAN IsSet,\r
IN OUT VOID *Buffer\r
);\r
\r
+/**\r
+\r
+ Get the open file's info into Buffer.\r
+\r
+ @param OFile - The open file.\r
+ @param BufferSize - Size of Buffer.\r
+ @param Buffer - Buffer containing file info.\r
+\r
+ @retval EFI_SUCCESS - Get the file info successfully.\r
+ @retval EFI_BUFFER_TOO_SMALL - The buffer is too small.\r
+\r
+**/\r
EFI_STATUS\r
FatGetFileInfo (\r
IN FAT_OFILE *OFile,\r
IN OUT UINTN *BufferSize,\r
OUT VOID *Buffer\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Get the open file's info into Buffer.\r
-\r
-Arguments:\r
+{\r
+ return FatGetDirEntInfo (OFile->Volume, OFile->DirEnt, BufferSize, Buffer);\r
+}\r
\r
- OFile - The open file.\r
- BufferSize - Size of Buffer.\r
- Buffer - Buffer containing file info.\r
+/**\r
\r
-Returns:\r
+ Get the volume's info into Buffer.\r
\r
- EFI_SUCCESS - Get the file info successfully.\r
- EFI_BUFFER_TOO_SMALL - The buffer is too small.\r
+ @param Volume - FAT file system volume.\r
+ @param BufferSize - Size of Buffer.\r
+ @param Buffer - Buffer containing volume info.\r
\r
---*/\r
-{\r
- return FatGetDirEntInfo (OFile->Volume, OFile->DirEnt, BufferSize, Buffer);\r
-}\r
+ @retval EFI_SUCCESS - Get the volume info successfully.\r
+ @retval EFI_BUFFER_TOO_SMALL - The buffer is too small.\r
\r
+**/\r
EFI_STATUS\r
FatGetVolumeInfo (\r
IN FAT_VOLUME *Volume,\r
IN OUT UINTN *BufferSize,\r
OUT VOID *Buffer\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Get the volume's info into Buffer.\r
-\r
-Arguments:\r
-\r
- Volume - FAT file system volume.\r
- BufferSize - Size of Buffer.\r
- Buffer - Buffer containing volume info.\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - Get the volume info successfully.\r
- EFI_BUFFER_TOO_SMALL - The buffer is too small.\r
-\r
---*/\r
{\r
UINTN Size;\r
UINTN NameSize;\r
return Status;\r
}\r
\r
+/**\r
+\r
+ Get the volume's label info into Buffer.\r
+\r
+ @param Volume - FAT file system volume.\r
+ @param BufferSize - Size of Buffer.\r
+ @param Buffer - Buffer containing volume's label info.\r
+\r
+ @retval EFI_SUCCESS - Get the volume's label info successfully.\r
+ @retval EFI_BUFFER_TOO_SMALL - The buffer is too small.\r
+\r
+**/\r
EFI_STATUS\r
FatGetVolumeLabelInfo (\r
IN FAT_VOLUME *Volume,\r
IN OUT UINTN *BufferSize,\r
OUT VOID *Buffer\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Get the volume's label info into Buffer.\r
-\r
-Arguments:\r
-\r
- Volume - FAT file system volume.\r
- BufferSize - Size of Buffer.\r
- Buffer - Buffer containing volume's label info.\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - Get the volume's label info successfully.\r
- EFI_BUFFER_TOO_SMALL - The buffer is too small.\r
-\r
---*/\r
{\r
UINTN Size;\r
UINTN NameSize;\r
return Status;\r
}\r
\r
+/**\r
+\r
+ Set the volume's info.\r
+\r
+ @param Volume - FAT file system volume.\r
+ @param BufferSize - Size of Buffer.\r
+ @param Buffer - Buffer containing the new volume info.\r
+\r
+ @retval EFI_SUCCESS - Set the volume info successfully.\r
+ @retval EFI_BAD_BUFFER_SIZE - The buffer size is error.\r
+ @retval EFI_WRITE_PROTECTED - The volume is read only.\r
+ @return other - An error occurred when operation the disk.\r
+\r
+**/\r
EFI_STATUS\r
FatSetVolumeInfo (\r
IN FAT_VOLUME *Volume,\r
IN UINTN BufferSize,\r
IN VOID *Buffer\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Set the volume's info.\r
-\r
-Arguments:\r
-\r
- Volume - FAT file system volume.\r
- BufferSize - Size of Buffer.\r
- Buffer - Buffer containing the new volume info.\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - Set the volume info successfully.\r
- EFI_BAD_BUFFER_SIZE - The buffer size is error.\r
- EFI_WRITE_PROTECTED - The volume is read only.\r
- other - An error occurred when operation the disk.\r
-\r
---*/\r
{\r
EFI_FILE_SYSTEM_INFO *Info;\r
\r
return FatSetVolumeEntry (Volume, Info->VolumeLabel);\r
}\r
\r
+/**\r
+\r
+ Set the volume's label info.\r
+\r
+ @param Volume - FAT file system volume.\r
+ @param BufferSize - Size of Buffer.\r
+ @param Buffer - Buffer containing the new volume label info.\r
+\r
+ @retval EFI_SUCCESS - Set the volume label info successfully.\r
+ @retval EFI_WRITE_PROTECTED - The disk is write protected.\r
+ @retval EFI_BAD_BUFFER_SIZE - The buffer size is error.\r
+ @return other - An error occurred when operation the disk.\r
+\r
+**/\r
EFI_STATUS\r
FatSetVolumeLabelInfo (\r
IN FAT_VOLUME *Volume,\r
IN UINTN BufferSize,\r
IN VOID *Buffer\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Set the volume's label info\r
-\r
-Arguments:\r
-\r
- Volume - FAT file system volume.\r
- BufferSize - Size of Buffer.\r
- Buffer - Buffer containing the new volume label info.\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - Set the volume label info successfully.\r
- EFI_WRITE_PROTECTED - The disk is write protected.\r
- EFI_BAD_BUFFER_SIZE - The buffer size is error.\r
- other - An error occurred when operation the disk.\r
-\r
---*/\r
{\r
EFI_FILE_SYSTEM_VOLUME_LABEL *Info;\r
\r
return FatSetVolumeEntry (Volume, Info->VolumeLabel);\r
}\r
\r
+/**\r
+\r
+ Set the file info.\r
+\r
+ @param Volume - FAT file system volume.\r
+ @param IFile - The instance of the open file.\r
+ @param OFile - The open file.\r
+ @param BufferSize - Size of Buffer.\r
+ @param Buffer - Buffer containing the new file info.\r
+\r
+ @retval EFI_SUCCESS - Set the file info successfully.\r
+ @retval EFI_ACCESS_DENIED - It is the root directory\r
+ or the directory attribute bit can not change\r
+ or try to change a directory size\r
+ or something else.\r
+ @retval EFI_UNSUPPORTED - The new file size is larger than 4GB.\r
+ @retval EFI_WRITE_PROTECTED - The disk is write protected.\r
+ @retval EFI_BAD_BUFFER_SIZE - The buffer size is error.\r
+ @retval EFI_INVALID_PARAMETER - The time info or attributes info is error.\r
+ @retval EFI_OUT_OF_RESOURCES - Can not allocate new memory.\r
+ @retval EFI_VOLUME_CORRUPTED - The volume is corrupted.\r
+ @return other - An error occurred when operation the disk.\r
+\r
+**/\r
EFI_STATUS\r
FatSetFileInfo (\r
IN FAT_VOLUME *Volume,\r
IN UINTN BufferSize,\r
IN VOID *Buffer\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Set the file info.\r
-\r
-Arguments:\r
-\r
- Volume - FAT file system volume.\r
- IFile - The instance of the open file.\r
- OFile - The open file.\r
- BufferSize - Size of Buffer.\r
- Buffer - Buffer containing the new file info.\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - Set the file info successfully.\r
- EFI_ACCESS_DENIED - It is the root directory\r
- or the directory attribute bit can not change\r
- or try to change a directory size\r
- or something else.\r
- EFI_UNSUPPORTED - The new file size is larger than 4GB.\r
- EFI_WRITE_PROTECTED - The disk is write protected.\r
- EFI_BAD_BUFFER_SIZE - The buffer size is error.\r
- EFI_INVALID_PARAMETER - The time info or attributes info is error.\r
- EFI_OUT_OF_RESOURCES - Can not allocate new memory.\r
- EFI_VOLUME_CORRUPTED - The volume is corrupted.\r
- other - An error occurred when operation the disk.\r
-\r
---*/\r
{\r
EFI_STATUS Status;\r
EFI_FILE_INFO *NewInfo;\r
return FatOFileFlush (OFile);\r
}\r
\r
+/**\r
+\r
+ Set or Get the some types info of the file into Buffer.\r
+\r
+ @param IsSet - TRUE:The access is set, else is get\r
+ @param FHand - The handle of file\r
+ @param Type - The type of the info\r
+ @param BufferSize - Size of Buffer\r
+ @param Buffer - Buffer containing volume info\r
+\r
+ @retval EFI_SUCCESS - Get the info successfully\r
+ @retval EFI_DEVICE_ERROR - Can not find the OFile for the file\r
+\r
+**/\r
EFI_STATUS\r
FatSetOrGetInfo (\r
IN BOOLEAN IsSet,\r
IN OUT UINTN *BufferSize,\r
IN OUT VOID *Buffer\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Set or Get the some types info of the file into Buffer\r
-\r
-Arguments:\r
-\r
- IsSet - TRUE:The access is set, else is get\r
- FHand - The handle of file\r
- Type - The type of the info\r
- BufferSize - Size of Buffer\r
- Buffer - Buffer containing volume info\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - Get the info successfully\r
- EFI_DEVICE_ERROR - Can not find the OFile for the file\r
-\r
---*/\r
{\r
FAT_IFILE *IFile;\r
FAT_OFILE *OFile;\r
return Status;\r
}\r
\r
+/**\r
+\r
+ Get the some types info of the file into Buffer.\r
+\r
+ @param FHand - The handle of file.\r
+ @param Type - The type of the info.\r
+ @param BufferSize - Size of Buffer.\r
+ @param Buffer - Buffer containing volume info.\r
+\r
+ @retval EFI_SUCCESS - Get the info successfully.\r
+ @retval EFI_DEVICE_ERROR - Can not find the OFile for the file.\r
+\r
+**/\r
EFI_STATUS\r
EFIAPI\r
FatGetInfo (\r
IN OUT UINTN *BufferSize,\r
OUT VOID *Buffer\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Get the some types info of the file into Buffer.\r
-\r
-Arguments:\r
+{\r
+ return FatSetOrGetInfo (FALSE, FHand, Type, BufferSize, Buffer);\r
+}\r
\r
- FHand - The handle of file.\r
- Type - The type of the info.\r
- BufferSize - Size of Buffer.\r
- Buffer - Buffer containing volume info.\r
+/**\r
\r
-Returns:\r
+ Set the some types info of the file into Buffer.\r
\r
- EFI_SUCCESS - Get the info successfully.\r
- EFI_DEVICE_ERROR - Can not find the OFile for the file.\r
+ @param FHand - The handle of file.\r
+ @param Type - The type of the info.\r
+ @param BufferSize - Size of Buffer\r
+ @param Buffer - Buffer containing volume info.\r
\r
---*/\r
-{\r
- return FatSetOrGetInfo (FALSE, FHand, Type, BufferSize, Buffer);\r
-}\r
+ @retval EFI_SUCCESS - Set the info successfully.\r
+ @retval EFI_DEVICE_ERROR - Can not find the OFile for the file.\r
\r
+**/\r
EFI_STATUS\r
EFIAPI\r
FatSetInfo (\r
IN UINTN BufferSize,\r
IN VOID *Buffer\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Set the some types info of the file into Buffer.\r
-\r
-Arguments:\r
-\r
- FHand - The handle of file.\r
- Type - The type of the info.\r
- BufferSize - Size of Buffer\r
- Buffer - Buffer containing volume info.\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - Set the info successfully.\r
- EFI_DEVICE_ERROR - Can not find the OFile for the file.\r
-\r
---*/\r
{\r
return FatSetOrGetInfo (TRUE, FHand, Type, &BufferSize, Buffer);\r
}\r