/** @file\r
\r
-Copyright (c) 2006 - 2007, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
\r
\r
**/\r
+#include "WinNtGop.h"\r
\r
-//\r
-// The package level header files this module uses\r
-//\r
-#include <Uefi.h>\r
-#include <WinNtDxe.h>\r
-//\r
-// The protocols, PPI and GUID defintions for this module\r
-//\r
-#include <Guid/EventGroup.h>\r
-#include <Protocol/WinNtIo.h>\r
-#include <Protocol/ComponentName.h>\r
-#include <Protocol/SimpleTextIn.h>\r
-#include <Protocol/DriverBinding.h>\r
-#include <Protocol/GraphicsOutput.h>\r
-//\r
-// The Library classes this module consumes\r
-//\r
-#include <Library/DebugLib.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/UefiLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
+EFI_STATUS\r
+FreeNotifyList (\r
+ IN OUT LIST_ENTRY *ListHead\r
+ )\r
+/*++\r
\r
-#include "WinNtGop.h"\r
+Routine Description:\r
+\r
+Arguments:\r
+\r
+ ListHead - The list head\r
+\r
+Returns:\r
+\r
+ EFI_SUCCESS - Free the notify list successfully\r
+ EFI_INVALID_PARAMETER - ListHead is invalid.\r
+\r
+--*/\r
+{\r
+ WIN_NT_GOP_SIMPLE_TEXTIN_EX_NOTIFY *NotifyNode;\r
+\r
+ if (ListHead == NULL) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+ while (!IsListEmpty (ListHead)) {\r
+ NotifyNode = CR (\r
+ ListHead->ForwardLink, \r
+ WIN_NT_GOP_SIMPLE_TEXTIN_EX_NOTIFY, \r
+ NotifyEntry, \r
+ WIN_NT_GOP_SIMPLE_TEXTIN_EX_NOTIFY_SIGNATURE\r
+ );\r
+ RemoveEntryList (ListHead->ForwardLink);\r
+ gBS->FreePool (NotifyNode);\r
+ }\r
+ \r
+ return EFI_SUCCESS;\r
+}\r
\r
EFI_DRIVER_BINDING_PROTOCOL gWinNtGopDriverBinding = {\r
WinNtGopDriverBindingSupported,\r
//\r
// Install driver model protocol(s).\r
//\r
- Status = EfiLibInstallAllDriverProtocols (\r
+ Status = EfiLibInstallDriverBindingComponentName2 (\r
ImageHandle,\r
SystemTable,\r
&gWinNtGopDriverBinding,\r
ImageHandle,\r
&gWinNtGopComponentName,\r
- NULL,\r
- NULL\r
+ &gWinNtGopComponentName2\r
);\r
ASSERT_EFI_ERROR (Status);\r
\r
Status = gBS->OpenProtocol (\r
Handle,\r
&gEfiWinNtIoProtocolGuid,\r
- &WinNtIo,\r
+ (VOID **) &WinNtIo,\r
This->DriverBindingHandle,\r
Handle,\r
EFI_OPEN_PROTOCOL_BY_DRIVER\r
Status = gBS->OpenProtocol (\r
Handle,\r
&gEfiWinNtIoProtocolGuid,\r
- &WinNtIo,\r
+ (VOID **) &WinNtIo,\r
This->DriverBindingHandle,\r
Handle,\r
EFI_OPEN_PROTOCOL_BY_DRIVER\r
Private = NULL;\r
Private = AllocatePool (sizeof (GOP_PRIVATE_DATA));\r
if (Private == NULL) {\r
+ Status = EFI_OUT_OF_RESOURCES;\r
goto Done;\r
}\r
//\r
\r
Private->ControllerNameTable = NULL;\r
\r
- AddUnicodeString (\r
+ AddUnicodeString2 (\r
"eng",\r
gWinNtGopComponentName.SupportedLanguages,\r
&Private->ControllerNameTable,\r
- WinNtIo->EnvString\r
+ WinNtIo->EnvString,\r
+ TRUE\r
);\r
+ AddUnicodeString2 (\r
+ "en",\r
+ gWinNtGopComponentName2.SupportedLanguages,\r
+ &Private->ControllerNameTable,\r
+ WinNtIo->EnvString,\r
+ FALSE\r
+ );\r
+\r
\r
Private->WindowName = WinNtIo->EnvString;\r
\r
&Private->GraphicsOutput,\r
&gEfiSimpleTextInProtocolGuid,\r
&Private->SimpleTextIn,\r
+ &gEfiSimpleTextInputExProtocolGuid,\r
+ &Private->SimpleTextInEx,\r
NULL\r
);\r
\r
FreeUnicodeStringTable (Private->ControllerNameTable);\r
}\r
\r
+ if (Private->SimpleTextIn.WaitForKey != NULL) {\r
+ gBS->CloseEvent (Private->SimpleTextIn.WaitForKey);\r
+ }\r
+ if (Private->SimpleTextInEx.WaitForKeyEx != NULL) {\r
+ gBS->CloseEvent (Private->SimpleTextInEx.WaitForKeyEx);\r
+ }\r
+ FreeNotifyList (&Private->NotifyList);\r
FreePool (Private);\r
}\r
}\r
Status = gBS->OpenProtocol (\r
Handle,\r
&gEfiGraphicsOutputProtocolGuid,\r
- &GraphicsOutput,\r
+ (VOID **) &GraphicsOutput,\r
This->DriverBindingHandle,\r
Handle,\r
EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
&Private->GraphicsOutput,\r
&gEfiSimpleTextInProtocolGuid,\r
&Private->SimpleTextIn,\r
+ &gEfiSimpleTextInputExProtocolGuid,\r
+ &Private->SimpleTextInEx,\r
NULL\r
);\r
if (!EFI_ERROR (Status)) {\r
// Free our instance data\r
//\r
FreeUnicodeStringTable (Private->ControllerNameTable);\r
+ Status = gBS->CloseEvent (Private->SimpleTextIn.WaitForKey);\r
+ ASSERT_EFI_ERROR (Status);\r
+ Status = gBS->CloseEvent (Private->SimpleTextInEx.WaitForKeyEx);\r
+ ASSERT_EFI_ERROR (Status);\r
+ FreeNotifyList (&Private->NotifyList);\r
\r
- FreePool (Private);\r
+ gBS->FreePool (Private);\r
\r
}\r
\r