/* Check if data is coming from StdIn output. */
BOOLEAN IsStdInDataAvailable(VOID)
/* Check if data is coming from StdIn output. */
BOOLEAN IsStdInDataAvailable(VOID)
{
  SHELL_FILE_HANDLE  FileHandle;
  EFI_STATUS         Status;
  CHAR16             CharBuffer;
  UINTN              CharSize;
  UINT64             OriginalFilePosition;
  Status               = EFI_SUCCESS;
  FileHandle           = NULL;
  OriginalFilePosition = 0;
  if (ShellOpenFileByName (L">i", &FileHandle, EFI_FILE_MODE_READ, 0) == EFI_SUCCESS) {
    CharSize = sizeof (CHAR16);
    gEfiShellProtocol->GetFilePosition (FileHandle, &OriginalFilePosition);
    Status = gEfiShellProtocol->ReadFile (FileHandle, &CharSize, &CharBuffer);
    if (EFI_ERROR (Status) || (CharSize != sizeof (CHAR16))) {
      return FALSE;
    }
    gEfiShellProtocol->SetFilePosition (FileHandle, OriginalFilePosition);
  }
  if (FileHandle == NULL) {
    return FALSE;
  } else {
    return TRUE;
  }
}