mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-27 07:34:06 +02:00
add in a new API HiiLibGetSupportedSecondaryLanguages
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5063 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
33b3b83219
commit
c344685c0c
@ -91,12 +91,20 @@ HiiLibGetSupportedLanguages (
|
|||||||
// Collect current supported Languages for given HII handle
|
// Collect current supported Languages for given HII handle
|
||||||
//
|
//
|
||||||
BufferSize = 0x1000;
|
BufferSize = 0x1000;
|
||||||
LanguageString = AllocatePool (BufferSize);
|
LanguageString = AllocateZeroPool (BufferSize);
|
||||||
|
if (LanguageString == NULL) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
Status = mHiiStringProt->GetLanguages (mHiiStringProt, HiiHandle, LanguageString, &BufferSize);
|
Status = mHiiStringProt->GetLanguages (mHiiStringProt, HiiHandle, LanguageString, &BufferSize);
|
||||||
|
|
||||||
if (Status == EFI_BUFFER_TOO_SMALL) {
|
if (Status == EFI_BUFFER_TOO_SMALL) {
|
||||||
gBS->FreePool (LanguageString);
|
gBS->FreePool (LanguageString);
|
||||||
LanguageString = AllocatePool (BufferSize);
|
LanguageString = AllocateZeroPool (BufferSize);
|
||||||
|
if (LanguageString == NULL) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
Status = mHiiStringProt->GetLanguages (mHiiStringProt, HiiHandle, LanguageString, &BufferSize);
|
Status = mHiiStringProt->GetLanguages (mHiiStringProt, HiiHandle, LanguageString, &BufferSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -134,3 +142,45 @@ HiiLibGetSupportedLanguageNumber (
|
|||||||
|
|
||||||
return LangNumber;
|
return LangNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CHAR8 *
|
||||||
|
EFIAPI
|
||||||
|
HiiLibGetSupportedSecondaryLanguages (
|
||||||
|
IN EFI_HII_HANDLE HiiHandle,
|
||||||
|
IN CONST CHAR8 *FirstLanguage
|
||||||
|
)
|
||||||
|
{
|
||||||
|
EFI_STATUS Status;
|
||||||
|
UINTN BufferSize;
|
||||||
|
CHAR8 *LanguageString;
|
||||||
|
|
||||||
|
ASSERT (HiiHandle != NULL);
|
||||||
|
ASSERT (IsHiiHandleRegistered (HiiHandle));
|
||||||
|
//
|
||||||
|
// Collect current supported 2nd Languages for given HII handle
|
||||||
|
//
|
||||||
|
BufferSize = 0x1000;
|
||||||
|
LanguageString = AllocateZeroPool (BufferSize);
|
||||||
|
if (LanguageString == NULL) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
Status = mHiiStringProt->GetSecondaryLanguages (mHiiStringProt, HiiHandle, FirstLanguage, LanguageString, &BufferSize);
|
||||||
|
|
||||||
|
if (Status == EFI_BUFFER_TOO_SMALL) {
|
||||||
|
gBS->FreePool (LanguageString);
|
||||||
|
LanguageString = AllocateZeroPool (BufferSize);
|
||||||
|
if (LanguageString == NULL) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
Status = mHiiStringProt->GetSecondaryLanguages (mHiiStringProt, HiiHandle, FirstLanguage, LanguageString, &BufferSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
LanguageString = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return LanguageString;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -14,8 +14,8 @@
|
|||||||
|
|
||||||
#include "InternalHiiLib.h"
|
#include "InternalHiiLib.h"
|
||||||
|
|
||||||
EFI_HII_DATABASE_PROTOCOL *mHiiDatabaseProt;
|
CONST EFI_HII_DATABASE_PROTOCOL *mHiiDatabaseProt;
|
||||||
EFI_HII_STRING_PROTOCOL *mHiiStringProt;
|
CONST EFI_HII_STRING_PROTOCOL *mHiiStringProt;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The constructor function of Hii Library.
|
The constructor function of Hii Library.
|
||||||
|
@ -36,8 +36,8 @@
|
|||||||
#define HII_LIB_DEFAULT_STRING_SIZE 0x200
|
#define HII_LIB_DEFAULT_STRING_SIZE 0x200
|
||||||
|
|
||||||
|
|
||||||
extern EFI_HII_DATABASE_PROTOCOL *mHiiDatabaseProt;
|
extern CONST EFI_HII_DATABASE_PROTOCOL *mHiiDatabaseProt;
|
||||||
extern EFI_HII_STRING_PROTOCOL *mHiiStringProt;
|
extern CONST EFI_HII_STRING_PROTOCOL *mHiiStringProt;
|
||||||
|
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
IsHiiHandleRegistered (
|
IsHiiHandleRegistered (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user