summaryrefslogtreecommitdiff
path: root/EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/HiiDatabase.c
diff options
context:
space:
mode:
authorqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2008-04-03 10:36:52 +0000
committerqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2008-04-03 10:36:52 +0000
commit4259256b48aea70035b8e68e75ed12cdde36c908 (patch)
tree1ba6dac6689cd72dcff4fbdf231f87950a05ec9f /EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/HiiDatabase.c
parenta8bf2e5a3c3d2d55452cdc7e4e2abb6fdc6b0ad4 (diff)
downloadedk2-platforms-4259256b48aea70035b8e68e75ed12cdde36c908.tar.xz
Fix a type in the directory name. Compatiblity -> Compatibility.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4994 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/HiiDatabase.c')
-rw-r--r--EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/HiiDatabase.c207
1 files changed, 207 insertions, 0 deletions
diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/HiiDatabase.c b/EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/HiiDatabase.c
new file mode 100644
index 0000000000..c7d339e107
--- /dev/null
+++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/HiiDatabase.c
@@ -0,0 +1,207 @@
+/**@file
+
+Framework to UEFI 2.1 HII Thunk
+
+Copyright (c) 2003, 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.
+
+**/
+
+#include "HiiDatabase.h"
+
+
+EFI_HII_THUNK_PRIVATE_DATA HiiThunkPrivateDataTempate = {
+ {//Signature
+ EFI_HII_THUNK_DRIVER_DATA_SIGNATURE
+ },
+ {//Handle
+ (EFI_HANDLE) NULL
+ },
+ { //Hii
+ HiiNewPack,
+ HiiRemovePack,
+ HiiFindHandles,
+ HiiExportDatabase,
+
+ HiiTestString,
+ HiiGetGlyph,
+ HiiGlyphToBlt,
+
+ HiiNewString,
+ HiiGetPrimaryLanguages,
+ HiiGetSecondaryLanguages,
+ HiiGetString,
+ HiiResetStrings,
+ HiiGetLine,
+ HiiGetForms,
+ HiiGetDefaultImage,
+ HiiUpdateForm,
+
+ HiiGetKeyboardLayout
+ },
+ { //StaticHiiHandle
+ //The FRAMEWORK_EFI_HII_HANDLE starts from 1
+ // and increase upwords untill reach 2^(sizeof (FRAMEWORK_EFI_HII_HANDLE)) - 1.
+ // The code will assert to prevent overflow.
+ (FRAMEWORK_EFI_HII_HANDLE) 1
+ },
+ {
+ NULL, NULL //HiiHandleLinkList
+ },
+};
+
+EFI_HII_DATABASE_PROTOCOL *mUefiHiiDatabaseProtocol;
+EFI_HII_FONT_PROTOCOL *mUefiHiiFontProtocol;
+EFI_HII_IMAGE_PROTOCOL *mUefiHiiImageProtocol;
+EFI_HII_STRING_PROTOCOL *mUefiStringProtocol;
+
+EFI_STATUS
+EFIAPI
+InitializeHiiDatabase (
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+ )
+/*++
+
+Routine Description:
+ Initialize HII Database
+
+Arguments:
+ (Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT)
+
+Returns:
+ EFI_SUCCESS - Setup loaded.
+ other - Setup Error
+
+--*/
+{
+ EFI_HII_THUNK_PRIVATE_DATA *HiiData;
+ EFI_HANDLE Handle;
+ EFI_STATUS Status;
+
+ ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiHiiProtocolGuid);
+
+ HiiData = AllocateCopyPool (sizeof (EFI_HII_THUNK_PRIVATE_DATA), &HiiThunkPrivateDataTempate);
+ ASSERT (HiiData != NULL);
+ InitializeListHead (&HiiData->HiiThunkHandleMappingDBListHead);
+
+ Status = gBS->LocateProtocol (
+ &gEfiHiiDatabaseProtocolGuid,
+ NULL,
+ (VOID **) &mUefiHiiDatabaseProtocol
+ );
+ ASSERT_EFI_ERROR (Status);
+
+ Status = gBS->LocateProtocol (
+ &gEfiHiiFontProtocolGuid,
+ NULL,
+ (VOID **) &mUefiHiiFontProtocol
+ );
+ ASSERT_EFI_ERROR (Status);
+
+ Status = gBS->LocateProtocol (
+ &gEfiHiiImageProtocolGuid,
+ NULL,
+ (VOID **) &mUefiHiiImageProtocol
+ );
+ ASSERT_EFI_ERROR (Status);
+
+ Status = gBS->LocateProtocol (
+ &gEfiHiiStringProtocolGuid,
+ NULL,
+ (VOID **) &mUefiStringProtocol
+ );
+ ASSERT_EFI_ERROR (Status);
+
+ //
+ // Install protocol interface
+ //
+ Handle = NULL;
+ Status = gBS->InstallProtocolInterface (
+ &HiiData->Handle,
+ &gEfiHiiProtocolGuid,
+ EFI_NATIVE_INTERFACE,
+ (VOID *) &HiiData->Hii
+ );
+ ASSERT_EFI_ERROR (Status);
+
+ return Status;
+}
+
+EFI_STATUS
+EFIAPI
+HiiFindHandles (
+ IN EFI_HII_PROTOCOL *This,
+ IN OUT UINT16 *HandleBufferLength,
+ OUT FRAMEWORK_EFI_HII_HANDLE Handle[1]
+ )
+/*++
+
+Routine Description:
+ Determines the handles that are currently active in the database.
+
+Arguments:
+
+Returns:
+
+--*/
+{
+ ASSERT (FALSE);
+ return EFI_SUCCESS;
+}
+
+EFI_STATUS
+EFIAPI
+HiiGetPrimaryLanguages (
+ IN EFI_HII_PROTOCOL *This,
+ IN FRAMEWORK_EFI_HII_HANDLE Handle,
+ OUT EFI_STRING *LanguageString
+ )
+/*++
+
+Routine Description:
+
+ This function allows a program to determine what the primary languages that are supported on a given handle.
+
+Arguments:
+
+Returns:
+
+--*/
+{
+ ASSERT (FALSE);
+ return EFI_SUCCESS;
+}
+
+EFI_STATUS
+EFIAPI
+HiiGetSecondaryLanguages (
+ IN EFI_HII_PROTOCOL *This,
+ IN FRAMEWORK_EFI_HII_HANDLE Handle,
+ IN CHAR16 *PrimaryLanguage,
+ OUT EFI_STRING *LanguageString
+ )
+/*++
+
+Routine Description:
+
+ This function allows a program to determine which secondary languages are supported
+ on a given handle for a given primary language.
+
+ Arguments:
+
+Returns:
+
+--*/
+{
+ ASSERT (FALSE);
+ return EFI_SUCCESS;
+}
+
+