From edd62f8e7d00b56bd19217b56d0d2cdf3ef6c945 Mon Sep 17 00:00:00 2001 From: Joursoir Date: Mon, 15 Nov 2021 19:12:06 +0300 Subject: move all sources to the right place --- Library/UefiShellUfmCommandLib/tbi/screen.c | 36 +++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Library/UefiShellUfmCommandLib/tbi/screen.c (limited to 'Library/UefiShellUfmCommandLib/tbi/screen.c') diff --git a/Library/UefiShellUfmCommandLib/tbi/screen.c b/Library/UefiShellUfmCommandLib/tbi/screen.c new file mode 100644 index 0000000..ae4f2be --- /dev/null +++ b/Library/UefiShellUfmCommandLib/tbi/screen.c @@ -0,0 +1,36 @@ +#include +#include +#include +#include +#include + +#include "screen.h" + +struct screen *prepare_screen(VOID) +{ + struct screen *scr; + scr = AllocateZeroPool(sizeof(struct screen)); + if(!scr) + return NULL; + + scr->stdin = gST->ConIn; + scr->stdout = gST->ConOut; + scr->stderr = gST->StdErr; + + gST->ConOut->QueryMode( + gST->ConOut, + gST->ConOut->Mode->Mode, + &(scr->columns), + &(scr->lines) + ); + scr->attr = gST->ConOut->Mode->Attribute; + + return scr; +} + +VOID forget_screen(struct screen *scr) +{ + ASSERT(scr != NULL); + + FreePool(scr); +} -- cgit v1.2.3-18-g5258