/* Implements SIMPLE_TEXT_OUTPUT.QueryMode(). It returnes information for an available text mode that the Graphics Console supports. In this driver,we only support text mode 80x25, which is defined as mode 0. */
EFI_STATUS EFIAPI GraphicsConsoleConOutQueryMode(IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN UINTN ModeNumber, OUT UINTN *Columns, OUT UINTN *Rows)
/* Implements SIMPLE_TEXT_OUTPUT.QueryMode(). It returnes information for an available text mode that the Graphics Console supports. In this driver,we only support text mode 80x25, which is defined as mode 0. */
EFI_STATUS EFIAPI GraphicsConsoleConOutQueryMode(IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN UINTN ModeNumber, OUT UINTN *Columns, OUT UINTN *Rows)
{
  GRAPHICS_CONSOLE_DEV  *Private;
  EFI_STATUS            Status;
  EFI_TPL               OldTpl;
  if (ModeNumber >= (UINTN)This->Mode->MaxMode) {
    return EFI_UNSUPPORTED;
  }
  OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
  Status = EFI_SUCCESS;
  Private = GRAPHICS_CONSOLE_CON_OUT_DEV_FROM_THIS (This);
  *Columns = Private->ModeData[ModeNumber].Columns;
  *Rows    = Private->ModeData[ModeNumber].Rows;
  if ((*Columns <= 0) || (*Rows <= 0)) {
    Status = EFI_UNSUPPORTED;
    goto Done;
  }
Done:
  gBS->RestoreTPL (OldTpl);
  return Status;
}