From ad4dc92d616f24df1de49887d5fd194704cb5fc9 Mon Sep 17 00:00:00 2001 From: qhuang8 Date: Fri, 19 Oct 2007 02:37:42 +0000 Subject: [PATCH 1/1] Remove WinNtConsole driver since its functionality has already been covered by WinNtGop driver git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4181 6f19259b-4bc3-4df7-8a09-765794883524 --- Nt32Pkg/Nt32Pkg.dsc | 1 - Nt32Pkg/Nt32Pkg.fdf | 1 - Nt32Pkg/WinNtConsoleDxe/ComponentName.c | 378 ----------- Nt32Pkg/WinNtConsoleDxe/Console.c | 363 ----------- Nt32Pkg/WinNtConsoleDxe/Console.h | 512 --------------- Nt32Pkg/WinNtConsoleDxe/ConsoleIn.c | 379 ----------- Nt32Pkg/WinNtConsoleDxe/ConsoleOut.c | 672 -------------------- Nt32Pkg/WinNtConsoleDxe/WinNtConsole.msa | 85 --- Nt32Pkg/WinNtConsoleDxe/WinNtConsoleDxe.inf | 68 -- 9 files changed, 2459 deletions(-) delete mode 100644 Nt32Pkg/WinNtConsoleDxe/ComponentName.c delete mode 100644 Nt32Pkg/WinNtConsoleDxe/Console.c delete mode 100644 Nt32Pkg/WinNtConsoleDxe/Console.h delete mode 100644 Nt32Pkg/WinNtConsoleDxe/ConsoleIn.c delete mode 100644 Nt32Pkg/WinNtConsoleDxe/ConsoleOut.c delete mode 100644 Nt32Pkg/WinNtConsoleDxe/WinNtConsole.msa delete mode 100644 Nt32Pkg/WinNtConsoleDxe/WinNtConsoleDxe.inf diff --git a/Nt32Pkg/Nt32Pkg.dsc b/Nt32Pkg/Nt32Pkg.dsc index a3fe4452af..c0aed8cf20 100644 --- a/Nt32Pkg/Nt32Pkg.dsc +++ b/Nt32Pkg/Nt32Pkg.dsc @@ -441,7 +441,6 @@ IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/IdeBusDxe.inf Nt32Pkg/WinNtBusDriverDxe/WinNtBusDriverDxe.inf Nt32Pkg/WinNtBlockIoDxe/WinNtBlockIoDxe.inf - Nt32Pkg/WinNtConsoleDxe/WinNtConsoleDxe.inf Nt32Pkg/WinNtSerialIoDxe/WinNtSerialIoDxe.inf Nt32Pkg/WinNtGopDxe/WinNtGopDxe.inf Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystemDxe.inf diff --git a/Nt32Pkg/Nt32Pkg.fdf b/Nt32Pkg/Nt32Pkg.fdf index 4c519e1727..b5729a8c26 100644 --- a/Nt32Pkg/Nt32Pkg.fdf +++ b/Nt32Pkg/Nt32Pkg.fdf @@ -186,7 +186,6 @@ INF MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf ##This driver follows INF IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/IdeBusDxe.inf INF Nt32Pkg/WinNtBusDriverDxe/WinNtBusDriverDxe.inf INF Nt32Pkg/WinNtBlockIoDxe/WinNtBlockIoDxe.inf -INF Nt32Pkg/WinNtConsoleDxe/WinNtConsoleDxe.inf INF Nt32Pkg/WinNtSerialIoDxe/WinNtSerialIoDxe.inf INF Nt32Pkg/WinNtGopDxe/WinNtGopDxe.inf INF Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystemDxe.inf diff --git a/Nt32Pkg/WinNtConsoleDxe/ComponentName.c b/Nt32Pkg/WinNtConsoleDxe/ComponentName.c deleted file mode 100644 index 0087ac3bef..0000000000 --- a/Nt32Pkg/WinNtConsoleDxe/ComponentName.c +++ /dev/null @@ -1,378 +0,0 @@ -/*++ - -Copyright (c) 2006, Intel Corporation -All rights reserved. This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -Module Name: - - ComponentName.c - -Abstract: - ---*/ -// -// The package level header files this module uses -// -#include -#include -// -// The protocols, PPI and GUID defintions for this module -// -#include -#include -#include -#include -#include -// -// The Library classes this module consumes -// -#include -#include -#include -#include -#include -#include -#include - -#include "Console.h" - -// -// EFI Component Name Functions -// -/** - Retrieves a Unicode string that is the user readable name of the driver. - - This function retrieves the user readable name of a driver in the form of a - Unicode string. If the driver specified by This has a user readable name in - the language specified by Language, then a pointer to the driver name is - returned in DriverName, and EFI_SUCCESS is returned. If the driver specified - by This does not support the language specified by Language, - then EFI_UNSUPPORTED is returned. - - @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or - EFI_COMPONENT_NAME_PROTOCOL instance. - - @param Language[in] A pointer to a Null-terminated ASCII string - array indicating the language. This is the - language of the driver name that the caller is - requesting, and it must match one of the - languages specified in SupportedLanguages. The - number of languages supported by a driver is up - to the driver writer. Language is specified - in RFC 3066 or ISO 639-2 language code format. - - @param DriverName[out] A pointer to the Unicode string to return. - This Unicode string is the name of the - driver specified by This in the language - specified by Language. - - @retval EFI_SUCCESS The Unicode string for the Driver specified by - This and the language specified by Language was - returned in DriverName. - - @retval EFI_INVALID_PARAMETER Language is NULL. - - @retval EFI_INVALID_PARAMETER DriverName is NULL. - - @retval EFI_UNSUPPORTED The driver specified by This does not support - the language specified by Language. - -**/ -EFI_STATUS -EFIAPI -WinNtConsoleComponentNameGetDriverName ( - IN EFI_COMPONENT_NAME_PROTOCOL *This, - IN CHAR8 *Language, - OUT CHAR16 **DriverName - ); - - -/** - Retrieves a Unicode string that is the user readable name of the controller - that is being managed by a driver. - - This function retrieves the user readable name of the controller specified by - ControllerHandle and ChildHandle in the form of a Unicode string. If the - driver specified by This has a user readable name in the language specified by - Language, then a pointer to the controller name is returned in ControllerName, - and EFI_SUCCESS is returned. If the driver specified by This is not currently - managing the controller specified by ControllerHandle and ChildHandle, - then EFI_UNSUPPORTED is returned. If the driver specified by This does not - support the language specified by Language, then EFI_UNSUPPORTED is returned. - - @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or - EFI_COMPONENT_NAME_PROTOCOL instance. - - @param ControllerHandle[in] The handle of a controller that the driver - specified by This is managing. This handle - specifies the controller whose name is to be - returned. - - @param ChildHandle[in] The handle of the child controller to retrieve - the name of. This is an optional parameter that - may be NULL. It will be NULL for device - drivers. It will also be NULL for a bus drivers - that wish to retrieve the name of the bus - controller. It will not be NULL for a bus - driver that wishes to retrieve the name of a - child controller. - - @param Language[in] A pointer to a Null-terminated ASCII string - array indicating the language. This is the - language of the driver name that the caller is - requesting, and it must match one of the - languages specified in SupportedLanguages. The - number of languages supported by a driver is up - to the driver writer. Language is specified in - RFC 3066 or ISO 639-2 language code format. - - @param ControllerName[out] A pointer to the Unicode string to return. - This Unicode string is the name of the - controller specified by ControllerHandle and - ChildHandle in the language specified by - Language from the point of view of the driver - specified by This. - - @retval EFI_SUCCESS The Unicode string for the user readable name in - the language specified by Language for the - driver specified by This was returned in - DriverName. - - @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE. - - @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid - EFI_HANDLE. - - @retval EFI_INVALID_PARAMETER Language is NULL. - - @retval EFI_INVALID_PARAMETER ControllerName is NULL. - - @retval EFI_UNSUPPORTED The driver specified by This is not currently - managing the controller specified by - ControllerHandle and ChildHandle. - - @retval EFI_UNSUPPORTED The driver specified by This does not support - the language specified by Language. - -**/ -EFI_STATUS -EFIAPI -WinNtConsoleComponentNameGetControllerName ( - IN EFI_COMPONENT_NAME_PROTOCOL *This, - IN EFI_HANDLE ControllerHandle, - IN EFI_HANDLE ChildHandle OPTIONAL, - IN CHAR8 *Language, - OUT CHAR16 **ControllerName - ); - - -// -// EFI Component Name Protocol -// -GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gWinNtConsoleComponentName = { - WinNtConsoleComponentNameGetDriverName, - WinNtConsoleComponentNameGetControllerName, - "eng" -}; - -// -// EFI Component Name 2 Protocol -// -GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gWinNtConsoleComponentName2 = { - (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) WinNtConsoleComponentNameGetDriverName, - (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) WinNtConsoleComponentNameGetControllerName, - "en" -}; - - -GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mWinNtConsoleDriverNameTable[] = { - { "eng;en", L"Windows Text Console Driver" }, - { NULL , NULL } -}; - -/** - Retrieves a Unicode string that is the user readable name of the driver. - - This function retrieves the user readable name of a driver in the form of a - Unicode string. If the driver specified by This has a user readable name in - the language specified by Language, then a pointer to the driver name is - returned in DriverName, and EFI_SUCCESS is returned. If the driver specified - by This does not support the language specified by Language, - then EFI_UNSUPPORTED is returned. - - @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or - EFI_COMPONENT_NAME_PROTOCOL instance. - - @param Language[in] A pointer to a Null-terminated ASCII string - array indicating the language. This is the - language of the driver name that the caller is - requesting, and it must match one of the - languages specified in SupportedLanguages. The - number of languages supported by a driver is up - to the driver writer. Language is specified - in RFC 3066 or ISO 639-2 language code format. - - @param DriverName[out] A pointer to the Unicode string to return. - This Unicode string is the name of the - driver specified by This in the language - specified by Language. - - @retval EFI_SUCCESS The Unicode string for the Driver specified by - This and the language specified by Language was - returned in DriverName. - - @retval EFI_INVALID_PARAMETER Language is NULL. - - @retval EFI_INVALID_PARAMETER DriverName is NULL. - - @retval EFI_UNSUPPORTED The driver specified by This does not support - the language specified by Language. - -**/ -EFI_STATUS -EFIAPI -WinNtConsoleComponentNameGetDriverName ( - IN EFI_COMPONENT_NAME_PROTOCOL *This, - IN CHAR8 *Language, - OUT CHAR16 **DriverName - ) -{ - return LookupUnicodeString2 ( - Language, - This->SupportedLanguages, - mWinNtConsoleDriverNameTable, - DriverName, - (BOOLEAN)(This == &gWinNtConsoleComponentName) - ); -} - -/** - Retrieves a Unicode string that is the user readable name of the controller - that is being managed by a driver. - - This function retrieves the user readable name of the controller specified by - ControllerHandle and ChildHandle in the form of a Unicode string. If the - driver specified by This has a user readable name in the language specified by - Language, then a pointer to the controller name is returned in ControllerName, - and EFI_SUCCESS is returned. If the driver specified by This is not currently - managing the controller specified by ControllerHandle and ChildHandle, - then EFI_UNSUPPORTED is returned. If the driver specified by This does not - support the language specified by Language, then EFI_UNSUPPORTED is returned. - - @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or - EFI_COMPONENT_NAME_PROTOCOL instance. - - @param ControllerHandle[in] The handle of a controller that the driver - specified by This is managing. This handle - specifies the controller whose name is to be - returned. - - @param ChildHandle[in] The handle of the child controller to retrieve - the name of. This is an optional parameter that - may be NULL. It will be NULL for device - drivers. It will also be NULL for a bus drivers - that wish to retrieve the name of the bus - controller. It will not be NULL for a bus - driver that wishes to retrieve the name of a - child controller. - - @param Language[in] A pointer to a Null-terminated ASCII string - array indicating the language. This is the - language of the driver name that the caller is - requesting, and it must match one of the - languages specified in SupportedLanguages. The - number of languages supported by a driver is up - to the driver writer. Language is specified in - RFC 3066 or ISO 639-2 language code format. - - @param ControllerName[out] A pointer to the Unicode string to return. - This Unicode string is the name of the - controller specified by ControllerHandle and - ChildHandle in the language specified by - Language from the point of view of the driver - specified by This. - - @retval EFI_SUCCESS The Unicode string for the user readable name in - the language specified by Language for the - driver specified by This was returned in - DriverName. - - @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE. - - @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid - EFI_HANDLE. - - @retval EFI_INVALID_PARAMETER Language is NULL. - - @retval EFI_INVALID_PARAMETER ControllerName is NULL. - - @retval EFI_UNSUPPORTED The driver specified by This is not currently - managing the controller specified by - ControllerHandle and ChildHandle. - - @retval EFI_UNSUPPORTED The driver specified by This does not support - the language specified by Language. - -**/ -EFI_STATUS -EFIAPI -WinNtConsoleComponentNameGetControllerName ( - IN EFI_COMPONENT_NAME_PROTOCOL *This, - IN EFI_HANDLE ControllerHandle, - IN EFI_HANDLE ChildHandle OPTIONAL, - IN CHAR8 *Language, - OUT CHAR16 **ControllerName - ) -{ - EFI_STATUS Status; - EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *SimpleTextOut; - WIN_NT_SIMPLE_TEXT_PRIVATE_DATA *Private; - - // - // This is a device driver, so ChildHandle must be NULL. - // - if (ChildHandle != NULL) { - return EFI_UNSUPPORTED; - } - // - // Make sure this driver is currently managing ControllerHandle - // - Status = EfiTestManagedDevice ( - ControllerHandle, - gWinNtConsoleDriverBinding.DriverBindingHandle, - &gEfiWinNtIoProtocolGuid - ); - if (EFI_ERROR (Status)) { - return EFI_UNSUPPORTED; - } - // - // Get out context back - // - Status = gBS->OpenProtocol ( - ControllerHandle, - &gEfiSimpleTextOutProtocolGuid, - &SimpleTextOut, - gWinNtConsoleDriverBinding.DriverBindingHandle, - ControllerHandle, - EFI_OPEN_PROTOCOL_GET_PROTOCOL - ); - if (EFI_ERROR (Status)) { - return EFI_UNSUPPORTED; - } - - Private = WIN_NT_SIMPLE_TEXT_OUT_PRIVATE_DATA_FROM_THIS (SimpleTextOut); - - return LookupUnicodeString2 ( - Language, - This->SupportedLanguages, - Private->ControllerNameTable, - ControllerName, - (BOOLEAN)(This == &gWinNtConsoleComponentName) - ); -} diff --git a/Nt32Pkg/WinNtConsoleDxe/Console.c b/Nt32Pkg/WinNtConsoleDxe/Console.c deleted file mode 100644 index bbec72e3aa..0000000000 --- a/Nt32Pkg/WinNtConsoleDxe/Console.c +++ /dev/null @@ -1,363 +0,0 @@ -/*++ - -Copyright (c) 2006 - 2007, Intel Corporation -All rights reserved. This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -Module Name: - - Console.c - -Abstract: - - Console based on Win32 APIs. - ---*/ - -// -// The package level header files this module uses -// -#include -#include -// -// The protocols, PPI and GUID defintions for this module -// -#include -#include -#include -#include -#include -// -// The Library classes this module consumes -// -#include -#include -#include -#include -#include -#include -#include - -#include "Console.h" - -EFI_STATUS -EFIAPI -WinNtConsoleDriverBindingSupported ( - IN EFI_DRIVER_BINDING_PROTOCOL *This, - IN EFI_HANDLE Handle, - IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath - ); - -EFI_STATUS -EFIAPI -WinNtConsoleDriverBindingStart ( - IN EFI_DRIVER_BINDING_PROTOCOL *This, - IN EFI_HANDLE Handle, - IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath - ); - -EFI_STATUS -EFIAPI -WinNtConsoleDriverBindingStop ( - IN EFI_DRIVER_BINDING_PROTOCOL *This, - IN EFI_HANDLE Handle, - IN UINTN NumberOfChildren, - IN EFI_HANDLE *ChildHandleBuffer - ); - -EFI_DRIVER_BINDING_PROTOCOL gWinNtConsoleDriverBinding = { - WinNtConsoleDriverBindingSupported, - WinNtConsoleDriverBindingStart, - WinNtConsoleDriverBindingStop, - 0xa, - NULL, - NULL -}; - -/** - The user Entry Point for module WinNtConsole. The user code starts with this function. - - @param[in] ImageHandle The firmware allocated handle for the EFI image. - @param[in] SystemTable A pointer to the EFI System Table. - - @retval EFI_SUCCESS The entry point is executed successfully. - @retval other Some error occurs when executing this entry point. - -**/ -EFI_STATUS -EFIAPI -InitializeWinNtConsole( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - ) -{ - EFI_STATUS Status; - - // - // Install driver model protocol(s). - // - Status = EfiLibInstallDriverBindingComponentName2 ( - ImageHandle, - SystemTable, - &gWinNtConsoleDriverBinding, - ImageHandle, - &gWinNtConsoleComponentName, - &gWinNtConsoleComponentName2 - ); - ASSERT_EFI_ERROR (Status); - - - return Status; -} - - -EFI_STATUS -EFIAPI -WinNtConsoleDriverBindingSupported ( - IN EFI_DRIVER_BINDING_PROTOCOL *This, - IN EFI_HANDLE Handle, - IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath - ) -/*++ - -Routine Description: - -Arguments: - -Returns: - - None - ---*/ -// TODO: This - add argument and description to function comment -// TODO: Handle - add argument and description to function comment -// TODO: RemainingDevicePath - add argument and description to function comment -{ - EFI_STATUS Status; - EFI_WIN_NT_IO_PROTOCOL *WinNtIo; - - // - // Open the IO Abstraction(s) needed to perform the supported test - // - Status = gBS->OpenProtocol ( - Handle, - &gEfiWinNtIoProtocolGuid, - &WinNtIo, - This->DriverBindingHandle, - Handle, - EFI_OPEN_PROTOCOL_BY_DRIVER - ); - if (EFI_ERROR (Status)) { - return Status; - } - - // - // Make sure that the WinNt Thunk Protocol is valid - // - Status = EFI_UNSUPPORTED; - if (WinNtIo->WinNtThunk->Signature == EFI_WIN_NT_THUNK_PROTOCOL_SIGNATURE) { - - // - // Check the GUID to see if this is a handle type the driver supports - // - if (CompareGuid (WinNtIo->TypeGuid, &gEfiWinNtConsoleGuid)) { - Status = EFI_SUCCESS; - } - } - - // - // Close the I/O Abstraction(s) used to perform the supported test - // - gBS->CloseProtocol ( - Handle, - &gEfiWinNtIoProtocolGuid, - This->DriverBindingHandle, - Handle - ); - - return Status; -} - -EFI_STATUS -EFIAPI -WinNtConsoleDriverBindingStart ( - IN EFI_DRIVER_BINDING_PROTOCOL *This, - IN EFI_HANDLE Handle, - IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath - ) -/*++ - -Routine Description: - -Arguments: - -Returns: - - None - ---*/ -// TODO: This - add argument and description to function comment -// TODO: Handle - add argument and description to function comment -// TODO: RemainingDevicePath - add argument and description to function comment -{ - EFI_STATUS Status; - EFI_WIN_NT_IO_PROTOCOL *WinNtIo; - WIN_NT_SIMPLE_TEXT_PRIVATE_DATA *Private; - - // - // Grab the IO abstraction we need to get any work done - // - Status = gBS->OpenProtocol ( - Handle, - &gEfiWinNtIoProtocolGuid, - &WinNtIo, - This->DriverBindingHandle, - Handle, - EFI_OPEN_PROTOCOL_BY_DRIVER - ); - if (EFI_ERROR (Status)) { - return Status; - } - - Private = AllocatePool (sizeof (WIN_NT_SIMPLE_TEXT_PRIVATE_DATA)); - if (Private == NULL) { - goto Done; - } - - ZeroMem (Private, sizeof (WIN_NT_SIMPLE_TEXT_PRIVATE_DATA)); - - Private->Signature = WIN_NT_SIMPLE_TEXT_PRIVATE_DATA_SIGNATURE; - Private->Handle = Handle; - Private->WinNtIo = WinNtIo; - Private->WinNtThunk = WinNtIo->WinNtThunk; - - WinNtSimpleTextOutOpenWindow (Private); - WinNtSimpleTextInAttachToWindow (Private); - - Status = gBS->InstallMultipleProtocolInterfaces ( - &Handle, - &gEfiSimpleTextOutProtocolGuid, - &Private->SimpleTextOut, - &gEfiSimpleTextInProtocolGuid, - &Private->SimpleTextIn, - NULL - ); - if (!EFI_ERROR (Status)) { - return Status; - } - -Done: - gBS->CloseProtocol ( - Handle, - &gEfiWinNtIoProtocolGuid, - This->DriverBindingHandle, - Handle - ); - if (Private != NULL) { - - FreeUnicodeStringTable (Private->ControllerNameTable); - - if (Private->NtOutHandle != NULL) { - Private->WinNtThunk->CloseHandle (Private->NtOutHandle); - } - - if (Private->SimpleTextIn.WaitForKey != NULL) { - gBS->CloseEvent (Private->SimpleTextIn.WaitForKey); - } - - FreePool (Private); - } - - return Status; -} - -EFI_STATUS -EFIAPI -WinNtConsoleDriverBindingStop ( - IN EFI_DRIVER_BINDING_PROTOCOL *This, - IN EFI_HANDLE Handle, - IN UINTN NumberOfChildren, - IN EFI_HANDLE *ChildHandleBuffer - ) -/*++ - -Routine Description: - - TODO: Add function description - -Arguments: - - This - TODO: add argument description - Handle - TODO: add argument description - NumberOfChildren - TODO: add argument description - ChildHandleBuffer - TODO: add argument description - -Returns: - - EFI_UNSUPPORTED - TODO: Add description for return value - ---*/ -{ - EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *SimpleTextOut; - EFI_STATUS Status; - WIN_NT_SIMPLE_TEXT_PRIVATE_DATA *Private; - - // - // Kick people off our interface??? - // - Status = gBS->OpenProtocol ( - Handle, - &gEfiSimpleTextOutProtocolGuid, - &SimpleTextOut, - This->DriverBindingHandle, - Handle, - EFI_OPEN_PROTOCOL_GET_PROTOCOL - ); - if (EFI_ERROR (Status)) { - return EFI_UNSUPPORTED; - } - - Private = WIN_NT_SIMPLE_TEXT_OUT_PRIVATE_DATA_FROM_THIS (SimpleTextOut); - - ASSERT (Private->Handle == Handle); - - Status = gBS->UninstallMultipleProtocolInterfaces ( - Handle, - &gEfiSimpleTextOutProtocolGuid, - &Private->SimpleTextOut, - &gEfiSimpleTextInProtocolGuid, - &Private->SimpleTextIn, - NULL - ); - if (!EFI_ERROR (Status)) { - - // - // Shut down our device - // - Status = gBS->CloseProtocol ( - Handle, - &gEfiWinNtIoProtocolGuid, - This->DriverBindingHandle, - Handle - ); - - Status = gBS->CloseEvent (Private->SimpleTextIn.WaitForKey); - ASSERT_EFI_ERROR (Status); - - Private->WinNtThunk->CloseHandle (Private->NtOutHandle); - // - // DO NOT close Private->NtInHandle. It points to StdIn and not - // the Private->NtOutHandle is StdIn and should not be closed! - // - FreeUnicodeStringTable (Private->ControllerNameTable); - - FreePool (Private); - } - - return Status; -} diff --git a/Nt32Pkg/WinNtConsoleDxe/Console.h b/Nt32Pkg/WinNtConsoleDxe/Console.h deleted file mode 100644 index 1cad6b886b..0000000000 --- a/Nt32Pkg/WinNtConsoleDxe/Console.h +++ /dev/null @@ -1,512 +0,0 @@ -/*++ - -Copyright (c) 2006, Intel Corporation -All rights reserved. This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -Module Name: - - Console.h - -Abstract: - - Console based on Win32 APIs. - - This file attaches a SimpleTextIn protocol to a previously open window. - - The constructor for this protocol depends on an open window. Currently - the SimpleTextOut protocol creates a window when it's constructor is called. - Thus this code must run after the constructor for the SimpleTextOut - protocol - ---*/ - -#ifndef _CONSOLE_H_ -#define _CONSOLE_H_ - - -#define WIN_NT_SIMPLE_TEXT_PRIVATE_DATA_SIGNATURE \ - EFI_SIGNATURE_32('N','T','s','c') - -typedef struct { - UINT64 Signature; - - EFI_HANDLE Handle; - - EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL SimpleTextOut; - EFI_SIMPLE_TEXT_OUTPUT_MODE SimpleTextOutMode; - - EFI_WIN_NT_IO_PROTOCOL *WinNtIo; - EFI_WIN_NT_THUNK_PROTOCOL *WinNtThunk; - - // - // SimpleTextOut Private Data including Win32 types. - // - HANDLE NtOutHandle; - HANDLE NtInHandle; - - COORD MaxScreenSize; - COORD Possition; - WORD Attribute; - BOOLEAN CursorEnable; - - EFI_SIMPLE_TEXT_INPUT_PROTOCOL SimpleTextIn; - - EFI_UNICODE_STRING_TABLE *ControllerNameTable; - -} WIN_NT_SIMPLE_TEXT_PRIVATE_DATA; - -#define WIN_NT_SIMPLE_TEXT_OUT_PRIVATE_DATA_FROM_THIS(a) \ - CR(a, WIN_NT_SIMPLE_TEXT_PRIVATE_DATA, SimpleTextOut, WIN_NT_SIMPLE_TEXT_PRIVATE_DATA_SIGNATURE) - -#define WIN_NT_SIMPLE_TEXT_IN_PRIVATE_DATA_FROM_THIS(a) \ - CR(a, WIN_NT_SIMPLE_TEXT_PRIVATE_DATA, SimpleTextIn, WIN_NT_SIMPLE_TEXT_PRIVATE_DATA_SIGNATURE) - -// -// Console Globale Variables -// -extern EFI_DRIVER_BINDING_PROTOCOL gWinNtConsoleDriverBinding; -extern EFI_COMPONENT_NAME_PROTOCOL gWinNtConsoleComponentName; -extern EFI_COMPONENT_NAME2_PROTOCOL gWinNtConsoleComponentName2; - -typedef struct { - UINTN ColumnsX; - UINTN RowsY; -} WIN_NT_SIMPLE_TEXT_OUT_MODE; - -// -// Simple Text Out protocol member functions -// - -STATIC -EFI_STATUS -EFIAPI -WinNtSimpleTextOutReset ( - IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, - IN BOOLEAN ExtendedVerification - ) -/*++ - -Routine Description: - - TODO: Add function description - -Arguments: - - This - TODO: add argument description - ExtendedVerification - TODO: add argument description - -Returns: - - TODO: add return values - ---*/ -; - -STATIC -EFI_STATUS -EFIAPI -WinNtSimpleTextOutOutputString ( - IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, - IN CHAR16 *String - ) -/*++ - -Routine Description: - - TODO: Add function description - -Arguments: - - This - TODO: add argument description - String - TODO: add argument description - -Returns: - - TODO: add return values - ---*/ -; - -STATIC -EFI_STATUS -EFIAPI -WinNtSimpleTextOutTestString ( - IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, - IN CHAR16 *String - ) -/*++ - -Routine Description: - - TODO: Add function description - -Arguments: - - This - TODO: add argument description - String - TODO: add argument description - -Returns: - - TODO: add return values - ---*/ -; - -STATIC -EFI_STATUS -EFIAPI -WinNtSimpleTextOutQueryMode ( - IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, - IN UINTN ModeNumber, - OUT UINTN *Columns, - OUT UINTN *Rows - ) -/*++ - -Routine Description: - - TODO: Add function description - -Arguments: - - This - TODO: add argument description - ModeNumber - TODO: add argument description - Columns - TODO: add argument description - Rows - TODO: add argument description - -Returns: - - TODO: add return values - ---*/ -; - -STATIC -EFI_STATUS -EFIAPI -WinNtSimpleTextOutSetMode ( - IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, - IN UINTN ModeNumber - ) -/*++ - -Routine Description: - - TODO: Add function description - -Arguments: - - This - TODO: add argument description - ModeNumber - TODO: add argument description - -Returns: - - TODO: add return values - ---*/ -; - -STATIC -EFI_STATUS -EFIAPI -WinNtSimpleTextOutSetAttribute ( - IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, - IN UINTN Attribute - ) -/*++ - -Routine Description: - - TODO: Add function description - -Arguments: - - This - TODO: add argument description - Attribute - TODO: add argument description - -Returns: - - TODO: add return values - ---*/ -; - -STATIC -EFI_STATUS -EFIAPI -WinNtSimpleTextOutClearScreen ( - IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This - ) -/*++ - -Routine Description: - - TODO: Add function description - -Arguments: - - This - TODO: add argument description - -Returns: - - TODO: add return values - ---*/ -; - -STATIC -EFI_STATUS -EFIAPI -WinNtSimpleTextOutSetCursorPosition ( - IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, - IN UINTN Column, - IN UINTN Row - ) -/*++ - -Routine Description: - - TODO: Add function description - -Arguments: - - This - TODO: add argument description - Column - TODO: add argument description - Row - TODO: add argument description - -Returns: - - TODO: add return values - ---*/ -; - -STATIC -EFI_STATUS -EFIAPI -WinNtSimpleTextOutEnableCursor ( - IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, - IN BOOLEAN Enable - ) -/*++ - -Routine Description: - - TODO: Add function description - -Arguments: - - This - TODO: add argument description - Enable - TODO: add argument description - -Returns: - - TODO: add return values - ---*/ -; - -// -// Simple Text Out constructor and destructor. -// -EFI_STATUS -WinNtSimpleTextOutOpenWindow ( - IN OUT WIN_NT_SIMPLE_TEXT_PRIVATE_DATA *Private - ) -/*++ - -Routine Description: - - TODO: Add function description - -Arguments: - - Private - TODO: add argument description - -Returns: - - TODO: add return values - ---*/ -; - -EFI_STATUS -WinNtSimpleTextOutCloseWindow ( - IN OUT WIN_NT_SIMPLE_TEXT_PRIVATE_DATA *Console - ) -/*++ - -Routine Description: - - TODO: Add function description - -Arguments: - - Console - TODO: add argument description - -Returns: - - TODO: add return values - ---*/ -; - -// -// Simple Text In protocol member functions. -// -STATIC -EFI_STATUS -EFIAPI -WinNtSimpleTextInReset ( - IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This, - IN BOOLEAN ExtendedVerification - ) -/*++ - -Routine Description: - - TODO: Add function description - -Arguments: - - This - TODO: add argument description - ExtendedVerification - TODO: add argument description - -Returns: - - TODO: add return values - ---*/ -; - -STATIC -EFI_STATUS -EFIAPI -WinNtSimpleTextInReadKeyStroke ( - IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This, - OUT EFI_INPUT_KEY *Key - ) -/*++ - -Routine Description: - - TODO: Add function description - -Arguments: - - This - TODO: add argument description - Key - TODO: add argument description - -Returns: - - TODO: add return values - ---*/ -; - -STATIC -VOID -EFIAPI -WinNtSimpleTextInWaitForKey ( - IN EFI_EVENT Event, - IN VOID *Context - ) -/*++ - -Routine Description: - - TODO: Add function description - -Arguments: - - Event - TODO: add argument description - Context - TODO: add argument description - -Returns: - - TODO: add return values - ---*/ -; - -// -// Simple Text In constructor -// -EFI_STATUS -WinNtSimpleTextInAttachToWindow ( - IN WIN_NT_SIMPLE_TEXT_PRIVATE_DATA *Private - ) -/*++ - -Routine Description: - - TODO: Add function description - -Arguments: - - Private - TODO: add argument description - -Returns: - - TODO: add return values - ---*/ -; - -// -// Main Entry Point -// -EFI_STATUS -EFIAPI -InitializeWinNtConsole ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - ) -/*++ - -Routine Description: - - TODO: Add function description - -Arguments: - - ImageHandle - TODO: add argument description - SystemTable - TODO: add argument description - -Returns: - - TODO: add return values - ---*/ -; - -EFI_STATUS -AppendDevicePathInstanceToVar ( - IN CHAR16 *VariableName, - IN EFI_DEVICE_PATH_PROTOCOL *DevicePathInstance - ) -/*++ - -Routine Description: - - TODO: Add function description - -Arguments: - - VariableName - TODO: add argument description - DevicePathInstance - TODO: add argument description - -Returns: - - TODO: add return values - ---*/ -; - -#endif diff --git a/Nt32Pkg/WinNtConsoleDxe/ConsoleIn.c b/Nt32Pkg/WinNtConsoleDxe/ConsoleIn.c deleted file mode 100644 index 4f00f8b15d..0000000000 --- a/Nt32Pkg/WinNtConsoleDxe/ConsoleIn.c +++ /dev/null @@ -1,379 +0,0 @@ -/*++ - -Copyright (c) 2006 - 2007, Intel Corporation -All rights reserved. This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -Module Name: - - ConsoleIn.c - -Abstract: - - Console based on Win32 APIs. - - This file attaches a SimpleTextIn protocol to a previously open window. - - The constructor for this protocol depends on an open window. Currently - the SimpleTextOut protocol creates a window when it's constructor is called. - Thus this code must run after the constructor for the SimpleTextOut - protocol - ---*/ -// -// The package level header files this module uses -// -#include -#include -// -// The protocols, PPI and GUID defintions for this module -// -#include -#include -#include -#include -#include -// -// The Library classes this module consumes -// -#include -#include -#include -#include -#include -#include -#include -#include "Console.h" - -// -// Private worker functions -// -STATIC -EFI_STATUS -WinNtSimpleTextInCheckKey ( - WIN_NT_SIMPLE_TEXT_PRIVATE_DATA *Private - ); - -EFI_STATUS -EFIAPI -WinNtSimpleTextInReset ( - IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This, - IN BOOLEAN ExtendedVerification - ) -/*++ - -Routine Description: - - TODO: Add function description - -Arguments: - - This - TODO: add argument description - ExtendedVerification - TODO: add argument description - -Returns: - - EFI_SUCCESS - TODO: Add description for return value - ---*/ -{ - WIN_NT_SIMPLE_TEXT_PRIVATE_DATA *Private; - - Private = WIN_NT_SIMPLE_TEXT_IN_PRIVATE_DATA_FROM_THIS (This); - return EFI_SUCCESS; -} - -STATIC -EFI_STATUS -WinNtConvertInputRecordToEfiKey ( - IN INPUT_RECORD *InputRecord, - OUT EFI_INPUT_KEY *Key - ) -/*++ - -Routine Description: - - TODO: Add function description - -Arguments: - - InputRecord - TODO: add argument description - Key - TODO: add argument description - -Returns: - - EFI_NOT_READY - TODO: Add description for return value - EFI_NOT_READY - TODO: Add description for return value - EFI_NOT_READY - TODO: Add description for return value - EFI_SUCCESS - TODO: Add description for return value - ---*/ -{ - // - // Make sure InputRecord is an event that represents a keypress - // - if (InputRecord->EventType == KEY_EVENT) { - if (!InputRecord->Event.KeyEvent.bKeyDown) { - return EFI_NOT_READY; - } - } else { - return EFI_NOT_READY; - } - - // - // Check to see if we should return a scan code in place of Unicode character. - // - Key->ScanCode = 0; - Key->UnicodeChar = 0; - if ((InputRecord->Event.KeyEvent.dwControlKeyState & (NUMLOCK_ON | ENHANCED_KEY)) != NUMLOCK_ON) { - // - // Only check these scan codes if num lock is off. - // - switch (InputRecord->Event.KeyEvent.wVirtualScanCode) { - case 0x48: Key->ScanCode = SCAN_UP; break; - case 0x50: Key->ScanCode = SCAN_DOWN; break; - case 0x4d: Key->ScanCode = SCAN_RIGHT; break; - case 0x4b: Key->ScanCode = SCAN_LEFT; break; - case 0x47: Key->ScanCode = SCAN_HOME; break; - case 0x4F: Key->ScanCode = SCAN_END; break; - case 0x52: Key->ScanCode = SCAN_INSERT; break; - case 0x53: Key->ScanCode = SCAN_DELETE; break; - case 0x49: Key->ScanCode = SCAN_PAGE_UP; break; - case 0x51: Key->ScanCode = SCAN_PAGE_DOWN; break; - } - } - - switch (InputRecord->Event.KeyEvent.wVirtualScanCode) { - case 0x3b: Key->ScanCode = SCAN_F1; break; - case 0x3c: Key->ScanCode = SCAN_F2; break; - case 0x3d: Key->ScanCode = SCAN_F3; break; - case 0x3e: Key->ScanCode = SCAN_F4; break; - case 0x3f: Key->ScanCode = SCAN_F5; break; - case 0x40: Key->ScanCode = SCAN_F6; break; - case 0x41: Key->ScanCode = SCAN_F7; break; - case 0x42: Key->ScanCode = SCAN_F8; break; - case 0x43: Key->ScanCode = SCAN_F9; break; - case 0x44: Key->ScanCode = SCAN_F10; break; - case 0x01: Key->ScanCode = SCAN_ESC; break; - } - - // - // If there's a scan code pass it, and don't pass the char code - // - if (Key->ScanCode == 0) { - Key->UnicodeChar = InputRecord->Event.KeyEvent.uChar.UnicodeChar; - if (Key->UnicodeChar == 0) { - return EFI_NOT_READY; - } - } - - return EFI_SUCCESS; -} - -STATIC -EFI_STATUS -EFIAPI -WinNtSimpleTextInReadKeyStroke ( - IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This, - OUT EFI_INPUT_KEY *Key - ) -/*++ - -Routine Description: - - TODO: Add function description - -Arguments: - - This - TODO: add argument description - Key - TODO: add argument description - -Returns: - - EFI_DEVICE_ERROR - TODO: Add description for return value - EFI_NOT_READY - TODO: Add description for return value - ---*/ -{ - EFI_STATUS Status; - WIN_NT_SIMPLE_TEXT_PRIVATE_DATA *Private; - INPUT_RECORD InputRecord; - DWORD NtEventCount; - - Private = WIN_NT_SIMPLE_TEXT_IN_PRIVATE_DATA_FROM_THIS (This); - - Status = WinNtSimpleTextInCheckKey (Private); - if (EFI_ERROR (Status)) { - return Status; - } - - do { - - if (!Private->WinNtThunk->ReadConsoleInput (Private->NtInHandle, &InputRecord, 1, &NtEventCount)) { - return EFI_DEVICE_ERROR; - } - - if (NtEventCount == 0) { - return EFI_NOT_READY; - } - - // - // Convert the Input Record to an EFI Keystroke. - // - Status = WinNtConvertInputRecordToEfiKey (&InputRecord, Key); - } while (EFI_ERROR (Status)); - - return Status; -} - -STATIC -VOID -EFIAPI -WinNtSimpleTextInWaitForKey ( - IN EFI_EVENT Event, - IN VOID *Context - ) -/*++ - -Routine Description: - - TODO: Add function description - -Arguments: - - Event - TODO: add argument description - Context - TODO: add argument description - -Returns: - - TODO: add return values - ---*/ -{ - WIN_NT_SIMPLE_TEXT_PRIVATE_DATA *Private; - EFI_STATUS Status; - - Private = (WIN_NT_SIMPLE_TEXT_PRIVATE_DATA *) Context; - Status = WinNtSimpleTextInCheckKey (Private); - if (!EFI_ERROR (Status)) { - gBS->SignalEvent (Event); - } -} - -STATIC -EFI_STATUS -WinNtSimpleTextInCheckKey ( - WIN_NT_SIMPLE_TEXT_PRIVATE_DATA *Private - ) -/*++ - -Routine Description: - - TODO: Add function description - -Arguments: - - Private - TODO: add argument description - -Returns: - - TODO: add return values - ---*/ -{ - INPUT_RECORD *InputRecord; - DWORD NtEventCount; - DWORD ActualNtEventCount; - EFI_STATUS Status; - BOOLEAN Success; - UINTN Index; - EFI_INPUT_KEY Key; - - InputRecord = NULL; - NtEventCount = 0; - Private->WinNtThunk->GetNumberOfConsoleInputEvents (Private->NtInHandle, &NtEventCount); - if (NtEventCount == 0) { - Status = EFI_NOT_READY; - goto Done; - } - - InputRecord = AllocatePool (sizeof (INPUT_RECORD) * NtEventCount); - if (InputRecord == NULL) { - Status = EFI_NOT_READY; - goto Done; - } - - Success = (BOOLEAN) Private->WinNtThunk->PeekConsoleInput ( - Private->NtInHandle, - InputRecord, - NtEventCount, - &ActualNtEventCount - ); - if (!Success) { - Status = EFI_NOT_READY; - goto Done; - } - - Status = EFI_NOT_READY; - for (Index = 0; Index < (UINTN) ActualNtEventCount; Index++) { - // - // Convert the Input Record to an EFI Keystroke. - // - Status = WinNtConvertInputRecordToEfiKey (&InputRecord[Index], &Key); - if (!EFI_ERROR (Status)) { - Status = EFI_SUCCESS; - goto Done; - } - } - -Done: - if (InputRecord != NULL) { - FreePool (InputRecord); - } - - return Status; -} - -EFI_STATUS -WinNtSimpleTextInAttachToWindow ( - IN WIN_NT_SIMPLE_TEXT_PRIVATE_DATA *Private - ) -/*++ - -Routine Description: - - TODO: Add function description - -Arguments: - - Private - TODO: add argument description - -Returns: - - TODO: add return values - ---*/ -{ - EFI_STATUS Status; - - Private->NtInHandle = Private->WinNtThunk->GetStdHandle (STD_INPUT_HANDLE); - - Private->SimpleTextIn.Reset = WinNtSimpleTextInReset; - Private->SimpleTextIn.ReadKeyStroke = WinNtSimpleTextInReadKeyStroke; - - Status = gBS->CreateEvent ( - EVT_NOTIFY_WAIT, - TPL_NOTIFY, - WinNtSimpleTextInWaitForKey, - Private, - &Private->SimpleTextIn.WaitForKey - ); - ASSERT_EFI_ERROR (Status); - - return Status; -} diff --git a/Nt32Pkg/WinNtConsoleDxe/ConsoleOut.c b/Nt32Pkg/WinNtConsoleDxe/ConsoleOut.c deleted file mode 100644 index 574c18a02d..0000000000 --- a/Nt32Pkg/WinNtConsoleDxe/ConsoleOut.c +++ /dev/null @@ -1,672 +0,0 @@ -/*++ - -Copyright (c) 2006, Intel Corporation -All rights reserved. This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -Module Name: - - ConsoleOut.c - -Abstract: - - Console based on Win32 APIs. - - This file creates an Win32 window and attaches a SimpleTextOut protocol. - ---*/ - -// -// The package level header files this module uses -// -#include -#include -// -// The protocols, PPI and GUID defintions for this module -// -#include -#include -#include -#include -#include -// -// The Library classes this module consumes -// -#include -#include -#include -#include -#include -#include -#include - - -#include "Console.h" -// -// Private worker functions. -// - -STATIC -VOID -WinNtSimpleTextOutScrollScreen ( - IN OUT WIN_NT_SIMPLE_TEXT_PRIVATE_DATA *Console - ); - -STATIC -VOID -WinNtSimpleTextOutPutChar ( - IN OUT WIN_NT_SIMPLE_TEXT_PRIVATE_DATA *Console, - IN CHAR16 Char - ); - -// -// Modeule Global for Simple Text Out Mode. -// -#define MAX_SIMPLE_TEXT_OUT_MODE \ - (sizeof(mWinNtSimpleTextOutSupportedModes)/sizeof(WIN_NT_SIMPLE_TEXT_OUT_MODE)) - -STATIC WIN_NT_SIMPLE_TEXT_OUT_MODE mWinNtSimpleTextOutSupportedModes[] = { - { 80, 25 }, - { 80, 50 }, - { 80, 43 }, - { 100, 100 }, - { 100, 999 } -}; - -STATIC -EFI_STATUS -EFIAPI -WinNtSimpleTextOutReset ( - IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, - IN BOOLEAN ExtendedVerification - ) -/*++ - -Routine Description: - - TODO: Add function description - -Arguments: - - This - TODO: add argument description - ExtendedVerification - TODO: add argument description - -Returns: - - EFI_SUCCESS - TODO: Add description for return value - ---*/ -{ - WIN_NT_SIMPLE_TEXT_PRIVATE_DATA *Private; - - Private = WIN_NT_SIMPLE_TEXT_OUT_PRIVATE_DATA_FROM_THIS (This); - - WinNtSimpleTextOutSetAttribute (This, EFI_TEXT_ATTR (This->Mode->Attribute & 0x0F, EFI_BACKGROUND_BLACK)); - - WinNtSimpleTextOutSetMode (This, 0); - return EFI_SUCCESS; -} - -STATIC -EFI_STATUS -EFIAPI -WinNtSimpleTextOutOutputString ( - IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, - IN CHAR16 *String - ) -/*++ - -Routine Description: - - TODO: Add function description - -Arguments: - - This - TODO: add argument description - String - TODO: add argument description - -Returns: - - EFI_SUCCESS - TODO: Add description for return value - ---*/ -{ - WIN_NT_SIMPLE_TEXT_PRIVATE_DATA *Private; - CHAR16 *Str; - - Private = WIN_NT_SIMPLE_TEXT_OUT_PRIVATE_DATA_FROM_THIS (This); - - for (Str = String; *Str != '\0'; Str++) { - switch (*Str) { - case '\n': - if (Private->Possition.Y == (Private->MaxScreenSize.Y - 1)) { - WinNtSimpleTextOutScrollScreen (Private); - } - - if (Private->Possition.Y < (Private->MaxScreenSize.Y - 1)) { - Private->Possition.Y++; - This->Mode->CursorRow++; - } - break; - - case '\r': - Private->Possition.X = 0; - This->Mode->CursorColumn = 0; - break; - - case '\b': - if (Private->Possition.X > 0) { - Private->Possition.X--; - This->Mode->CursorColumn--; - } - break; - - default: - WinNtSimpleTextOutPutChar (Private, *Str); - } - } - - return EFI_SUCCESS; -} - -STATIC -VOID -WinNtSimpleTextOutPutChar ( - IN OUT WIN_NT_SIMPLE_TEXT_PRIVATE_DATA *Console, - IN CHAR16 Char - ) -/*++ - -Routine Description: - - TODO: Add function description - -Arguments: - - Console - TODO: add argument description - Char - TODO: add argument description - -Returns: - - TODO: add return values - ---*/ -{ - SMALL_RECT Region; - COORD StrCoordinate; - COORD StrSize; - CHAR_INFO CharInfo; - BOOL Flag; - - CharInfo.Char.UnicodeChar = Char; - CharInfo.Attributes = Console->Attribute; - - StrSize.X = 1; - StrSize.Y = 1; - StrCoordinate.X = 0; - StrCoordinate.Y = 0; - - Region.Left = (INT16) Console->Possition.X; - Region.Top = (INT16) Console->Possition.Y; - Region.Right = (INT16) (Console->Possition.X + 1); - Region.Bottom = (INT16) Console->Possition.Y; - - Console->WinNtThunk->WriteConsoleOutput ( - Console->NtOutHandle, - &CharInfo, - StrSize, - StrCoordinate, - &Region - ); - - if (Console->Possition.X >= (Console->MaxScreenSize.X - 1)) { - // - // If you print off the end wrap around - // - Console->SimpleTextOut.OutputString (&Console->SimpleTextOut, L"\n\r"); - } else { - Console->Possition.X++; - Console->SimpleTextOut.Mode->CursorColumn++; - } - - Flag = Console->WinNtThunk->SetConsoleCursorPosition (Console->NtOutHandle, Console->Possition); -} - -STATIC -VOID -WinNtSimpleTextOutScrollScreen ( - IN OUT WIN_NT_SIMPLE_TEXT_PRIVATE_DATA *Console - ) -/*++ - -Routine Description: - - TODO: Add function description - -Arguments: - - Console - TODO: add argument description - -Returns: - - TODO: add return values - ---*/ -{ - SMALL_RECT Scroll; - CHAR_INFO CharInfo; - COORD Origin; - - CharInfo.Char.UnicodeChar = ' '; - CharInfo.Attributes = Console->Attribute; - - Origin.X = 0; - Origin.Y = 0; - - Scroll.Top = 1; - Scroll.Left = 0; - Scroll.Right = (INT16) Console->MaxScreenSize.X; - Scroll.Bottom = (INT16) Console->MaxScreenSize.Y; - - Console->WinNtThunk->ScrollConsoleScreenBuffer ( - Console->NtOutHandle, - &Scroll, - NULL, - Origin, - &CharInfo - ); -} - -STATIC -EFI_STATUS -EFIAPI -WinNtSimpleTextOutTestString ( - IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, - IN CHAR16 *String - ) -/*++ - -Routine Description: - - TODO: Add function description - -Arguments: - - This - TODO: add argument description - String - TODO: add argument description - -Returns: - - EFI_SUCCESS - TODO: Add description for return value - ---*/ -{ - WIN_NT_SIMPLE_TEXT_PRIVATE_DATA *Private; - - Private = WIN_NT_SIMPLE_TEXT_OUT_PRIVATE_DATA_FROM_THIS (This); - - // - // BugBug: The correct answer would be a function of what code pages - // are currently loaded? For now we will just return success. - // - return EFI_SUCCESS; -} - -STATIC -EFI_STATUS -EFIAPI -WinNtSimpleTextOutQueryMode ( - IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, - IN UINTN ModeNumber, - OUT UINTN *Columns, - OUT UINTN *Rows - ) -/*++ - -Routine Description: - - TODO: Add function description - -Arguments: - - This - TODO: add argument description - ModeNumber - TODO: add argument description - Columns - TODO: add argument description - Rows - TODO: add argument description - -Returns: - - EFI_INVALID_PARAMETER - TODO: Add description for return value - EFI_SUCCESS - TODO: Add description for return value - ---*/ -{ - WIN_NT_SIMPLE_TEXT_PRIVATE_DATA *Private; - - Private = WIN_NT_SIMPLE_TEXT_OUT_PRIVATE_DATA_FROM_THIS (This); - - if (ModeNumber > MAX_SIMPLE_TEXT_OUT_MODE) { - return EFI_INVALID_PARAMETER; - } - - *Columns = mWinNtSimpleTextOutSupportedModes[ModeNumber].ColumnsX; - *Rows = mWinNtSimpleTextOutSupportedModes[ModeNumber].RowsY; - - return EFI_SUCCESS; -} - -STATIC -EFI_STATUS -EFIAPI -WinNtSimpleTextOutSetMode ( - IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, - IN UINTN ModeNumber - ) -/*++ - -Routine Description: - - TODO: Add function description - -Arguments: - - This - TODO: add argument description - ModeNumber - TODO: add argument description - -Returns: - - EFI_INVALID_PARAMETER - TODO: Add description for return value - EFI_SUCCESS - TODO: Add description for return value - ---*/ -{ - WIN_NT_SIMPLE_TEXT_PRIVATE_DATA *Private; - - Private = WIN_NT_SIMPLE_TEXT_OUT_PRIVATE_DATA_FROM_THIS (This); - - if (ModeNumber > MAX_SIMPLE_TEXT_OUT_MODE) { - return EFI_INVALID_PARAMETER; - } - - Private->MaxScreenSize.X = (WORD) mWinNtSimpleTextOutSupportedModes[ModeNumber].ColumnsX; - Private->MaxScreenSize.Y = (WORD) mWinNtSimpleTextOutSupportedModes[ModeNumber].RowsY; - - Private->WinNtThunk->SetConsoleScreenBufferSize (Private->NtOutHandle, Private->MaxScreenSize); - Private->WinNtThunk->SetConsoleActiveScreenBuffer (Private->NtOutHandle); - - This->Mode->Mode = (INT32) ModeNumber; - - This->EnableCursor (This, TRUE); - This->ClearScreen (This); - return EFI_SUCCESS; -} - -STATIC -EFI_STATUS -EFIAPI -WinNtSimpleTextOutSetAttribute ( - IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, - IN UINTN Attribute - ) -/*++ - -Routine Description: - - TODO: Add function description - -Arguments: - - This - TODO: add argument description - Attribute - TODO: add argument description - -Returns: - - EFI_SUCCESS - TODO: Add description for return value - ---*/ -{ - WIN_NT_SIMPLE_TEXT_PRIVATE_DATA *Private; - - Private = WIN_NT_SIMPLE_TEXT_OUT_PRIVATE_DATA_FROM_THIS (This); - - Private->Attribute = (WORD) Attribute; - This->Mode->Attribute = (INT32) Attribute; - - return EFI_SUCCESS; -} - -STATIC -EFI_STATUS -EFIAPI -WinNtSimpleTextOutClearScreen ( - IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This - ) -/*++ - -Routine Description: - - TODO: Add function description - -Arguments: - - This - TODO: add argument description - -Returns: - - EFI_SUCCESS - TODO: Add description for return value - ---*/ -{ - WIN_NT_SIMPLE_TEXT_PRIVATE_DATA *Private; - DWORD ConsoleWindow; - - Private = WIN_NT_SIMPLE_TEXT_OUT_PRIVATE_DATA_FROM_THIS (This); - - This->SetCursorPosition (This, 0, 0); - - Private->WinNtThunk->FillConsoleOutputCharacter ( - Private->NtOutHandle, - ' ', - Private->MaxScreenSize.X * Private->MaxScreenSize.Y, - Private->Possition, - &ConsoleWindow - ); - Private->WinNtThunk->FillConsoleOutputAttribute ( - Private->NtOutHandle, - Private->Attribute, - Private->MaxScreenSize.X * Private->MaxScreenSize.Y, - Private->Possition, - &ConsoleWindow - ); - - return EFI_SUCCESS; -} - -STATIC -EFI_STATUS -EFIAPI -WinNtSimpleTextOutSetCursorPosition ( - IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, - IN UINTN Column, - IN UINTN Row - ) -/*++ - -Routine Description: - - TODO: Add function description - -Arguments: - - This - TODO: add argument description - Column - TODO: add argument description - Row - TODO: add argument description - -Returns: - - EFI_SUCCESS - TODO: Add description for return value - ---*/ -{ - WIN_NT_SIMPLE_TEXT_PRIVATE_DATA *Private; - - Private = WIN_NT_SIMPLE_TEXT_OUT_PRIVATE_DATA_FROM_THIS (This); - - Private->Possition.X = (WORD) Column; - This->Mode->CursorColumn = (INT32) Column; - - Private->Possition.Y = (WORD) Row; - This->Mode->CursorRow = (INT32) Row; - Private->WinNtThunk->SetConsoleCursorPosition (Private->NtOutHandle, Private->Possition); - - return EFI_SUCCESS; -} - -STATIC -EFI_STATUS -EFIAPI -WinNtSimpleTextOutEnableCursor ( - IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, - IN BOOLEAN Enable - ) -/*++ - -Routine Description: - - TODO: Add function description - -Arguments: - - This - TODO: add argument description - Enable - TODO: add argument description - -Returns: - - EFI_SUCCESS - TODO: Add description for return value - ---*/ -{ - WIN_NT_SIMPLE_TEXT_PRIVATE_DATA *Private; - CONSOLE_CURSOR_INFO Info; - - Private = WIN_NT_SIMPLE_TEXT_OUT_PRIVATE_DATA_FROM_THIS (This); - Private->CursorEnable = Enable; - This->Mode->CursorVisible = Enable; - - Private->WinNtThunk->GetConsoleCursorInfo (Private->NtOutHandle, &Info); - Info.bVisible = Enable; - Private->WinNtThunk->SetConsoleCursorInfo (Private->NtOutHandle, &Info); - - return EFI_SUCCESS; -} - -EFI_STATUS -WinNtSimpleTextOutOpenWindow ( - IN OUT WIN_NT_SIMPLE_TEXT_PRIVATE_DATA *Private - ) -/*++ - -Routine Description: - - TODO: Add function description - -Arguments: - - Private - TODO: add argument description - -Returns: - - TODO: add return values - ---*/ -{ - EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *SimpleTextOut; - CHAR16 *WindowName; - - WindowName = Private->WinNtIo->EnvString; - Private->Attribute = FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_INTENSITY; - if (*WindowName == '?') { - Private->Attribute = BACKGROUND_RED | FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_GREEN; - WindowName = L"EFI Emulator Error Console"; - } - - AddUnicodeString2 ( - "eng", - gWinNtConsoleComponentName.SupportedLanguages, - &Private->ControllerNameTable, - WindowName, - TRUE - ); - AddUnicodeString2 ( - "en", - gWinNtConsoleComponentName2.SupportedLanguages, - &Private->ControllerNameTable, - WindowName, - FALSE - ); - - - // - // Fill in protocol member functions - // - SimpleTextOut = &Private->SimpleTextOut; - SimpleTextOut->Reset = WinNtSimpleTextOutReset; - SimpleTextOut->OutputString = WinNtSimpleTextOutOutputString; - SimpleTextOut->TestString = WinNtSimpleTextOutTestString; - SimpleTextOut->QueryMode = WinNtSimpleTextOutQueryMode; - SimpleTextOut->SetMode = WinNtSimpleTextOutSetMode; - SimpleTextOut->SetAttribute = WinNtSimpleTextOutSetAttribute; - SimpleTextOut->ClearScreen = WinNtSimpleTextOutClearScreen; - SimpleTextOut->SetCursorPosition = WinNtSimpleTextOutSetCursorPosition; - SimpleTextOut->EnableCursor = WinNtSimpleTextOutEnableCursor; - - // - // Initialize SimpleTextOut protocol mode structure - // - SimpleTextOut->Mode = &Private->SimpleTextOutMode; - SimpleTextOut->Mode->MaxMode = MAX_SIMPLE_TEXT_OUT_MODE; - SimpleTextOut->Mode->Attribute = (INT32) Private->Attribute; - - // - // Open the window an initialize it! - // - Private->NtOutHandle = Private->WinNtThunk->CreateConsoleScreenBuffer ( - GENERIC_WRITE | GENERIC_READ, - FILE_SHARE_WRITE | FILE_SHARE_READ, - NULL, - CONSOLE_TEXTMODE_BUFFER, - NULL - ); - Private->WinNtThunk->SetConsoleTitle (WindowName); - - return SimpleTextOut->SetMode (SimpleTextOut, 0); -} - -EFI_STATUS -WinNtSimpleTextOutCloseWindow ( - IN OUT WIN_NT_SIMPLE_TEXT_PRIVATE_DATA *Console - ) -/*++ - -Routine Description: - - TODO: Add function description - -Arguments: - - Console - TODO: add argument description - -Returns: - - EFI_SUCCESS - TODO: Add description for return value - ---*/ -{ - Console->WinNtThunk->CloseHandle (Console->NtOutHandle); - return EFI_SUCCESS; -} diff --git a/Nt32Pkg/WinNtConsoleDxe/WinNtConsole.msa b/Nt32Pkg/WinNtConsoleDxe/WinNtConsole.msa deleted file mode 100644 index 595213eacf..0000000000 --- a/Nt32Pkg/WinNtConsoleDxe/WinNtConsole.msa +++ /dev/null @@ -1,85 +0,0 @@ - - - - WinNtConsole - UEFI_DRIVER - 263631d7-5836-4b74-be48-ee22e92ce5d3 - 1.0 - Console Dxe driver - Simulate console with WinAPI - Copyright (c) 2006 - 2007, Intel Corporation - All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052 - - - IA32 - false - WinNtConsole - - - - DebugLib - - - BaseLib - - - UefiDriverModelLib - - - UefiDriverEntryPoint - - - UefiLib - - - BaseMemoryLib - - - UefiBootServicesTableLib - - - MemoryAllocationLib - - - - Console.h - Console.c - ConsoleIn.c - ConsoleOut.c - ComponentName.c - - - - - - - - gEfiWinNtIoProtocolGuid - - - gEfiSimpleTextOutProtocolGuid - - - gEfiSimpleTextInProtocolGuid - - - - - gEfiWinNtConsoleGuid - - - - EFI_SPECIFICATION_VERSION 0x00020000 - EDK_RELEASE_VERSION 0x00020000 - - gWinNtConsoleDriverBinding - gWinNtConsoleComponentName - - - \ No newline at end of file diff --git a/Nt32Pkg/WinNtConsoleDxe/WinNtConsoleDxe.inf b/Nt32Pkg/WinNtConsoleDxe/WinNtConsoleDxe.inf deleted file mode 100644 index 2237a7d211..0000000000 --- a/Nt32Pkg/WinNtConsoleDxe/WinNtConsoleDxe.inf +++ /dev/null @@ -1,68 +0,0 @@ -#/** @file -# Console Dxe driver -# -# Simulate console with WinAPI -# Copyright (c) 2006 - 2007, Intel Corporation -# -# All rights reserved. This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# -#**/ - -[Defines] - INF_VERSION = 0x00010005 - BASE_NAME = WinNtConsole - FILE_GUID = 263631d7-5836-4b74-be48-ee22e92ce5d3 - MODULE_TYPE = UEFI_DRIVER - VERSION_STRING = 1.0 - EDK_RELEASE_VERSION = 0x00020000 - EFI_SPECIFICATION_VERSION = 0x00020000 - - ENTRY_POINT = InitializeWinNtConsole - -# -# The following information is for reference only and not required by the build tools. -# -# VALID_ARCHITECTURES = IA32 -# -# DRIVER_BINDING = gWinNtConsoleDriverBinding -# COMPONENT_NAME = gWinNtConsoleComponentName -# - -[Sources.common] - ComponentName.c - ConsoleOut.c - ConsoleIn.c - Console.c - Console.h - - -[Packages] - MdePkg/MdePkg.dec - Nt32Pkg/Nt32Pkg.dec - - -[LibraryClasses] - MemoryAllocationLib - UefiBootServicesTableLib - BaseMemoryLib - UefiLib - UefiDriverEntryPoint - BaseLib - DebugLib - - -[Guids] - gEfiWinNtConsoleGuid # ALWAYS_CONSUMED - - -[Protocols] - gEfiSimpleTextInProtocolGuid # PROTOCOL BY_START - gEfiSimpleTextOutProtocolGuid # PROTOCOL BY_START - gEfiWinNtIoProtocolGuid # PROTOCOL TO_START - -- 2.39.2