本文整理汇总了C++中HiiAddPackages函数的典型用法代码示例。如果您正苦于以下问题:C++ HiiAddPackages函数的具体用法?C++ HiiAddPackages怎么用?C++ HiiAddPackages使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了HiiAddPackages函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ShellNetwork1CommandsLibConstructor
/**
Constructor for the Shell Network1 Commands library.
Install the handlers for Network1 UEFI Shell 2.0 profile commands.
@param ImageHandle The image handle of the process.
@param SystemTable The EFI System Table pointer.
@retval EFI_SUCCESS The shell command handlers were installed sucessfully.
@retval EFI_UNSUPPORTED The shell level required was not found.
**/
EFI_STATUS
EFIAPI
ShellNetwork1CommandsLibConstructor (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
{
gShellNetwork1HiiHandle = NULL;
//
// check our bit of the profiles mask
//
if ((PcdGet8(PcdShellProfileMask) & BIT3) == 0) {
return (EFI_SUCCESS);
}
gShellNetwork1HiiHandle = HiiAddPackages (&gShellNetwork1HiiGuid, gImageHandle, UefiShellNetwork1CommandsLibStrings, NULL);
if (gShellNetwork1HiiHandle == NULL) {
return (EFI_DEVICE_ERROR);
}
//
// install our shell command handlers
//
ShellCommandRegisterCommandName(L"ping", ShellCommandRunPing , ShellCommandGetManFileNameNetwork1, 0, L"network1", TRUE , gShellNetwork1HiiHandle, STRING_TOKEN(STR_GET_HELP_PING));
ShellCommandRegisterCommandName(L"ifconfig",ShellCommandRunIfconfig , ShellCommandGetManFileNameNetwork1, 0, L"network1", TRUE , gShellNetwork1HiiHandle, STRING_TOKEN(STR_GET_HELP_IFCONFIG));
return (EFI_SUCCESS);
}
示例2: ShellDynCmdRunAxfInstall
EFI_STATUS
ShellDynCmdRunAxfInstall (
IN EFI_HANDLE ImageHandle
)
{
EFI_STATUS Status;
// Register our shell command
Status = gBS->InstallMultipleProtocolInterfaces (&ImageHandle,
&gEfiShellDynamicCommandProtocolGuid,
&mShellDynCmdProtocolRunAxf,
NULL);
if (EFI_ERROR (Status)) {
return Status;
}
// Load the manual page for our command
//
// 3rd parameter 'HII strings array' must be name of .uni strings file
// followed by 'Strings', e.g. mycommands.uni must be specified as
// 'mycommandsStrings' because the build Autogen process defines this as a
// string array for the strings in your .uni file. Examine your Build folder
// under your package's DEBUG folder and you will find it defined in a
// xxxStrDefs.h file.
//
gRunAxfHiiHandle = HiiAddPackages (&gRunAxfHiiGuid, ImageHandle,
ArmShellCmdRunAxfStrings, NULL);
if (gRunAxfHiiHandle == NULL) {
return EFI_UNSUPPORTED;
}
return EFI_SUCCESS;
}
示例3: ShellInstall1CommandsLibConstructor
/**
Constructor for the Shell Level 1 Commands library.
Install the handlers for level 1 UEFI Shell 2.0 commands.
@param ImageHandle the image handle of the process
@param SystemTable the EFI System Table pointer
@retval EFI_SUCCESS the shell command handlers were installed sucessfully
@retval EFI_UNSUPPORTED the shell level required was not found.
**/
EFI_STATUS
EFIAPI
ShellInstall1CommandsLibConstructor (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
{
//
// check our bit of the profiles mask
//
if ((PcdGet8(PcdShellProfileMask) & BIT2) == 0) {
return (EFI_SUCCESS);
}
gShellInstall1HiiHandle = HiiAddPackages (&gShellInstall1HiiGuid, gImageHandle, UefiShellInstall1CommandsLibStrings, NULL);
if (gShellInstall1HiiHandle == NULL) {
return (EFI_DEVICE_ERROR);
}
//
// install our shell command handlers that are always installed
//
ShellCommandRegisterCommandName(L"bcfg", ShellCommandRunBcfgInstall , ShellCommandGetManFileNameInstall1, 0, L"Install", FALSE, gShellInstall1HiiHandle, STRING_TOKEN(STR_GET_HELP_BCFG));
return (EFI_SUCCESS);
}
示例4: LegacyBootMaintUiLibConstructor
/**
Install Boot Manager Menu driver.
@param ImageHandle The image handle.
@param SystemTable The system table.
@retval EFI_SUCEESS Install Boot manager menu success.
@retval Other Return error status.
**/
EFI_STATUS
EFIAPI
LegacyBootMaintUiLibConstructor (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
EFI_LEGACY_BIOS_PROTOCOL *LegacyBios;
LEGACY_BOOT_OPTION_CALLBACK_DATA *LegacyBootOptionData;
Status = gBS->LocateProtocol (&gEfiLegacyBiosProtocolGuid, NULL, (VOID **) &LegacyBios);
if (!EFI_ERROR (Status)) {
//
// Create LegacyBootOptionData structures for Driver Callback
//
LegacyBootOptionData = AllocateZeroPool (sizeof (LEGACY_BOOT_OPTION_CALLBACK_DATA));
ASSERT (LegacyBootOptionData != NULL);
LegacyBootOptionData->MaintainMapData = AllocateZeroPool (sizeof (LEGACY_BOOT_MAINTAIN_DATA));
ASSERT (LegacyBootOptionData->MaintainMapData != NULL);
LegacyBootOptionData->ConfigAccess.ExtractConfig = LegacyBootOptionExtractConfig;
LegacyBootOptionData->ConfigAccess.RouteConfig = LegacyBootOptionRouteConfig;
LegacyBootOptionData->ConfigAccess.Callback = LegacyBootOptionCallback;
//
// Install Device Path Protocol and Config Access protocol to driver handle
//
Status = gBS->InstallMultipleProtocolInterfaces (
&LegacyBootOptionData->DriverHandle,
&gEfiDevicePathProtocolGuid,
&mLegacyBootOptionHiiVendorDevicePath,
&gEfiHiiConfigAccessProtocolGuid,
&LegacyBootOptionData->ConfigAccess,
NULL
);
ASSERT_EFI_ERROR (Status);
//
// Publish our HII data
//
LegacyBootOptionData->HiiHandle = HiiAddPackages (
&mLegacyBootOptionGuid,
LegacyBootOptionData->DriverHandle,
LegacyBootMaintUiVfrBin,
LegacyBootMaintUiLibStrings,
NULL
);
ASSERT (LegacyBootOptionData->HiiHandle != NULL);
mLegacyBootOptionPrivate = LegacyBootOptionData;
GetLegacyOptions ();
GetLegacyOptionsOrder();
}
return EFI_SUCCESS;
}
示例5: InstallHiiPages
STATIC
EFI_STATUS
InstallHiiPages (
VOID
)
{
EFI_STATUS Status;
EFI_HII_HANDLE HiiHandle;
EFI_HANDLE DriverHandle;
DriverHandle = NULL;
Status = gBS->InstallMultipleProtocolInterfaces (&DriverHandle,
&gEfiDevicePathProtocolGuid,
&m96BoardsDxeVendorDevicePath,
NULL);
if (EFI_ERROR (Status)) {
return Status;
}
HiiHandle = HiiAddPackages (&g96BoardsFormsetGuid,
DriverHandle,
LsConnectorDxeStrings,
LsConnectorHiiBin,
NULL);
if (HiiHandle == NULL) {
gBS->UninstallMultipleProtocolInterfaces (DriverHandle,
&gEfiDevicePathProtocolGuid,
&m96BoardsDxeVendorDevicePath,
NULL);
return EFI_OUT_OF_RESOURCES;
}
return EFI_SUCCESS;
}
示例6: ShellLevel1CommandsLibConstructor
/**
Constructor for the Shell Level 1 Commands library.
Install the handlers for level 1 UEFI Shell 2.0 commands.
@param ImageHandle the image handle of the process
@param SystemTable the EFI System Table pointer
@retval EFI_SUCCESS the shell command handlers were installed sucessfully
@retval EFI_UNSUPPORTED the shell level required was not found.
**/
EFI_STATUS
EFIAPI
ShellLevel1CommandsLibConstructor (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
{
//
// if shell level is less than 2 do nothing
//
if (PcdGet8(PcdShellSupportLevel) < 1) {
return (EFI_SUCCESS);
}
gShellLevel1HiiHandle = HiiAddPackages (&gShellLevel1HiiGuid, gImageHandle, UefiShellLevel1CommandsLibStrings, NULL);
if (gShellLevel1HiiHandle == NULL) {
return (EFI_DEVICE_ERROR);
}
//
// install our shell command handlers that are always installed
//
ShellCommandRegisterCommandName(L"stall", ShellCommandRunStall , ShellCommandGetManFileNameLevel1, 1, L"", FALSE, gShellLevel1HiiHandle, (EFI_STRING_ID)(PcdGet8(PcdShellSupportLevel) < 3 ? 0 : STRING_TOKEN(STR_GET_HELP_STALL) ));
ShellCommandRegisterCommandName(L"for", ShellCommandRunFor , ShellCommandGetManFileNameLevel1, 1, L"", FALSE, gShellLevel1HiiHandle, (EFI_STRING_ID)(PcdGet8(PcdShellSupportLevel) < 3 ? 0 : STRING_TOKEN(STR_GET_HELP_FOR) ));
ShellCommandRegisterCommandName(L"goto", ShellCommandRunGoto , ShellCommandGetManFileNameLevel1, 1, L"", FALSE, gShellLevel1HiiHandle, (EFI_STRING_ID)(PcdGet8(PcdShellSupportLevel) < 3 ? 0 : STRING_TOKEN(STR_GET_HELP_GOTO) ));
ShellCommandRegisterCommandName(L"if", ShellCommandRunIf , ShellCommandGetManFileNameLevel1, 1, L"", FALSE, gShellLevel1HiiHandle, (EFI_STRING_ID)(PcdGet8(PcdShellSupportLevel) < 3 ? 0 : STRING_TOKEN(STR_GET_HELP_IF) ));
ShellCommandRegisterCommandName(L"shift", ShellCommandRunShift , ShellCommandGetManFileNameLevel1, 1, L"", FALSE, gShellLevel1HiiHandle, (EFI_STRING_ID)(PcdGet8(PcdShellSupportLevel) < 3 ? 0 : STRING_TOKEN(STR_GET_HELP_SHIFT) ));
ShellCommandRegisterCommandName(L"exit", ShellCommandRunExit , ShellCommandGetManFileNameLevel1, 1, L"", TRUE , gShellLevel1HiiHandle, (EFI_STRING_ID)(PcdGet8(PcdShellSupportLevel) < 3 ? 0 : STRING_TOKEN(STR_GET_HELP_EXIT) ));
ShellCommandRegisterCommandName(L"else", ShellCommandRunElse , ShellCommandGetManFileNameLevel1, 1, L"", FALSE, gShellLevel1HiiHandle, (EFI_STRING_ID)(PcdGet8(PcdShellSupportLevel) < 3 ? 0 : STRING_TOKEN(STR_GET_HELP_ELSE) ));
ShellCommandRegisterCommandName(L"endif", ShellCommandRunEndIf , ShellCommandGetManFileNameLevel1, 1, L"", FALSE, gShellLevel1HiiHandle, (EFI_STRING_ID)(PcdGet8(PcdShellSupportLevel) < 3 ? 0 : STRING_TOKEN(STR_GET_HELP_ENDIF) ));
ShellCommandRegisterCommandName(L"endfor", ShellCommandRunEndFor , ShellCommandGetManFileNameLevel1, 1, L"", FALSE, gShellLevel1HiiHandle, (EFI_STRING_ID)(PcdGet8(PcdShellSupportLevel) < 3 ? 0 : STRING_TOKEN(STR_GET_HELP_ENDFOR)));
return (EFI_SUCCESS);
}
示例7: ShellTftpCommandLibConstructor
/**
Constructor for the Shell Tftp Command library.
Install the handlers for Tftp UEFI Shell command.
@param ImageHandle The image handle of the process.
@param SystemTable The EFI System Table pointer.
@retval EFI_SUCCESS The Shell command handlers were installed sucessfully.
@retval EFI_UNSUPPORTED The Shell level required was not found.
**/
EFI_STATUS
EFIAPI
ShellTftpCommandLibConstructor (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
{
gShellTftpHiiHandle = NULL;
//
// check our bit of the profiles mask
//
if ((PcdGet8 (PcdShellProfileMask) & BIT3) == 0) {
return EFI_SUCCESS;
}
gShellTftpHiiHandle = HiiAddPackages (
&gShellTftpHiiGuid, gImageHandle,
UefiShellTftpCommandLibStrings, NULL
);
if (gShellTftpHiiHandle == NULL) {
return EFI_DEVICE_ERROR;
}
//
// Install our Shell command handler
//
ShellCommandRegisterCommandName (
L"tftp", ShellCommandRunTftp, ShellCommandGetManFileNameTftp, 0,
L"tftp", TRUE , gShellTftpHiiHandle, STRING_TOKEN (STR_GET_HELP_TFTP)
);
return EFI_SUCCESS;
}
示例8: ASSERT
/**
The constructor function register UNI strings into imageHandle.
It will ASSERT() if that operation fails and it will always return EFI_SUCCESS.
@param ImageHandle The firmware allocated handle for the EFI image.
@param SystemTable A pointer to the EFI System Table.
@retval EFI_SUCCESS The constructor successfully added string package.
@retval Other value The constructor can't add string package.
**/
EFI_STATUS
EFIAPI
TcgPhysicalPresenceLibConstructor (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
{
mPpStringPackHandle = HiiAddPackages (&gEfiPhysicalPresenceGuid, ImageHandle, DxeTcgPhysicalPresenceLibStrings, NULL);
ASSERT (mPpStringPackHandle != NULL);
return EFI_SUCCESS;
}
示例9: GpioE6xxGetHiiHandle
VOID
GpioE6xxGetHiiHandle (
VOID
)
{
if ( NULL == gGpioE6xxHiiHandle ) {
gGpioE6xxHiiHandle = HiiAddPackages ( &mGpioE6xxGuid,
gImageHandle,
STRING_ARRAY_NAME,
NULL );
}
}
示例10: InitializeFrontPage
/**
Initialize HII information for the FrontPage
@retval EFI_SUCCESS The operation is successful.
@retval EFI_DEVICE_ERROR If the dynamic opcode creation failed.
**/
EFI_STATUS
InitializeFrontPage (
VOID
)
{
EFI_STATUS Status;
//
// Locate Hii relative protocols
//
Status = gBS->LocateProtocol (&gEfiFormBrowser2ProtocolGuid, NULL, (VOID **) &gFormBrowser2);
if (EFI_ERROR (Status)) {
return Status;
}
//
// Install Device Path Protocol and Config Access protocol to driver handle
//
gFrontPagePrivate.DriverHandle = NULL;
Status = gBS->InstallMultipleProtocolInterfaces (
&gFrontPagePrivate.DriverHandle,
&gEfiDevicePathProtocolGuid,
&mFrontPageHiiVendorDevicePath,
&gEfiHiiConfigAccessProtocolGuid,
&gFrontPagePrivate.ConfigAccess,
NULL
);
ASSERT_EFI_ERROR (Status);
//
// Publish our HII data
//
gFrontPagePrivate.HiiHandle = HiiAddPackages (
&mFrontPageGuid,
gFrontPagePrivate.DriverHandle,
FrontPageVfrBin,
UiAppStrings,
NULL
);
ASSERT (gFrontPagePrivate.HiiHandle != NULL);
//
//Updata Front Page strings
//
UpdateFrontPageStrings ();
//
// Initialize laguage options
//
InitializeLanguage ();
return Status;
}
示例11: InstallTrEEConfigForm
/**
This function publish the TREE configuration Form for TPM device.
@param[in, out] PrivateData Points to TREE configuration private data.
@retval EFI_SUCCESS HII Form is installed for this network device.
@retval EFI_OUT_OF_RESOURCES Not enough resource for HII Form installation.
@retval Others Other errors as indicated.
**/
EFI_STATUS
InstallTrEEConfigForm (
IN OUT TREE_CONFIG_PRIVATE_DATA *PrivateData
)
{
EFI_STATUS Status;
EFI_HII_HANDLE HiiHandle;
EFI_HANDLE DriverHandle;
EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess;
DriverHandle = NULL;
ConfigAccess = &PrivateData->ConfigAccess;
Status = gBS->InstallMultipleProtocolInterfaces (
&DriverHandle,
&gEfiDevicePathProtocolGuid,
&mTrEEHiiVendorDevicePath,
&gEfiHiiConfigAccessProtocolGuid,
ConfigAccess,
NULL
);
if (EFI_ERROR (Status)) {
return Status;
}
PrivateData->DriverHandle = DriverHandle;
//
// Publish the HII package list
//
HiiHandle = HiiAddPackages (
&gTrEEConfigFormSetGuid,
DriverHandle,
TrEEConfigDxeStrings,
TrEEConfigBin,
NULL
);
if (HiiHandle == NULL) {
gBS->UninstallMultipleProtocolInterfaces (
DriverHandle,
&gEfiDevicePathProtocolGuid,
&mTrEEHiiVendorDevicePath,
&gEfiHiiConfigAccessProtocolGuid,
ConfigAccess,
NULL
);
return EFI_OUT_OF_RESOURCES;
}
PrivateData->HiiHandle = HiiHandle;
return EFI_SUCCESS;
}
示例12: GetHiiHandle
VOID
GetHiiHandle (
VOID
)
{
if ( NULL == mHiiHandle ) {
mHiiHandle = HiiAddPackages ( &mAppGuid,
gImageHandle,
STRING_ARRAY_NAME,
NULL );
}
}
示例13: ExportFonts
/**
Routine to export glyphs to the HII database. This is in addition to whatever is defined in the Graphics Console driver.
**/
EFI_HII_HANDLE
ExportFonts (
VOID
)
{
return HiiAddPackages (
&mFontPackageGuid,
gImageHandle,
&mFontBin,
NULL
);
}
示例14: OemGetPackages
EFI_HII_HANDLE
EFIAPI
OemGetPackages (
)
{
return HiiAddPackages (
&gEfiCallerIdGuid,
NULL,
OemMiscLib2PStrings,
NULL,
NULL
);
}
示例15: InitializeStringSupport
/**
Initialize HII global accessor for string support.
**/
VOID
InitializeStringSupport (
VOID
)
{
gStringPackHandle = HiiAddPackages (
&mBdsStringPackGuid,
gImageHandle,
BdsDxeStrings,
NULL
);
ASSERT (gStringPackHandle != NULL);
}