/* Frees all memory associated with the input memory file. */
EFI_STATUS FreeMemoryFile(IN EFI_HANDLE InputMemoryFile)
/* Frees all memory associated with the input memory file. */
EFI_STATUS FreeMemoryFile(IN EFI_HANDLE InputMemoryFile)
{
  MEMORY_FILE *MemoryFile;
  CheckMemoryFileState (InputMemoryFile);
  MemoryFile = (MEMORY_FILE*)InputMemoryFile;
  free (MemoryFile->FileImage);
  memset (MemoryFile, 0xcc, sizeof (*MemoryFile));
  MemoryFile->Eof -= 1;
  free (MemoryFile);
  return EFI_SUCCESS;
}