/* Function to close a EFI_SIMPLE_TEXT_INPUT_PROTOCOL on top of a SHELL_FILE_HANDLE to support redirecting input from a file. */
EFI_STATUS CloseSimpleTextInOnFile(IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *SimpleTextIn)
/* Function to close a EFI_SIMPLE_TEXT_INPUT_PROTOCOL on top of a SHELL_FILE_HANDLE to support redirecting input from a file. */
EFI_STATUS CloseSimpleTextInOnFile(IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *SimpleTextIn)
{
  EFI_STATUS  Status;
  EFI_STATUS  Status1;
  if (SimpleTextIn == NULL) {
    return (EFI_INVALID_PARAMETER);
  }
  Status = gBS->CloseEvent (((SHELL_EFI_SIMPLE_TEXT_INPUT_PROTOCOL *)SimpleTextIn)->SimpleTextIn.WaitForKey);
  Status1 = gBS->UninstallProtocolInterface (
                   ((SHELL_EFI_SIMPLE_TEXT_INPUT_PROTOCOL *)SimpleTextIn)->TheHandle,
                   &gEfiSimpleTextInProtocolGuid,
                   &(((SHELL_EFI_SIMPLE_TEXT_INPUT_PROTOCOL *)SimpleTextIn)->SimpleTextIn)
                   );
  FreePool (SimpleTextIn);
  if (!EFI_ERROR (Status)) {
    return (Status1);
  } else {
    return (Status);
  }
}