summaryrefslogtreecommitdiff
path: root/Nt32Pkg/WinNtGopDxe/WinNtGopDriver.c
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2007-10-19 02:36:33 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2007-10-19 02:36:33 +0000
commit62cf113f2e3741e498d22df1cf5d347fab654e57 (patch)
tree2ecae2dda2fe7eba9bf3266a25e024070e7e86de /Nt32Pkg/WinNtGopDxe/WinNtGopDriver.c
parentf3d1e94028e0b1d6cefda99056d12d98e53e63a8 (diff)
downloadedk2-platforms-62cf113f2e3741e498d22df1cf5d347fab654e57.tar.xz
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
Diffstat (limited to 'Nt32Pkg/WinNtGopDxe/WinNtGopDriver.c')
-rw-r--r--Nt32Pkg/WinNtGopDxe/WinNtGopDriver.c82
1 files changed, 56 insertions, 26 deletions
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 <Uefi.h>
-#include <WinNtDxe.h>
-//
-// The protocols, PPI and GUID defintions for this module
-//
-#include <Guid/EventGroup.h>
-#include <Protocol/WinNtIo.h>
-#include <Protocol/ComponentName.h>
-#include <Protocol/SimpleTextIn.h>
-#include <Protocol/DriverBinding.h>
-#include <Protocol/GraphicsOutput.h>
-//
-// The Library classes this module consumes
-//
-#include <Library/DebugLib.h>
-#include <Library/BaseLib.h>
-#include <Library/UefiDriverEntryPoint.h>
-#include <Library/UefiLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/UefiBootServicesTableLib.h>
-#include <Library/MemoryAllocationLib.h>
+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);
}