\r
Fcb = SEMIHOST_FCB_FROM_THIS(File);\r
\r
- // Get the filename from the Fcb\r
- NameSize = AsciiStrLen (Fcb->FileName);\r
- FileName = AllocatePool (NameSize + 1);\r
+ if (!Fcb->IsRoot) {\r
+ // Get the filename from the Fcb\r
+ NameSize = AsciiStrLen (Fcb->FileName);\r
+ FileName = AllocatePool (NameSize + 1);\r
\r
- AsciiStrCpy (FileName, Fcb->FileName);\r
+ AsciiStrCpy (FileName, Fcb->FileName);\r
\r
- // Close the file if it's open. Disregard return status,\r
- // since it might give an error if the file isn't open.\r
- File->Close (File);\r
- \r
- // Call the semihost interface to delete the file.\r
- Status = SemihostFileRemove (FileName);\r
+ // Close the file if it's open. Disregard return status,\r
+ // since it might give an error if the file isn't open.\r
+ File->Close (File);\r
+\r
+ // Call the semihost interface to delete the file.\r
+ Status = SemihostFileRemove (FileName);\r
+ } else {\r
+ Status = EFI_UNSUPPORTED;\r
+ }\r
\r
return Status;\r
}\r
\r
Fcb = SEMIHOST_FCB_FROM_THIS(File);\r
\r
- Status = SemihostFileLength (Fcb->SemihostHandle, &Length);\r
- if (!EFI_ERROR(Status) && (Length < Position)) {\r
- Position = Length;\r
- }\r
+ if (!Fcb->IsRoot) {\r
+ Status = SemihostFileLength (Fcb->SemihostHandle, &Length);\r
+ if (!EFI_ERROR(Status) && (Length < Position)) {\r
+ Position = Length;\r
+ }\r
\r
- Status = SemihostFileSeek (Fcb->SemihostHandle, (UINT32)Position);\r
- if (!EFI_ERROR(Status)) {\r
+ Status = SemihostFileSeek (Fcb->SemihostHandle, (UINT32)Position);\r
+ if (!EFI_ERROR(Status)) {\r
+ Fcb->Position = Position;\r
+ }\r
+ } else {\r
Fcb->Position = Position;\r
+ Status = EFI_SUCCESS;\r
}\r
\r
return Status;\r