summaryrefslogtreecommitdiff
path: root/IntelFrameworkModulePkg/Universal
diff options
context:
space:
mode:
authorrsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524>2009-04-14 10:47:19 +0000
committerrsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524>2009-04-14 10:47:19 +0000
commitcb7d01c0c9fd199742d0fed6aa69dab0c79c3338 (patch)
tree920a78778c9de452a58ee0d0df2893e7c4822bdb /IntelFrameworkModulePkg/Universal
parent169a34619b6d583d9f2934a6a3e9caf6e5c6e355 (diff)
downloadedk2-platforms-cb7d01c0c9fd199742d0fed6aa69dab0c79c3338.tar.xz
HII Library Class interface refine.
The "HiiLib" prefix for all HII Library API function names changed to "Hii". Remove: HiiLibPreparePackageList(), replaced by HiiAddPackages() HiiLibNewString(), replaced by HiiSetString() HiiLibGetStringFromHandle(), replaced by HiiGetString() HiiLibGetStringFromToken(), replaced by HiiGetPackageString() HiiLibExtractGuidFromHiiHandle() HiiLibDevicePathToHiiHandle() HiiLibGetSupportedSecondaryLanguages() HiiLibGetSupportedLanguageNumber() HiiLibExportPackageLists() HiiLibListPackageLists() Interface change: HiiAddPackages() HiiSetString() HiiGetString() HiiGetHiiHandles() git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8083 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg/Universal')
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c65
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c8
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Variable.c8
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManager.c31
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManager.h4
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.c89
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.h4
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c47
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/Language.c15
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/String.c38
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/String.h4
11 files changed, 139 insertions, 174 deletions
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c
index 3f5bbc40c2..57dd2db9c5 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c
@@ -128,20 +128,22 @@ CreateMenuStringToken (
for (Index = 0; Index < MenuOption->MenuNumber; Index++) {
NewMenuEntry = BOpt_GetMenuEntry (MenuOption, Index);
- HiiLibNewString (
- HiiHandle,
- &NewMenuEntry->DisplayStringToken,
- NewMenuEntry->DisplayString
- );
+ NewMenuEntry->DisplayStringToken = HiiSetString (
+ HiiHandle,
+ 0,
+ NewMenuEntry->DisplayString,
+ NULL
+ );
if (NULL == NewMenuEntry->HelpString) {
NewMenuEntry->HelpStringToken = NewMenuEntry->DisplayStringToken;
} else {
- HiiLibNewString (
- HiiHandle,
- &NewMenuEntry->HelpStringToken,
- NewMenuEntry->HelpString
- );
+ NewMenuEntry->HelpStringToken = HiiSetString (
+ HiiHandle,
+ 0,
+ NewMenuEntry->HelpString,
+ NULL
+ );
}
}
@@ -848,7 +850,6 @@ InitializeBM (
)
{
EFI_LEGACY_BIOS_PROTOCOL *LegacyBios;
- EFI_HII_PACKAGE_LIST_HEADER *PackageList;
BMM_CALLBACK_DATA *BmmCallbackInfo;
EFI_STATUS Status;
UINT8 *Ptr;
@@ -931,30 +932,26 @@ InitializeBM (
//
// Post our Boot Maint VFR binnary to the HII database.
//
- PackageList = HiiLibPreparePackageList (2, &mBootMaintGuid, BmBin, BdsDxeStrings);
- ASSERT (PackageList != NULL);
-
- Status = gHiiDatabase->NewPackageList (
- gHiiDatabase,
- PackageList,
- BmmCallbackInfo->BmmDriverHandle,
- &BmmCallbackInfo->BmmHiiHandle
- );
- FreePool (PackageList);
+ BmmCallbackInfo->BmmHiiHandle = HiiAddPackages (
+ &mBootMaintGuid,
+ BmmCallbackInfo->BmmDriverHandle,
+ BmBin,
+ BdsDxeStrings,
+ NULL
+ );
+ ASSERT (BmmCallbackInfo->BmmHiiHandle != NULL);
//
// Post our File Explorer VFR binary to the HII database.
//
- PackageList = HiiLibPreparePackageList (2, &mFileExplorerGuid, FEBin, BdsDxeStrings);
- ASSERT (PackageList != NULL);
-
- Status = gHiiDatabase->NewPackageList (
- gHiiDatabase,
- PackageList,
- BmmCallbackInfo->FeDriverHandle,
- &BmmCallbackInfo->FeHiiHandle
- );
- FreePool (PackageList);
+ BmmCallbackInfo->FeHiiHandle = HiiAddPackages (
+ &mFileExplorerGuid,
+ BmmCallbackInfo->FeDriverHandle,
+ FEBin,
+ BdsDxeStrings,
+ NULL
+ );
+ ASSERT (BmmCallbackInfo->FeHiiHandle != NULL);
//
// Allocate space for creation of Buffer
@@ -1057,8 +1054,8 @@ InitializeBM (
//
// Remove our IFR data from HII database
//
- gHiiDatabase->RemovePackageList (gHiiDatabase, BmmCallbackInfo->BmmHiiHandle);
- gHiiDatabase->RemovePackageList (gHiiDatabase, BmmCallbackInfo->FeHiiHandle);
+ HiiRemovePackages (BmmCallbackInfo->BmmHiiHandle);
+ HiiRemovePackages (BmmCallbackInfo->FeHiiHandle);
CleanUpStringDepository ();
@@ -1192,7 +1189,7 @@ GetStringTokenFromDepository (
//
NextListNode = AllocateZeroPool (sizeof (STRING_LIST_NODE));
ASSERT (NextListNode != NULL);
- HiiLibNewString (CallbackData->BmmHiiHandle, &(NextListNode->StringToken), L" ");
+ NextListNode->StringToken = HiiSetString (CallbackData->BmmHiiHandle, 0, L" ", NULL);
ASSERT (NextListNode->StringToken != 0);
StringDepository->TotalNodeNumber++;
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c
index 6831289add..3d23da1ac3 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c
@@ -752,7 +752,7 @@ UpdateConModePage (
ASSERT ((StrLen (ModeString) + TempStringLen) < (sizeof (ModeString) / sizeof (ModeString[0])));
StrCat (ModeString, RowString);
- HiiLibNewString (CallbackData->BmmHiiHandle, &ModeToken[Index], ModeString);
+ ModeToken[Index] = HiiSetString (CallbackData->BmmHiiHandle, 0, ModeString, NULL);
IfrOptionList[Index].StringToken = ModeToken[Index];
IfrOptionList[Index].Value.u16 = (UINT16) Mode;
@@ -1246,12 +1246,10 @@ UpdateSetLegacyDeviceOrderPage (
// Create the string for oneof tag
//
UnicodeSPrint (String, sizeof (String), TypeStr, Index);
- StrRef = 0;
- HiiLibNewString (CallbackData->BmmHiiHandle, &StrRef, String);
+ StrRef = HiiSetString (CallbackData->BmmHiiHandle, 0, String, NULL);
UnicodeSPrint (String, sizeof (String), TypeStrHelp, Index);
- StrRefHelp = 0;
- HiiLibNewString (CallbackData->BmmHiiHandle, &StrRefHelp, String);
+ StrRefHelp = HiiSetString (CallbackData->BmmHiiHandle, 0, String, NULL);
CreateOneOfOpCode (
(EFI_QUESTION_ID) (Key + Index),
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Variable.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Variable.c
index 489827f9de..6bdcee41d5 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Variable.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Variable.c
@@ -642,13 +642,13 @@ Var_UpdateDriverOption (
CallbackData,
DriverOptionStrDepository
);
- HiiLibNewString (HiiHandle, &NewMenuEntry->DisplayStringToken, NewMenuEntry->DisplayString);
+ NewMenuEntry->DisplayStringToken = HiiSetString (HiiHandle, 0, NewMenuEntry->DisplayString, NULL);
NewMenuEntry->HelpStringToken = GetStringTokenFromDepository (
CallbackData,
DriverOptionHelpStrDepository
);
- HiiLibNewString (HiiHandle, &NewMenuEntry->HelpStringToken, NewMenuEntry->HelpString);
+ NewMenuEntry->HelpStringToken = HiiSetString (HiiHandle, 0, NewMenuEntry->HelpString, NULL);
if (OptionalDataExist) {
Ptr += (UINT8) GetDevicePathSize (CallbackData->LoadContext->FilePathList);
@@ -814,13 +814,13 @@ Var_UpdateBootOption (
CallbackData,
BootOptionStrDepository
);
- HiiLibNewString (CallbackData->FeHiiHandle, &NewMenuEntry->DisplayStringToken, NewMenuEntry->DisplayString);
+ NewMenuEntry->DisplayStringToken = HiiSetString (CallbackData->FeHiiHandle, 0, NewMenuEntry->DisplayString, NULL);
NewMenuEntry->HelpStringToken = GetStringTokenFromDepository (
CallbackData,
BootOptionHelpStrDepository
);
- HiiLibNewString (CallbackData->FeHiiHandle, &NewMenuEntry->HelpStringToken, NewMenuEntry->HelpString);
+ NewMenuEntry->HelpStringToken = HiiSetString (CallbackData->FeHiiHandle, 0, NewMenuEntry->HelpString, NULL);
if (OptionalDataExist) {
Ptr += (UINT8) GetDevicePathSize (CallbackData->LoadContext->FilePathList);
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManager.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManager.c
index 615c189d8d..4918b25b13 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManager.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManager.c
@@ -129,7 +129,8 @@ BootManagerCallback (
Registers HII packages for the Boot Manger to HII Database.
It also registers the browser call back function.
- @return Status of gBS->InstallMultipleProtocolInterfaces() and gHiiDatabase->NewPackageList()
+ @retval EFI_SUCCESS HII packages for the Boot Manager were registered successfully.
+ @retval EFI_OUT_OF_RESOURCES HII packages for the Boot Manager failed to be registered.
**/
EFI_STATUS
@@ -138,7 +139,6 @@ InitializeBootManager (
)
{
EFI_STATUS Status;
- EFI_HII_PACKAGE_LIST_HEADER *PackageList;
//
// Install Device Path Protocol and Config Access protocol to driver handle
@@ -156,17 +156,18 @@ InitializeBootManager (
//
// Publish our HII data
//
- PackageList = HiiLibPreparePackageList (2, &mBootManagerGuid, BootManagerVfrBin, BdsDxeStrings);
- ASSERT (PackageList != NULL);
-
- Status = gHiiDatabase->NewPackageList (
- gHiiDatabase,
- PackageList,
- gBootManagerPrivate.DriverHandle,
- &gBootManagerPrivate.HiiHandle
- );
- FreePool (PackageList);
-
+ gBootManagerPrivate.HiiHandle = HiiAddPackages (
+ &mBootManagerGuid,
+ gBootManagerPrivate.DriverHandle,
+ BootManagerVfrBin,
+ BdsDxeStrings,
+ NULL
+ );
+ if (gBootManagerPrivate.HiiHandle == NULL) {
+ Status = EFI_OUT_OF_RESOURCES;
+ } else {
+ Status = EFI_SUCCESS;
+ }
return Status;
}
@@ -244,7 +245,7 @@ CallBootManager (
continue;
}
- HiiLibNewString (HiiHandle, &Token, Option->Description);
+ Token = HiiSetString (HiiHandle, 0, Option->Description, NULL);
TempStr = DevicePathToStr (Option->DevicePath);
TempSize = StrSize (TempStr);
@@ -253,7 +254,7 @@ CallBootManager (
StrCat (HelpString, L"Device Path : ");
StrCat (HelpString, TempStr);
- HiiLibNewString (HiiHandle, &HelpToken, HelpString);
+ HelpToken = HiiSetString (HiiHandle, 0, HelpString, NULL);
CreateActionOpCode (
mKeyInput,
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManager.h b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManager.h
index d7566f4ccf..90b7b2850d 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManager.h
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManager.h
@@ -86,7 +86,9 @@ BootManagerCallback (
Registers HII packages for the Boot Manger to HII Database.
It also registers the browser call back function.
- @return Status of gBS->InstallMultipleProtocolInterfaces() and gHiiDatabase->NewPackageList()
+ @retval EFI_SUCCESS HII packages for the Boot Manager were registered successfully.
+ @retval EFI_OUT_OF_RESOURCES HII packages for the Boot Manager failed to be registered.
+
**/
EFI_STATUS
InitializeBootManager (
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.c b/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.c
index 9264734ddc..920a050630 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.c
@@ -112,8 +112,8 @@ DeviceManagerCallback (
This function registers HII packages to HII database.
- @retval EFI_SUCCESS This function complete successfully.
- @return Other value if failed to register HII packages.
+ @retval EFI_SUCCESS HII packages for the Device Manager were registered successfully.
+ @retval EFI_OUT_OF_RESOURCES HII packages for the Device Manager failed to be registered.
**/
EFI_STATUS
@@ -122,7 +122,6 @@ InitializeDeviceManager (
)
{
EFI_STATUS Status;
- EFI_HII_PACKAGE_LIST_HEADER *PackageList;
//
// Install Device Path Protocol and Config Access protocol to driver handle
@@ -140,17 +139,18 @@ InitializeDeviceManager (
//
// Publish our HII data
//
- PackageList = HiiLibPreparePackageList (2, &mDeviceManagerGuid, DeviceManagerVfrBin, BdsDxeStrings);
- ASSERT (PackageList != NULL);
-
- Status = gHiiDatabase->NewPackageList (
- gHiiDatabase,
- PackageList,
- gDeviceManagerPrivate.DriverHandle,
- &gDeviceManagerPrivate.HiiHandle
- );
- FreePool (PackageList);
-
+ gDeviceManagerPrivate.HiiHandle = HiiAddPackages (
+ &mDeviceManagerGuid,
+ gDeviceManagerPrivate.DriverHandle,
+ DeviceManagerVfrBin,
+ BdsDxeStrings,
+ NULL
+ );
+ if (gDeviceManagerPrivate.HiiHandle == NULL) {
+ Status = EFI_OUT_OF_RESOURCES;
+ } else {
+ Status = EFI_SUCCESS;
+ }
return Status;
}
@@ -174,23 +174,18 @@ CallDeviceManager (
EFI_STATUS Status;
UINTN Count;
UINTN Index;
- CHAR16 *String;
- UINTN StringLength;
+ EFI_STRING String;
EFI_HII_UPDATE_DATA UpdateData[MENU_ITEM_NUM];
EFI_STRING_ID Token;
EFI_STRING_ID TokenHelp;
EFI_HII_HANDLE *HiiHandles;
- UINTN HandleBufferLength;
- UINTN NumberOfHiiHandles;
EFI_HII_HANDLE HiiHandle;
UINT16 FormSetClass;
EFI_STRING_ID FormSetTitle;
EFI_STRING_ID FormSetHelp;
EFI_BROWSER_ACTION_REQUEST ActionRequest;
- EFI_HII_PACKAGE_LIST_HEADER *PackageList;
HiiHandles = NULL;
- HandleBufferLength = 0;
Status = EFI_SUCCESS;
gCallbackKey = 0;
@@ -221,37 +216,30 @@ CallDeviceManager (
//
// Get all the Hii handles
//
- Status = HiiLibGetHiiHandles (&HandleBufferLength, &HiiHandles);
- ASSERT_EFI_ERROR (Status && (HiiHandles != NULL));
+ HiiHandles = HiiGetHiiHandles (NULL);
+ ASSERT (HiiHandles != NULL);
HiiHandle = gDeviceManagerPrivate.HiiHandle;
- StringLength = 0x1000;
- String = AllocateZeroPool (StringLength);
- ASSERT (String != NULL);
-
//
// Search for formset of each class type
//
- NumberOfHiiHandles = HandleBufferLength / sizeof (EFI_HII_HANDLE);
- for (Index = 0; Index < NumberOfHiiHandles; Index++) {
+ for (Index = 0; HiiHandles[Index] != NULL; Index++) {
IfrLibExtractClassFromHiiHandle (HiiHandles[Index], &FormSetClass, &FormSetTitle, &FormSetHelp);
if (FormSetClass == EFI_NON_DEVICE_CLASS) {
continue;
}
- Token = 0;
- *String = 0;
- StringLength = 0x1000;
- HiiLibGetString (HiiHandles[Index], FormSetTitle, String, &StringLength);
- HiiLibNewString (HiiHandle, &Token, String);
+ String = HiiGetString (HiiHandles[Index], FormSetTitle, NULL);
+ ASSERT (String != NULL);
+ Token = HiiSetString (HiiHandle, 0, String, NULL);
+ FreePool (String);
- TokenHelp = 0;
- *String = 0;
- StringLength = 0x1000;
- HiiLibGetString (HiiHandles[Index], FormSetHelp, String, &StringLength);
- HiiLibNewString (HiiHandle, &TokenHelp, String);
+ String = HiiGetString (HiiHandles[Index], FormSetHelp, NULL);
+ ASSERT (String != NULL);
+ TokenHelp = HiiSetString (HiiHandle, 0, String, NULL);
+ FreePool (String);
for (Count = 0; Count < MENU_ITEM_NUM; Count++) {
if (FormSetClass & mDeviceManagerMenuItemTable[Count].Class) {
@@ -266,7 +254,6 @@ CallDeviceManager (
}
}
}
- FreePool (String);
for (Index = 0; Index < MENU_ITEM_NUM; Index++) {
//
@@ -327,16 +314,20 @@ CallDeviceManager (
//
// Cleanup dynamic created strings in HII database by reinstall the packagelist
//
- gHiiDatabase->RemovePackageList (gHiiDatabase, HiiHandle);
- PackageList = HiiLibPreparePackageList (2, &mDeviceManagerGuid, DeviceManagerVfrBin, BdsDxeStrings);
- ASSERT (PackageList != NULL);
- Status = gHiiDatabase->NewPackageList (
- gHiiDatabase,
- PackageList,
- gDeviceManagerPrivate.DriverHandle,
- &gDeviceManagerPrivate.HiiHandle
- );
- FreePool (PackageList);
+ HiiRemovePackages (HiiHandle);
+
+ gDeviceManagerPrivate.HiiHandle = HiiAddPackages (
+ &mDeviceManagerGuid,
+ gDeviceManagerPrivate.DriverHandle,
+ DeviceManagerVfrBin,
+ BdsDxeStrings,
+ NULL
+ );
+ if (gDeviceManagerPrivate.HiiHandle == NULL) {
+ Status = EFI_OUT_OF_RESOURCES;
+ } else {
+ Status = EFI_SUCCESS;
+ }
for (Index = 0; Index < MENU_ITEM_NUM; Index++) {
FreePool (UpdateData[Index].Data);
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.h b/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.h
index 23809dd924..ef39ca142e 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.h
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.h
@@ -104,8 +104,8 @@ DeviceManagerCallback (
This function registers HII packages to HII database.
- @retval EFI_SUCCESS This function complete successfully.
- @return Other value if failed to register HII packages.
+ @retval EFI_SUCCESS HII packages for the Device Manager were registered successfully.
+ @retval EFI_OUT_OF_RESOURCES HII packages for the Device Manager failed to be registered.
**/
EFI_STATUS
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c
index fbfac08178..bda75e15ca 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c
@@ -183,7 +183,7 @@ FrontPageCallback (
//
// Collect the languages from what our current Language support is based on our VFR
//
- LanguageString = HiiLibGetSupportedLanguages (gFrontPagePrivate.HiiHandle);
+ LanguageString = HiiGetSupportedLanguages (gFrontPagePrivate.HiiHandle);
ASSERT (LanguageString != NULL);
//
// Allocate working buffer for RFC 4646 language in supported LanguageString.
@@ -297,7 +297,6 @@ InitializeFrontPage (
)
{
EFI_STATUS Status;
- EFI_HII_PACKAGE_LIST_HEADER *PackageList;
EFI_HII_UPDATE_DATA UpdateData;
IFR_OPTION *OptionList;
CHAR8 *LanguageString;
@@ -364,18 +363,15 @@ InitializeFrontPage (
//
// Publish our HII data
//
- PackageList = HiiLibPreparePackageList (2, &mFrontPageGuid, FrontPageVfrBin, BdsDxeStrings);
- ASSERT (PackageList != NULL);
-
- Status = gHiiDatabase->NewPackageList (
- gHiiDatabase,
- PackageList,
- gFrontPagePrivate.DriverHandle,
- &gFrontPagePrivate.HiiHandle
- );
- FreePool (PackageList);
- if (EFI_ERROR (Status)) {
- return Status;
+ gFrontPagePrivate.HiiHandle = HiiAddPackages (
+ &mFrontPageGuid,
+ gFrontPagePrivate.DriverHandle,
+ FrontPageVfrBin,
+ BdsDxeStrings,
+ NULL
+ );
+ if (gFrontPagePrivate.HiiHandle == NULL) {
+ return EFI_OUT_OF_RESOURCES;
}
}
@@ -394,7 +390,7 @@ InitializeFrontPage (
// Collect the languages from what our current Language support is based on our VFR
//
HiiHandle = gFrontPagePrivate.HiiHandle;
- LanguageString = HiiLibGetSupportedLanguages (HiiHandle);
+ LanguageString = HiiGetSupportedLanguages (HiiHandle);
ASSERT (LanguageString != NULL);
//
// Allocate working buffer for RFC 4646 language in supported LanguageString.
@@ -455,8 +451,7 @@ InitializeFrontPage (
}
ASSERT_EFI_ERROR (Status);
- Token = 0;
- Status = HiiLibNewString (HiiHandle, &Token, StringBuffer);
+ Token = HiiSetString (HiiHandle, 0, StringBuffer, NULL);
FreePool (StringBuffer);
} else {
Token = gFrontPagePrivate.LanguageToken[OptionCount];
@@ -578,11 +573,13 @@ GetProducerString (
OUT CHAR16 **String
)
{
- EFI_STATUS Status;
+ EFI_STRING TmpString;
- Status = HiiLibGetStringFromToken (ProducerGuid, Token, String);
- if (EFI_ERROR (Status)) {
+ TmpString = HiiGetPackageString (ProducerGuid, Token, NULL);
+ if (TmpString == NULL) {
*String = GetStringById (STRING_TOKEN (STR_MISSING_STRING));
+ } else {
+ *String = TmpString;
}
return EFI_SUCCESS;
@@ -698,7 +695,7 @@ UpdateFrontPageStrings (
BiosVendor = (EFI_MISC_BIOS_VENDOR_DATA *) (DataHeader + 1);
GetProducerString (&Record->ProducerName, BiosVendor->BiosVersion, &NewString);
TokenToUpdate = STRING_TOKEN (STR_FRONT_PAGE_BIOS_VERSION);
- HiiLibSetString (gFrontPagePrivate.HiiHandle, TokenToUpdate, NewString);
+ HiiSetString (gFrontPagePrivate.HiiHandle, TokenToUpdate, NewString, NULL);
FreePool (NewString);
Find[0] = TRUE;
}
@@ -709,7 +706,7 @@ UpdateFrontPageStrings (
SystemManufacturer = (EFI_MISC_SYSTEM_MANUFACTURER_DATA *) (DataHeader + 1);
GetProducerString (&Record->ProducerName, SystemManufacturer->SystemProductName, &NewString);
TokenToUpdate = STRING_TOKEN (STR_FRONT_PAGE_COMPUTER_MODEL);
- HiiLibSetString (gFrontPagePrivate.HiiHandle, TokenToUpdate, NewString);
+ HiiSetString (gFrontPagePrivate.HiiHandle, TokenToUpdate, NewString, NULL);
FreePool (NewString);
Find[1] = TRUE;
}
@@ -720,7 +717,7 @@ UpdateFrontPageStrings (
ProcessorVersion = (EFI_PROCESSOR_VERSION_DATA *) (DataHeader + 1);
GetProducerString (&Record->ProducerName, *ProcessorVersion, &NewString);
TokenToUpdate = STRING_TOKEN (STR_FRONT_PAGE_CPU_MODEL);
- HiiLibSetString (gFrontPagePrivate.HiiHandle, TokenToUpdate, NewString);
+ HiiSetString (gFrontPagePrivate.HiiHandle, TokenToUpdate, NewString, NULL);
FreePool (NewString);
Find[2] = TRUE;
}
@@ -731,7 +728,7 @@ UpdateFrontPageStrings (
ProcessorFrequency = (EFI_PROCESSOR_CORE_FREQUENCY_DATA *) (DataHeader + 1);
ConvertProcessorToString (ProcessorFrequency, &NewString);
TokenToUpdate = STRING_TOKEN (STR_FRONT_PAGE_CPU_SPEED);
- HiiLibSetString (gFrontPagePrivate.HiiHandle, TokenToUpdate, NewString);
+ HiiSetString (gFrontPagePrivate.HiiHandle, TokenToUpdate, NewString, NULL);
FreePool (NewString);
Find[3] = TRUE;
}
@@ -745,7 +742,7 @@ UpdateFrontPageStrings (
&NewString
);
TokenToUpdate = STRING_TOKEN (STR_FRONT_PAGE_MEMORY_SIZE);
- HiiLibSetString (gFrontPagePrivate.HiiHandle, TokenToUpdate, NewString);
+ HiiSetString (gFrontPagePrivate.HiiHandle, TokenToUpdate, NewString, NULL);
FreePool (NewString);
Find[4] = TRUE;
}
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/Language.c b/IntelFrameworkModulePkg/Universal/BdsDxe/Language.c
index c9e19c5ff0..fe3f0e0064 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/Language.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/Language.c
@@ -24,7 +24,7 @@ EFI_GUID mFontPackageGuid = {
typedef struct {
///
- /// This 4-bytes total array length is required by HiiLibPreparePackageList()
+ /// This 4-bytes total array length is required by HiiAddPackages()
///
UINT32 Length;
@@ -260,13 +260,14 @@ ExportFonts (
)
{
EFI_HII_HANDLE HiiHandle;
- EFI_HII_PACKAGE_LIST_HEADER *PackageList;
- PackageList = HiiLibPreparePackageList (1, &mFontPackageGuid, &mFontBin);
- ASSERT (PackageList != NULL);
-
- gHiiDatabase->NewPackageList (gHiiDatabase, PackageList, mBdsImageHandle, &HiiHandle);
- FreePool (PackageList);
+ HiiHandle = HiiAddPackages (
+ &mFontPackageGuid,
+ mBdsImageHandle,
+ &mFontBin,
+ NULL
+ );
+ ASSERT (HiiHandle != NULL);
}
/**
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/String.c b/IntelFrameworkModulePkg/Universal/BdsDxe/String.c
index a509a85df1..ccabd3239d 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/String.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/String.c
@@ -25,34 +25,19 @@ EFI_GUID mBdsStringPackGuid = {
/**
Initialize HII global accessor for string support
- @retval EFI_SUCCESS String support initialize success.
-
**/
-EFI_STATUS
+VOID
InitializeStringSupport (
VOID
)
{
- EFI_STATUS Status;
- EFI_HII_PACKAGE_LIST_HEADER *PackageList;
-
- Status = gBS->LocateProtocol (&gEfiHiiDatabaseProtocolGuid, NULL, (VOID **) &gHiiDatabase);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- PackageList = HiiLibPreparePackageList (1, &mBdsStringPackGuid, &BdsDxeStrings);
- ASSERT (PackageList != NULL);
-
- Status = gHiiDatabase->NewPackageList (
- gHiiDatabase,
- PackageList,
- mBdsImageHandle,
- &gStringPackHandle
- );
-
- FreePool (PackageList);
- return Status;
+ gStringPackHandle = HiiAddPackages (
+ &mBdsStringPackGuid,
+ mBdsImageHandle,
+ BdsDxeStrings,
+ NULL
+ );
+ ASSERT (gStringPackHandle != NULL);
}
/**
@@ -70,10 +55,5 @@ GetStringById (
IN EFI_STRING_ID Id
)
{
- CHAR16 *String;
-
- String = NULL;
- HiiLibGetStringFromHandle (gStringPackHandle, Id, &String);
-
- return String;
+ return HiiGetString (gStringPackHandle, Id, NULL);
}
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/String.h b/IntelFrameworkModulePkg/Universal/BdsDxe/String.h
index 81a7a6035a..4b8efa4345 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/String.h
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/String.h
@@ -52,10 +52,8 @@ GetStringById (
/**
Initialize HII global accessor for string support
- @retval EFI_SUCCESS String support initialize success.
-
**/
-EFI_STATUS
+VOID
InitializeStringSupport (
VOID
);