ASSERT (DirHandle != NULL);\r
ASSERT (Buffer != NULL);\r
ASSERT (NoFile != NULL);\r
- \r
- //\r
- // verify that DirHandle is a directory\r
- //\r
- Status = FileHandleIsDirectory(DirHandle);\r
- if (EFI_ERROR(Status)) {\r
- return (Status);\r
- } \r
\r
//\r
// This BufferSize MUST stay equal to the originally allocated one in GetFirstFile\r
// Append all of Source?\r
//\r
if (Count == 0) {\r
- Count = StrLen(Source);\r
+ Count = StrSize(Source);\r
}\r
\r
//\r
//\r
if (CurrentSize != NULL) {\r
NewSize = *CurrentSize;\r
- while (NewSize < (DestinationStartSize + (Count*sizeof(CHAR16)))) {\r
- NewSize += 2 * Count * sizeof(CHAR16);\r
+ while (NewSize < (DestinationStartSize + Count)) {\r
+ NewSize += 2 * Count;\r
}\r
*Destination = ReallocatePool(*CurrentSize, NewSize, *Destination);\r
*CurrentSize = NewSize;\r
} else {\r
- *Destination = AllocateZeroPool((Count+1)*sizeof(CHAR16));\r
+ *Destination = AllocateZeroPool(Count+sizeof(CHAR16));\r
}\r
\r
CopySize = StrSize(*Destination);\r
- *Destination = CopyMem((*Destination)+StrLen(Source), *Destination, CopySize);\r
- *Destination = CopyMem(*Destination, Source, StrLen(Source));\r
+ *Destination = CopyMem(*Destination+Count-sizeof(CHAR16), *Destination, CopySize);\r
+ *Destination = CopyMem(*Destination, Source, Count);\r
return (*Destination);\r
}\r
\r
EFI_FILE_INFO *FileInfo;\r
\r
Size = 0;\r
- *FullFileName = NULL;\r
\r
//\r
// Check our parameters\r
return (EFI_INVALID_PARAMETER);\r
}\r
\r
+ *FullFileName = NULL;\r
+\r
Status = Handle->Open(Handle, &CurrentHandle, L".", EFI_FILE_MODE_READ, 0);\r
if (!EFI_ERROR(Status)) {\r
//\r
// We got info... do we have a name? if yes preceed the current path with it...\r
//\r
if (StrLen (FileInfo->FileName) == 0) {\r
- *FullFileName = StrnCatGrowLeft(FullFileName, &Size, L"\\", 0);\r
+ *FullFileName = StrnCatGrowLeft(FullFileName, &Size, L"/", 0);\r
FreePool(FileInfo);\r
break;\r
} else {\r
*FullFileName = StrnCatGrowLeft(FullFileName, &Size, FileInfo->FileName, 0);\r
- *FullFileName = StrnCatGrowLeft(FullFileName, &Size, L"\\", 0);\r
+ *FullFileName = StrnCatGrowLeft(FullFileName, &Size, L"/", 0);\r
FreePool(FileInfo);\r
}\r
}\r