/* if the return value is not NULL it must be caller freed. */
CHAR16* GetFullyQualifiedPath(IN CONST CHAR16 *Path)
/* if the return value is not NULL it must be caller freed. */
CHAR16* GetFullyQualifiedPath(IN CONST CHAR16 *Path)
{
  CHAR16        *PathToReturn;
  UINTN         Size;
  CONST CHAR16  *CurDir;
  PathToReturn = NULL;
  Size         = 0;
  ASSERT ((PathToReturn == NULL && Size == 0) || (PathToReturn != NULL));
  if (StrStr (Path, L":") == NULL) {
    CurDir = gEfiShellProtocol->GetCurDir (NULL);
    StrnCatGrow (&PathToReturn, &Size, CurDir, 0);
    StrnCatGrow (&PathToReturn, &Size, L"\\", 0);
    if (*Path == L'\\') {
      Path++;
    }
  }
  StrnCatGrow (&PathToReturn, &Size, Path, 0);
  PathCleanUpDirectories (PathToReturn);
  if (PathToReturn == NULL) {
    return NULL;
  }
  while (PathToReturn[StrLen (PathToReturn)-1] == L'*') {
    PathToReturn[StrLen (PathToReturn)-1] = CHAR_NULL;
  }
  return (PathToReturn);
}