From 62cf113f2e3741e498d22df1cf5d347fab654e57 Mon Sep 17 00:00:00 2001 From: qhuang8 Date: Fri, 19 Oct 2007 02:36:33 +0000 Subject: Update to support EFI_SIMPLE_INPUT_EX protocol git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4180 6f19259b-4bc3-4df7-8a09-765794883524 --- Nt32Pkg/WinNtGopDxe/WinNtGopDriver.c | 82 ++++++++++++++++++++++++------------ 1 file changed, 56 insertions(+), 26 deletions(-) (limited to 'Nt32Pkg/WinNtGopDxe/WinNtGopDriver.c') diff --git a/Nt32Pkg/WinNtGopDxe/WinNtGopDriver.c b/Nt32Pkg/WinNtGopDxe/WinNtGopDriver.c index 5f1f2c1cf0..ae29da7850 100644 --- a/Nt32Pkg/WinNtGopDxe/WinNtGopDriver.c +++ b/Nt32Pkg/WinNtGopDxe/WinNtGopDriver.c @@ -21,33 +21,46 @@ Abstract: **/ +#include "WinNtGop.h" -// -// The package level header files this module uses -// -#include -#include -// -// The protocols, PPI and GUID defintions for this module -// -#include -#include -#include -#include -#include -#include -// -// The Library classes this module consumes -// -#include -#include -#include -#include -#include -#include -#include +STATIC +EFI_STATUS +FreeNotifyList ( + IN OUT LIST_ENTRY *ListHead + ) +/*++ -#include "WinNtGop.h" +Routine Description: + +Arguments: + + ListHead - The list head + +Returns: + + EFI_SUCCESS - Free the notify list successfully + EFI_INVALID_PARAMETER - ListHead is invalid. + +--*/ +{ + WIN_NT_GOP_SIMPLE_TEXTIN_EX_NOTIFY *NotifyNode; + + if (ListHead == NULL) { + return EFI_INVALID_PARAMETER; + } + while (!IsListEmpty (ListHead)) { + NotifyNode = CR ( + ListHead->ForwardLink, + WIN_NT_GOP_SIMPLE_TEXTIN_EX_NOTIFY, + NotifyEntry, + WIN_NT_GOP_SIMPLE_TEXTIN_EX_NOTIFY_SIGNATURE + ); + RemoveEntryList (ListHead->ForwardLink); + gBS->FreePool (NotifyNode); + } + + return EFI_SUCCESS; +} EFI_DRIVER_BINDING_PROTOCOL gWinNtGopDriverBinding = { WinNtGopDriverBindingSupported, @@ -188,6 +201,7 @@ WinNtGopDriverBindingStart ( Private = NULL; Private = AllocatePool (sizeof (GOP_PRIVATE_DATA)); if (Private == NULL) { + Status = EFI_OUT_OF_RESOURCES; goto Done; } // @@ -230,6 +244,8 @@ WinNtGopDriverBindingStart ( &Private->GraphicsOutput, &gEfiSimpleTextInProtocolGuid, &Private->SimpleTextIn, + &gEfiSimpleTextInputExProtocolGuid, + &Private->SimpleTextInEx, NULL ); @@ -251,6 +267,13 @@ Done: FreeUnicodeStringTable (Private->ControllerNameTable); } + if (Private->SimpleTextIn.WaitForKey != NULL) { + gBS->CloseEvent (Private->SimpleTextIn.WaitForKey); + } + if (Private->SimpleTextInEx.WaitForKeyEx != NULL) { + gBS->CloseEvent (Private->SimpleTextInEx.WaitForKeyEx); + } + FreeNotifyList (&Private->NotifyList); FreePool (Private); } } @@ -313,6 +336,8 @@ WinNtGopDriverBindingStop ( &Private->GraphicsOutput, &gEfiSimpleTextInProtocolGuid, &Private->SimpleTextIn, + &gEfiSimpleTextInputExProtocolGuid, + &Private->SimpleTextInEx, NULL ); if (!EFI_ERROR (Status)) { @@ -335,8 +360,13 @@ WinNtGopDriverBindingStop ( // Free our instance data // FreeUnicodeStringTable (Private->ControllerNameTable); + Status = gBS->CloseEvent (Private->SimpleTextIn.WaitForKey); + ASSERT_EFI_ERROR (Status); + Status = gBS->CloseEvent (Private->SimpleTextInEx.WaitForKeyEx); + ASSERT_EFI_ERROR (Status); + FreeNotifyList (&Private->NotifyList); - FreePool (Private); + gBS->FreePool (Private); } -- cgit v1.2.3