/*++\r
\r
-Copyright (c) 2005 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials are licensed and made available\r
under the terms and conditions of the BSD License which accompanies this\r
distribution. The full text of the license may be found at\r
Volume = OFile->Volume;\r
Task = NULL;\r
\r
+ //\r
+ // Write to a directory is unsupported\r
+ //\r
+ if ((OFile->ODir != NULL) && (IoMode == WRITE_DATA)) {\r
+ return EFI_UNSUPPORTED;\r
+ }\r
+\r
if (OFile->Error == EFI_NOT_FOUND) {\r
return EFI_DEVICE_ERROR;\r
}\r
if (!EFI_ERROR (Status)) {\r
if (OFile->ODir != NULL) {\r
//\r
- // Access a directory\r
+ // Read a directory is supported\r
//\r
- Status = EFI_UNSUPPORTED;\r
- if (IoMode == READ_DATA) {\r
- //\r
- // Read a directory is supported\r
- //\r
- Status = FatIFileReadDir (IFile, BufferSize, Buffer);\r
- }\r
-\r
+ ASSERT (IoMode == READ_DATA);\r
+ Status = FatIFileReadDir (IFile, BufferSize, Buffer);\r
OFile = NULL;\r
} else {\r
//\r