- //\r
- // ASSERT if FileHandle is NULL\r
- //\r
- ASSERT (FileHandle != NULL);\r
- //\r
- // Perform the Flush based on EFI_FILE_PROTOCOL\r
- //\r
- return (FileHandle->Flush(FileHandle));\r
-}\r
-\r
-/**\r
- function to determine if a given handle is a directory handle\r
-\r
- if DirHandle is NULL then ASSERT()\r
-\r
- open the file information on the DirHandle and verify that the Attribute\r
- includes EFI_FILE_DIRECTORY bit set.\r
-\r
- @param DirHandle Handle to open file\r
-\r
- @retval EFI_SUCCESS DirHandle is a directory\r
- @retval EFI_INVALID_PARAMETER DirHandle did not have EFI_FILE_INFO available\r
- @retval EFI_NOT_FOUND DirHandle is not a directory\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-InternalShellIsDirectory (\r
- IN EFI_FILE_HANDLE DirHandle\r
- )\r
-{\r
- EFI_FILE_INFO *DirInfo;\r
-\r
- //\r
- // ASSERT if DirHandle is NULL\r
- //\r
- ASSERT(DirHandle != NULL);\r
- \r
- //\r
- // get the file information for DirHandle\r
- //\r
- DirInfo = ShellGetFileInfo (DirHandle);\r
- \r
- //\r
- // Parse DirInfo\r
- //\r
- if (DirInfo == NULL) {\r
- //\r
- // We got nothing...\r
- //\r
- return (EFI_INVALID_PARAMETER);\r
- } \r
- if ((DirInfo->Attribute & EFI_FILE_DIRECTORY) == 0) {\r
- //\r
- // Attributes say this is not a directory\r
- //\r
- FreePool (DirInfo);\r
- return (EFI_NOT_FOUND);\r
- }\r
- //\r
- // all good...\r
- //\r
- FreePool (DirInfo);\r
- return (EFI_SUCCESS);\r