/* This routine find the offset of the last period '.' of string. if No period exists function FileNameExtension is set to L'\0' */
STATIC VOID SplitFileNameExtension(IN CHAR16 *FileName, OUT CHAR16 *FileNameFirst, OUT CHAR16 *FileNameExtension)
/* This routine find the offset of the last period '.' of string. if No period exists function FileNameExtension is set to L'\0' */
STATIC VOID SplitFileNameExtension(IN CHAR16 *FileName, OUT CHAR16 *FileNameFirst, OUT CHAR16 *FileNameExtension)
{
  UINTN  Index;
  UINTN  StringLen;
  StringLen = StrLen (FileName);
  for (Index = StringLen; Index > 0 && FileName[Index] != L'.'; Index--) {
  }
  if ((Index == 0) && (FileName[Index] != L'.')) {
    FileNameExtension[0] = L'\0';
    Index                = StringLen;
  } else {
    StrCpyS (FileNameExtension, MAX_FILE_NAME_LEN, &FileName[Index+1]);
  }
  StrnCpyS (FileNameFirst, MAX_FILE_NAME_LEN, FileName, Index);
  FileNameFirst[Index] = L'\0';
}