14EFI_STRING gRTConfigRespBuffer =
NULL;
15UINTN gDatabaseInfoSize = 0;
16UINTN gConfigRespSize = 0;
17BOOLEAN gExportConfigResp =
FALSE;
18UINTN gNvDefaultStoreSize = 0;
19SKU_ID gSkuId = 0xFFFFFFFFFFFFFFFF;
51 if ((Private ==
NULL) || (DatabaseNode ==
NULL)) {
52 return EFI_INVALID_PARAMETER;
56 if (DatabaseRecord ==
NULL) {
57 return EFI_OUT_OF_RESOURCES;
60 DatabaseRecord->Signature = HII_DATABASE_RECORD_SIGNATURE;
63 if (DatabaseRecord->PackageList ==
NULL) {
65 return EFI_OUT_OF_RESOURCES;
68 PackageList = DatabaseRecord->PackageList;
76 PackageList->ImagePkg =
NULL;
77 PackageList->DevicePathPkg =
NULL;
83 if (HiiHandle ==
NULL) {
84 FreePool (DatabaseRecord->PackageList);
86 return EFI_OUT_OF_RESOURCES;
89 HiiHandle->Signature = HII_HANDLE_SIGNATURE;
93 Private->HiiHandleCount++;
94 HiiHandle->Key = (
UINTN)Private->HiiHandleCount;
105 InsertTailList (&Private->DatabaseList, &DatabaseRecord->DatabaseEntry);
107 *DatabaseNode = DatabaseRecord;
131 if (HiiHandle ==
NULL) {
135 if (HiiHandle->Signature != HII_HANDLE_SIGNATURE) {
163 IN VOID *PackageInstance,
164 IN UINT8 PackageType,
174 UINT32 ImageBlockSize;
175 UINT32 PaletteInfoSize;
177 if ((Private ==
NULL) || ((NotifyType & 0xF) == 0) || (PackageInstance ==
NULL)) {
178 return EFI_INVALID_PARAMETER;
181 if (Private->Signature != HII_DATABASE_PRIVATE_DATA_SIGNATURE) {
182 return EFI_INVALID_PARAMETER;
186 return EFI_INVALID_PARAMETER;
196 switch (PackageType) {
197 case EFI_HII_PACKAGE_TYPE_GUID:
201 case EFI_HII_PACKAGE_FORMS:
204 ASSERT (Buffer !=
NULL);
218 case EFI_HII_PACKAGE_KEYBOARD_LAYOUT:
222 case EFI_HII_PACKAGE_STRINGS:
226 ASSERT (Buffer !=
NULL);
235 BufferSize - HeaderSize
240 case EFI_HII_PACKAGE_FONTS:
244 ASSERT (Buffer !=
NULL);
253 BufferSize - HeaderSize
258 case EFI_HII_PACKAGE_IMAGES:
262 ASSERT (Buffer !=
NULL);
276 if (ImageBlockSize != 0) {
285 if (PaletteInfoSize != 0) {
287 Buffer + HeaderSize + ImageBlockSize,
291 HeaderSize += ImageBlockSize;
302 case EFI_HII_PACKAGE_SIMPLE_FONTS:
305 ASSERT (Buffer !=
NULL);
314 case EFI_HII_PACKAGE_DEVICE_PATH:
319 return EFI_INVALID_PARAMETER;
322 for (Link = Private->DatabaseNotifyList.ForwardLink;
323 Link != &Private->DatabaseNotifyList;
324 Link = Link->ForwardLink
328 if ((Notify->NotifyType == NotifyType) && (Notify->PackageType == PackageType)) {
332 if (PackageType != EFI_HII_PACKAGE_TYPE_GUID) {
333 Notify->PackageGuid =
NULL;
339 Notify->PackageNotifyFn (
349 if (Buffer !=
NULL) {
384 if ((PackageHdr ==
NULL) || (PackageList ==
NULL)) {
385 return EFI_INVALID_PARAMETER;
394 if (GuidPackage ==
NULL) {
395 return EFI_OUT_OF_RESOURCES;
399 if (GuidPackage->GuidPkg ==
NULL) {
401 return EFI_OUT_OF_RESOURCES;
404 GuidPackage->Signature = HII_GUID_PACKAGE_SIGNATURE;
405 CopyMem (GuidPackage->GuidPkg, PackageHdr, PackageHeader.Length);
406 InsertTailList (&PackageList->GuidPkgHdr, &GuidPackage->GuidEntry);
407 *Package = GuidPackage;
409 if (NotifyType == EFI_HII_DATABASE_NOTIFY_ADD_PACK) {
410 PackageList->PackageListHdr.PackageLength += PackageHeader.Length;
450 if ((PackageList ==
NULL) || (ResultSize ==
NULL)) {
451 return EFI_INVALID_PARAMETER;
454 if ((BufferSize > 0) && (Buffer ==
NULL)) {
455 return EFI_INVALID_PARAMETER;
461 for (Link = PackageList->GuidPkgHdr.ForwardLink; Link != &PackageList->GuidPkgHdr; Link = Link->ForwardLink) {
464 PackageLength += PackageHeader.Length;
465 if (PackageLength + *ResultSize + UsedSize <= BufferSize) {
468 EFI_HII_DATABASE_NOTIFY_EXPORT_PACK,
470 EFI_HII_PACKAGE_TYPE_GUID,
474 CopyMem (Buffer, GuidPackage->GuidPkg, PackageHeader.Length);
475 Buffer = (UINT8 *)Buffer + PackageHeader.Length;
479 *ResultSize += PackageLength;
509 ListHead = &PackageList->GuidPkgHdr;
513 ListHead->ForwardLink,
516 HII_GUID_PACKAGE_SIGNATURE
520 EFI_HII_DATABASE_NOTIFY_REMOVE_PACK,
522 EFI_HII_PACKAGE_TYPE_GUID,
525 if (EFI_ERROR (Status)) {
531 PackageList->PackageListHdr.PackageLength -= PackageHeader.Length;
553 UINTN EfiVarStoreNumber
558 for (Index = 0; Index < EfiVarStoreNumber; Index++) {
559 if (IfrQuestionHdr->VarStoreId == EfiVarStoreList[Index]->VarStoreId) {
564 return EfiVarStoreNumber;
581 IN UINT32 VarAttribute,
591 while (VariableHeader < VariableEnd) {
593 (VariableHeader->
Attributes == VarAttribute) &&
594 (
StrCmp (VarName, (CHAR16 *)(VariableHeader + 1)) == 0))
596 return VariableHeader;
620 IN UINT32 VarAttribute,
627 VariableEnd = (
VARIABLE_HEADER *)((UINT8 *)VariableStorage + VariableStorage->Size);
630 while (VariableHeader < VariableEnd) {
632 (VariableHeader->
Attributes == VarAttribute) &&
633 (
StrCmp (VarName, (CHAR16 *)(VariableHeader + 1)) == 0))
635 return VariableHeader;
663 OUT VOID *ValueBuffer,
665 IN BOOLEAN BitFieldQuestion
690 if (gSkuId == 0xFFFFFFFFFFFFFFFF) {
697 VariableStorage =
NULL;
698 Link = gVarStorageList.ForwardLink;
699 while (Link != &gVarStorageList) {
701 if (Entry->DefaultId == DefaultId) {
702 VariableStorage = Entry->VariableStorage;
706 Link = Link->ForwardLink;
709 if (Link == &gVarStorageList) {
710 DataBuffer = (UINT8 *)
PcdGetPtr (PcdNvStoreDefaultValueBuffer);
716 NvStoreBuffer = (
VARIABLE_STORE_HEADER *)((UINT8 *)DataHeader +
sizeof (DataHeader->DataSize) + DataHeader->HeaderSize);
718 ASSERT (VariableStorage !=
NULL);
719 CopyMem (VariableStorage, NvStoreBuffer, NvStoreBuffer->
Size);
725 DefaultInfo = &(DataHeader->DefaultInfo[0]);
726 BufferEnd = (UINT8 *)DataHeader +
sizeof (DataHeader->DataSize) + DataHeader->HeaderSize;
727 while ((UINT8 *)DefaultInfo < BufferEnd) {
728 if ((DefaultInfo->DefaultId == DefaultId) && (DefaultInfo->SkuId == gSkuId)) {
741 while (!IsFound && Index < gNvDefaultStoreSize && DataHeader->DataSize != 0xFFFF) {
742 DefaultInfo = &(DataHeader->DefaultInfo[0]);
743 BufferEnd = (UINT8 *)DataHeader +
sizeof (DataHeader->DataSize) + DataHeader->HeaderSize;
744 while ((UINT8 *)DefaultInfo < BufferEnd) {
745 if ((DefaultInfo->DefaultId == DefaultId) && (DefaultInfo->SkuId == gSkuId)) {
755 BufferEnd = (UINT8 *)DataHeader + DataHeader->DataSize;
756 while ((UINT8 *)DeltaData < BufferEnd) {
757 *((UINT8 *)VariableStorage + DeltaData->Offset) = (UINT8)DeltaData->Value;
764 Index = (Index + DataHeader->DataSize + 7) & (~7);
773 VariableStorage =
NULL;
778 Entry->DefaultId = DefaultId;
779 Entry->VariableStorage = VariableStorage;
781 }
else if (VariableStorage !=
NULL) {
783 VariableStorage =
NULL;
790 if (VariableStorage ==
NULL) {
791 return EFI_NOT_FOUND;
794 VarCheck = (BOOLEAN)(
CompareGuid (&VariableStorage->
Signature, &gEfiAuthenticatedVariableGuid));
800 AuthVariableHeader =
AuthFindVariableData (VariableStorage, &EfiVarStore->Guid, EfiVarStore->Attributes, (CHAR16 *)EfiVarStore->Name);
801 if (AuthVariableHeader ==
NULL) {
802 return EFI_NOT_FOUND;
807 ByteOffset = IfrQuestionHdr->VarStoreInfo.VarOffset;
808 if (BitFieldQuestion) {
809 BitOffset = IfrQuestionHdr->VarStoreInfo.VarOffset;
810 ByteOffset = BitOffset / 8;
812 StartBit = BitOffset % 8;
813 EndBit = StartBit + BitWidth - 1;
814 Width = EndBit / 8 + 1;
817 if (AuthVariableHeader->
DataSize < ByteOffset + Width) {
818 return EFI_INVALID_PARAMETER;
824 if (ValueBuffer !=
NULL) {
825 if (BitFieldQuestion) {
828 CopyMem (ValueBuffer, &BitFieldVal, Width);
837 VariableHeader =
FindVariableData (VariableStorage, &EfiVarStore->Guid, EfiVarStore->Attributes, (CHAR16 *)EfiVarStore->Name);
838 if (VariableHeader ==
NULL) {
839 return EFI_NOT_FOUND;
844 ByteOffset = IfrQuestionHdr->VarStoreInfo.VarOffset;
845 if (BitFieldQuestion) {
846 BitOffset = IfrQuestionHdr->VarStoreInfo.VarOffset;
847 ByteOffset = BitOffset / 8;
849 StartBit = BitOffset % 8;
850 EndBit = StartBit + BitWidth - 1;
851 Width = EndBit / 8 + 1;
854 if (VariableHeader->
DataSize < ByteOffset + Width) {
855 return EFI_INVALID_PARAMETER;
861 if (ValueBuffer !=
NULL) {
862 if (BitFieldQuestion) {
865 CopyMem (ValueBuffer, &BitFieldVal, Width);
867 CopyMem (ValueBuffer, (UINT8 *)VariableHeader +
sizeof (
VARIABLE_HEADER) + VariableHeader->
NameSize + IfrQuestionHdr->VarStoreInfo.VarOffset, Width);
891 UINT8 IfrQuestionType;
895 UINTN EfiVarStoreMaxNum;
896 UINTN EfiVarStoreNumber;
897 UINT16 *DefaultIdList;
898 UINTN DefaultIdNumber;
899 UINTN DefaultIdMaxNum;
901 UINTN EfiVarStoreIndex;
904 BOOLEAN StandardDefaultIsSet;
905 BOOLEAN ManufactDefaultIsSet;
911 BOOLEAN QuestionReferBitField;
916 if (gNvDefaultStoreSize == 0) {
917 gNvDefaultStoreSize =
PcdGetSize (PcdNvStoreDefaultValueBuffer);
924 ZeroMem (&VarStoreQuestionHeader,
sizeof (VarStoreQuestionHeader));
930 IfrQuestionHdr =
NULL;
932 EfiVarStoreMaxNum = 0;
933 EfiVarStoreNumber = 0;
936 EfiVarStoreList =
NULL;
937 DefaultIdList =
NULL;
938 StandardDefaultIsSet =
FALSE;
939 ManufactDefaultIsSet =
FALSE;
940 QuestionReferBitField =
FALSE;
942 while (IfrOffset < PackageLength) {
943 switch (IfrOpHdr->OpCode) {
944 case EFI_IFR_VARSTORE_EFI_OP:
945 if (EfiVarStoreNumber >= EfiVarStoreMaxNum) {
949 EfiVarStoreList =
ReallocatePool (EfiVarStoreMaxNum *
sizeof (
UINTN), (EfiVarStoreMaxNum + BASE_NUMBER) *
sizeof (
UINTN), EfiVarStoreList);
950 if (EfiVarStoreList ==
NULL) {
954 EfiVarStoreMaxNum = EfiVarStoreMaxNum + BASE_NUMBER;
961 EfiVarStoreList[EfiVarStoreNumber] =
AllocatePool (IfrEfiVarStore->Header.Length +
AsciiStrSize ((CHAR8 *)IfrEfiVarStore->Name));
962 if (EfiVarStoreList[EfiVarStoreNumber] ==
NULL) {
966 CopyMem (EfiVarStoreList[EfiVarStoreNumber], IfrEfiVarStore, IfrEfiVarStore->Header.Length);
967 AsciiStrToUnicodeStrS ((CHAR8 *)IfrEfiVarStore->Name, (CHAR16 *)&(EfiVarStoreList[EfiVarStoreNumber]->Name[0]),
AsciiStrSize ((CHAR8 *)IfrEfiVarStore->Name) * sizeof (CHAR16));
969 if (!EFI_ERROR (Status)) {
972 FreePool (EfiVarStoreList[EfiVarStoreNumber]);
973 EfiVarStoreList[EfiVarStoreNumber] =
NULL;
977 case EFI_IFR_DEFAULTSTORE_OP:
978 if (DefaultIdNumber >= DefaultIdMaxNum) {
982 DefaultIdList =
ReallocatePool (DefaultIdMaxNum *
sizeof (UINT16), (DefaultIdMaxNum + BASE_NUMBER) *
sizeof (UINT16), DefaultIdList);
983 if (DefaultIdList ==
NULL) {
987 DefaultIdMaxNum = DefaultIdMaxNum + BASE_NUMBER;
992 case EFI_IFR_FORM_OP:
993 case EFI_IFR_FORM_MAP_OP:
997 if ((EfiVarStoreNumber == 0) || (DefaultIdNumber == 0)) {
1002 case EFI_IFR_CHECKBOX_OP:
1003 IfrScope = IfrOpHdr->Scope;
1004 IfrQuestionType = IfrOpHdr->OpCode;
1008 Width =
sizeof (BOOLEAN);
1009 if (EfiVarStoreIndex < EfiVarStoreNumber) {
1010 for (Index = 0; Index < DefaultIdNumber; Index++) {
1011 if (DefaultIdList[Index] == EFI_HII_DEFAULT_CLASS_STANDARD) {
1012 Status =
FindQuestionDefaultSetting (DefaultIdList[Index], EfiVarStoreList[EfiVarStoreIndex], IfrQuestionHdr, &IfrValue,
sizeof (BOOLEAN), QuestionReferBitField);
1013 if (!EFI_ERROR (Status)) {
1015 IfrCheckBox->Flags = IfrCheckBox->Flags | EFI_IFR_CHECKBOX_DEFAULT;
1017 IfrCheckBox->Flags = IfrCheckBox->Flags & (~EFI_IFR_CHECKBOX_DEFAULT);
1020 }
else if (DefaultIdList[Index] == EFI_HII_DEFAULT_CLASS_MANUFACTURING) {
1021 Status =
FindQuestionDefaultSetting (DefaultIdList[Index], EfiVarStoreList[EfiVarStoreIndex], IfrQuestionHdr, &IfrValue,
sizeof (BOOLEAN), QuestionReferBitField);
1022 if (!EFI_ERROR (Status)) {
1024 IfrCheckBox->Flags = IfrCheckBox->Flags | EFI_IFR_CHECKBOX_DEFAULT_MFG;
1026 IfrCheckBox->Flags = IfrCheckBox->Flags & (~EFI_IFR_CHECKBOX_DEFAULT_MFG);
1034 case EFI_IFR_NUMERIC_OP:
1035 IfrScope = IfrOpHdr->Scope;
1036 IfrQuestionType = IfrOpHdr->OpCode;
1038 if (QuestionReferBitField) {
1041 Width = (
UINTN)((UINT32)1 << (((
EFI_IFR_ONE_OF *)IfrOpHdr)->Flags & EFI_IFR_NUMERIC_SIZE));
1045 case EFI_IFR_ONE_OF_OP:
1046 IfrScope = IfrOpHdr->Scope;
1047 IfrQuestionType = IfrOpHdr->OpCode;
1049 if (QuestionReferBitField) {
1052 Width = (
UINTN)((UINT32)1 << (((
EFI_IFR_ONE_OF *)IfrOpHdr)->Flags & EFI_IFR_NUMERIC_SIZE));
1056 StandardDefaultIsSet =
FALSE;
1057 ManufactDefaultIsSet =
FALSE;
1061 if (EfiVarStoreIndex < EfiVarStoreNumber) {
1062 for (Index = 0; Index < DefaultIdNumber; Index++) {
1063 if (DefaultIdList[Index] == EFI_HII_DEFAULT_CLASS_STANDARD) {
1064 Status =
FindQuestionDefaultSetting (EFI_HII_DEFAULT_CLASS_STANDARD, EfiVarStoreList[EfiVarStoreIndex], IfrQuestionHdr, &IfrValue, Width, QuestionReferBitField);
1065 if (!EFI_ERROR (Status)) {
1066 StandardDefaultIsSet =
TRUE;
1068 }
else if (DefaultIdList[Index] == EFI_HII_DEFAULT_CLASS_MANUFACTURING) {
1069 Status =
FindQuestionDefaultSetting (EFI_HII_DEFAULT_CLASS_MANUFACTURING, EfiVarStoreList[EfiVarStoreIndex], IfrQuestionHdr, &IfrManufactValue, Width, QuestionReferBitField);
1070 if (!EFI_ERROR (Status)) {
1071 ManufactDefaultIsSet =
TRUE;
1078 case EFI_IFR_ORDERED_LIST_OP:
1079 IfrScope = IfrOpHdr->Scope;
1080 IfrQuestionType = IfrOpHdr->OpCode;
1083 case EFI_IFR_ONE_OF_OPTION_OP:
1084 if ((IfrQuestionHdr !=
NULL) && (IfrScope > 0)) {
1086 if (IfrQuestionType == EFI_IFR_ONE_OF_OP) {
1087 Width = (
UINTN)((UINT32)1 << (IfrOneOfOption->Flags & EFI_IFR_NUMERIC_SIZE));
1088 if (StandardDefaultIsSet) {
1089 if (
CompareMem (&IfrOneOfOption->Value, &IfrValue, Width) == 0) {
1090 IfrOneOfOption->Flags |= EFI_IFR_OPTION_DEFAULT;
1092 IfrOneOfOption->Flags &= ~EFI_IFR_OPTION_DEFAULT;
1096 if (ManufactDefaultIsSet) {
1097 if (
CompareMem (&IfrOneOfOption->Value, &IfrManufactValue, Width) == 0) {
1098 IfrOneOfOption->Flags |= EFI_IFR_OPTION_DEFAULT_MFG;
1100 IfrOneOfOption->Flags &= ~EFI_IFR_OPTION_DEFAULT_MFG;
1107 case EFI_IFR_DEFAULT_OP:
1108 if ((IfrQuestionHdr !=
NULL) && (IfrScope > 0)) {
1113 if (!QuestionReferBitField) {
1115 if ((IfrDefault->Type == EFI_IFR_TYPE_NUM_SIZE_8) || (IfrDefault->Type == EFI_IFR_TYPE_BOOLEAN)) {
1117 }
else if (IfrDefault->Type == EFI_IFR_TYPE_NUM_SIZE_16) {
1119 }
else if (IfrDefault->Type == EFI_IFR_TYPE_NUM_SIZE_32) {
1121 }
else if (IfrDefault->Type == EFI_IFR_TYPE_NUM_SIZE_64) {
1123 }
else if (IfrDefault->Type == EFI_IFR_TYPE_BUFFER) {
1133 if (EfiVarStoreIndex < EfiVarStoreNumber) {
1134 Status =
FindQuestionDefaultSetting (IfrDefault->DefaultId, EfiVarStoreList[EfiVarStoreIndex], IfrQuestionHdr, &IfrDefault->Value, Width, QuestionReferBitField);
1140 case EFI_IFR_END_OP:
1141 if (IfrQuestionHdr !=
NULL) {
1146 if (IfrScope == 0) {
1147 IfrQuestionHdr =
NULL;
1148 QuestionReferBitField =
FALSE;
1153 case EFI_IFR_GUID_OP:
1155 QuestionReferBitField =
TRUE;
1163 IfrOffset = IfrOffset + IfrOpHdr->Length;
1166 IfrScope += IfrOpHdr->Scope;
1171 if (EfiVarStoreList !=
NULL) {
1172 for (Index = 0; Index < EfiVarStoreNumber; Index++) {
1199 IN VOID *PackageHdr,
1208 if ((PackageHdr ==
NULL) || (PackageList ==
NULL)) {
1209 return EFI_INVALID_PARAMETER;
1221 if (FormPackage ==
NULL) {
1222 return EFI_OUT_OF_RESOURCES;
1226 if (FormPackage->IfrData ==
NULL) {
1228 return EFI_OUT_OF_RESOURCES;
1231 FormPackage->Signature = HII_IFR_PACKAGE_SIGNATURE;
1241 FormPackage->IfrData,
1246 InsertTailList (&PackageList->FormPkgHdr, &FormPackage->IfrEntry);
1247 *Package = FormPackage;
1254 if (NotifyType == EFI_HII_DATABASE_NOTIFY_ADD_PACK) {
1255 PackageList->PackageListHdr.PackageLength += FormPackage->FormPkgHdr.Length;
1285 IN OUT VOID *Buffer,
1290 UINTN PackageLength;
1294 if ((Private ==
NULL) || (PackageList ==
NULL) || (ResultSize ==
NULL)) {
1295 return EFI_INVALID_PARAMETER;
1298 if ((BufferSize > 0) && (Buffer ==
NULL)) {
1299 return EFI_INVALID_PARAMETER;
1308 for (Link = PackageList->FormPkgHdr.ForwardLink; Link != &PackageList->FormPkgHdr; Link = Link->ForwardLink) {
1310 PackageLength += FormPackage->FormPkgHdr.Length;
1311 if ((Buffer !=
NULL) && (PackageLength + *ResultSize + UsedSize <= BufferSize)) {
1317 EFI_HII_DATABASE_NOTIFY_EXPORT_PACK,
1318 (VOID *)FormPackage,
1319 EFI_HII_PACKAGE_FORMS,
1330 (VOID *)FormPackage->IfrData,
1337 *ResultSize += PackageLength;
1367 ListHead = &PackageList->FormPkgHdr;
1371 ListHead->ForwardLink,
1374 HII_IFR_PACKAGE_SIGNATURE
1378 EFI_HII_DATABASE_NOTIFY_REMOVE_PACK,
1380 EFI_HII_PACKAGE_FORMS,
1383 if (EFI_ERROR (Status)) {
1388 PackageList->PackageListHdr.PackageLength -= Package->FormPkgHdr.Length;
1398 if (gExportAfterReadyToBoot) {
1399 gExportConfigResp =
TRUE;
1429 IN VOID *PackageHdr,
1440 UINT32 LanguageSize;
1443 if ((Private ==
NULL) || (PackageHdr ==
NULL) || (PackageList ==
NULL)) {
1444 return EFI_INVALID_PARAMETER;
1447 if (Private->Signature != HII_DATABASE_PRIVATE_DATA_SIGNATURE) {
1448 return EFI_INVALID_PARAMETER;
1460 if (Language ==
NULL) {
1461 return EFI_OUT_OF_RESOURCES;
1464 AsciiStrCpyS (Language, LanguageSize /
sizeof (CHAR8), (CHAR8 *)PackageHdr + HeaderSize - LanguageSize);
1465 for (Link = PackageList->StringPkgHdr.ForwardLink; Link != &PackageList->StringPkgHdr; Link = Link->ForwardLink) {
1469 return EFI_UNSUPPORTED;
1479 if (StringPackage ==
NULL) {
1480 Status = EFI_OUT_OF_RESOURCES;
1485 if (StringPackage->StringPkgHdr ==
NULL) {
1486 Status = EFI_OUT_OF_RESOURCES;
1490 StringPackage->StringBlock = (UINT8 *)
AllocateZeroPool (PackageHeader.Length - HeaderSize);
1491 if (StringPackage->StringBlock ==
NULL) {
1492 Status = EFI_OUT_OF_RESOURCES;
1496 StringPackage->Signature = HII_STRING_PACKAGE_SIGNATURE;
1497 StringPackage->FontId = 0;
1503 CopyMem (StringPackage->StringPkgHdr, PackageHdr, HeaderSize);
1509 StringPackage->StringBlock,
1510 (UINT8 *)PackageHdr + HeaderSize,
1511 PackageHeader.Length - HeaderSize
1518 if (EFI_ERROR (Status)) {
1525 InsertTailList (&PackageList->StringPkgHdr, &StringPackage->StringEntry);
1526 *Package = StringPackage;
1528 if (NotifyType == EFI_HII_DATABASE_NOTIFY_ADD_PACK) {
1529 PackageList->PackageListHdr.PackageLength += StringPackage->StringPkgHdr->Header.Length;
1536 if (StringPackage !=
NULL) {
1537 if (StringPackage->StringBlock !=
NULL) {
1538 FreePool (StringPackage->StringBlock);
1541 if (StringPackage->StringPkgHdr !=
NULL) {
1542 FreePool (StringPackage->StringPkgHdr);
1567 UINT32 Skip2BlockSize;
1568 UINT32 OldBlockSize;
1571 EFI_STRING_ID MaxStringId;
1575 for (Link = PackageList->StringPkgHdr.ForwardLink;
1576 Link != &PackageList->StringPkgHdr;
1577 Link = Link->ForwardLink
1581 if (MaxStringId < StringPackage->MaxStringId) {
1582 MaxStringId = StringPackage->MaxStringId;
1586 for (Link = PackageList->StringPkgHdr.ForwardLink;
1587 Link != &PackageList->StringPkgHdr;
1588 Link = Link->ForwardLink
1592 if (StringPackage->MaxStringId < MaxStringId) {
1593 OldBlockSize = StringPackage->StringPkgHdr->Header.Length - StringPackage->StringPkgHdr->HdrSize;
1597 SkipCount = (UINT16)(MaxStringId - StringPackage->MaxStringId);
1601 if (StringBlock ==
NULL) {
1602 return EFI_OUT_OF_RESOURCES;
1613 *BlockPtr = EFI_HII_SIBT_SKIP2;
1614 CopyMem (BlockPtr + 1, &SkipCount,
sizeof (UINT16));
1620 *BlockPtr = EFI_HII_SIBT_END;
1621 FreePool (StringPackage->StringBlock);
1622 StringPackage->StringBlock = StringBlock;
1623 StringPackage->StringPkgHdr->Header.Length += Skip2BlockSize;
1624 PackageList->PackageListHdr.PackageLength += Skip2BlockSize;
1625 StringPackage->MaxStringId = MaxStringId;
1656 IN OUT VOID *Buffer,
1661 UINTN PackageLength;
1665 if ((Private ==
NULL) || (PackageList ==
NULL) || (ResultSize ==
NULL)) {
1666 return EFI_INVALID_PARAMETER;
1669 if ((BufferSize > 0) && (Buffer ==
NULL)) {
1670 return EFI_INVALID_PARAMETER;
1676 for (Link = PackageList->StringPkgHdr.ForwardLink; Link != &PackageList->StringPkgHdr; Link = Link->ForwardLink) {
1678 PackageLength += StringPackage->StringPkgHdr->Header.Length;
1679 if (PackageLength + *ResultSize + UsedSize <= BufferSize) {
1685 EFI_HII_DATABASE_NOTIFY_EXPORT_PACK,
1686 (VOID *)StringPackage,
1687 EFI_HII_PACKAGE_STRINGS,
1694 CopyMem (Buffer, StringPackage->StringPkgHdr, StringPackage->StringPkgHdr->HdrSize);
1695 Buffer = (UINT8 *)Buffer + StringPackage->StringPkgHdr->HdrSize;
1702 StringPackage->StringBlock,
1703 StringPackage->StringPkgHdr->Header.Length - StringPackage->StringPkgHdr->HdrSize
1705 Buffer = (UINT8 *)Buffer + StringPackage->StringPkgHdr->Header.Length - StringPackage->StringPkgHdr->HdrSize;
1709 *ResultSize += PackageLength;
1739 ListHead = &PackageList->StringPkgHdr;
1743 ListHead->ForwardLink,
1746 HII_STRING_PACKAGE_SIGNATURE
1750 EFI_HII_DATABASE_NOTIFY_REMOVE_PACK,
1752 EFI_HII_PACKAGE_STRINGS,
1755 if (EFI_ERROR (Status)) {
1760 PackageList->PackageListHdr.PackageLength -= Package->StringPkgHdr->Header.Length;
1768 Package->FontInfoList.ForwardLink,
1771 HII_FONT_INFO_SIGNATURE
1806 IN VOID *PackageHdr,
1818 UINT32 FontInfoSize;
1821 if ((Private ==
NULL) || (PackageHdr ==
NULL) || (PackageList ==
NULL)) {
1822 return EFI_INVALID_PARAMETER;
1838 if (FontPkgHdr ==
NULL) {
1839 Status = EFI_OUT_OF_RESOURCES;
1843 CopyMem (FontPkgHdr, PackageHdr, HeaderSize);
1847 if (FontInfo ==
NULL) {
1848 Status = EFI_OUT_OF_RESOURCES;
1852 FontInfo->FontStyle = FontPkgHdr->FontStyle;
1853 FontInfo->
FontSize = FontPkgHdr->Cell.Height;
1857 Status = EFI_UNSUPPORTED;
1865 if (FontPackage ==
NULL) {
1866 Status = EFI_OUT_OF_RESOURCES;
1870 FontPackage->Signature = HII_FONT_PACKAGE_SIGNATURE;
1871 FontPackage->FontPkgHdr = FontPkgHdr;
1874 FontPackage->GlyphBlock = (UINT8 *)
AllocateZeroPool (PackageHeader.Length - HeaderSize);
1875 if (FontPackage->GlyphBlock ==
NULL) {
1876 Status = EFI_OUT_OF_RESOURCES;
1880 CopyMem (FontPackage->GlyphBlock, (UINT8 *)PackageHdr + HeaderSize, PackageHeader.Length - HeaderSize);
1886 if (EFI_ERROR (Status)) {
1895 if (GlobalFont ==
NULL) {
1896 Status = EFI_OUT_OF_RESOURCES;
1900 GlobalFont->Signature = HII_GLOBAL_FONT_INFO_SIGNATURE;
1901 GlobalFont->FontPackage = FontPackage;
1902 GlobalFont->FontInfoSize = FontInfoSize;
1903 GlobalFont->FontInfo = FontInfo;
1909 InsertTailList (&PackageList->FontPkgHdr, &FontPackage->FontEntry);
1910 *Package = FontPackage;
1912 if (NotifyType == EFI_HII_DATABASE_NOTIFY_ADD_PACK) {
1913 PackageList->PackageListHdr.PackageLength += FontPackage->FontPkgHdr->Header.Length;
1920 if (FontPkgHdr !=
NULL) {
1924 if (FontInfo !=
NULL) {
1928 if (FontPackage !=
NULL) {
1929 if (FontPackage->GlyphBlock !=
NULL) {
1930 FreePool (FontPackage->GlyphBlock);
1936 if (GlobalFont !=
NULL) {
1967 IN OUT VOID *Buffer,
1972 UINTN PackageLength;
1976 if ((Private ==
NULL) || (PackageList ==
NULL) || (ResultSize ==
NULL)) {
1977 return EFI_INVALID_PARAMETER;
1980 if ((BufferSize > 0) && (Buffer ==
NULL)) {
1981 return EFI_INVALID_PARAMETER;
1987 for (Link = PackageList->FontPkgHdr.ForwardLink; Link != &PackageList->FontPkgHdr; Link = Link->ForwardLink) {
1989 PackageLength += Package->FontPkgHdr->Header.Length;
1990 if (PackageLength + *ResultSize + UsedSize <= BufferSize) {
1996 EFI_HII_DATABASE_NOTIFY_EXPORT_PACK,
1998 EFI_HII_PACKAGE_FONTS,
2005 CopyMem (Buffer, Package->FontPkgHdr, Package->FontPkgHdr->HdrSize);
2006 Buffer = (UINT8 *)Buffer + Package->FontPkgHdr->HdrSize;
2013 Package->GlyphBlock,
2014 Package->FontPkgHdr->Header.Length - Package->FontPkgHdr->HdrSize
2016 Buffer = (UINT8 *)Buffer + Package->FontPkgHdr->Header.Length - Package->FontPkgHdr->HdrSize;
2020 *ResultSize += PackageLength;
2052 ListHead = &PackageList->FontPkgHdr;
2056 ListHead->ForwardLink,
2059 HII_FONT_PACKAGE_SIGNATURE
2063 EFI_HII_DATABASE_NOTIFY_REMOVE_PACK,
2065 EFI_HII_PACKAGE_FONTS,
2068 if (EFI_ERROR (Status)) {
2073 PackageList->PackageListHdr.PackageLength -= Package->FontPkgHdr->Header.Length;
2075 if (Package->GlyphBlock !=
NULL) {
2085 Package->GlyphInfoList.ForwardLink,
2088 HII_GLYPH_INFO_SIGNATURE
2097 for (Link = Private->FontInfoList.ForwardLink; Link != &Private->FontInfoList; Link = Link->ForwardLink) {
2099 if (GlobalFont->FontPackage == Package) {
2132 IN VOID *PackageHdr,
2144 UINT32 PaletteInfoOffset;
2145 UINT32 ImageInfoOffset;
2148 if ((PackageHdr ==
NULL) || (PackageList ==
NULL)) {
2149 return EFI_INVALID_PARAMETER;
2155 if (PackageList->ImagePkg !=
NULL) {
2156 return EFI_INVALID_PARAMETER;
2163 if (ImagePackage ==
NULL) {
2164 return EFI_OUT_OF_RESOURCES;
2172 PaletteInfoOffset = ImagePackage->ImagePkgHdr.PaletteInfoOffset;
2173 ImageInfoOffset = ImagePackage->ImagePkgHdr.ImageInfoOffset;
2179 ImagePackage->PaletteBlock =
NULL;
2180 if (PaletteInfoOffset != 0) {
2185 for (Index = 0; Index < PaletteHdr->PaletteCount; Index++) {
2186 CopyMem (&CurrentSize, PaletteInfo,
sizeof (UINT16));
2187 CurrentSize +=
sizeof (UINT16);
2188 PaletteSize += (UINT32)CurrentSize;
2193 if (ImagePackage->PaletteBlock ==
NULL) {
2195 return EFI_OUT_OF_RESOURCES;
2199 ImagePackage->PaletteBlock,
2200 (UINT8 *)PackageHdr + PaletteInfoOffset,
2209 ImagePackage->ImageBlock =
NULL;
2210 if (ImageInfoOffset != 0) {
2211 ImageSize = ImagePackage->ImagePkgHdr.Header.Length -
2214 if (ImagePackage->ImageBlock ==
NULL) {
2215 FreePool (ImagePackage->PaletteBlock);
2217 return EFI_OUT_OF_RESOURCES;
2221 ImagePackage->ImageBlock,
2222 (UINT8 *)PackageHdr + ImageInfoOffset,
2227 ImagePackage->ImageBlockSize = ImageSize;
2228 ImagePackage->PaletteInfoSize = PaletteSize;
2229 PackageList->ImagePkg = ImagePackage;
2230 *Package = ImagePackage;
2232 if (NotifyType == EFI_HII_DATABASE_NOTIFY_ADD_PACK) {
2233 PackageList->PackageListHdr.PackageLength += ImagePackage->ImagePkgHdr.Header.Length;
2263 IN OUT VOID *Buffer,
2267 UINTN PackageLength;
2271 if ((Private ==
NULL) || (PackageList ==
NULL) || (ResultSize ==
NULL)) {
2272 return EFI_INVALID_PARAMETER;
2275 if ((BufferSize > 0) && (Buffer ==
NULL)) {
2276 return EFI_INVALID_PARAMETER;
2279 Package = PackageList->ImagePkg;
2281 if (Package ==
NULL) {
2285 PackageLength = Package->ImagePkgHdr.Header.Length;
2287 if (PackageLength + *ResultSize + UsedSize <= BufferSize) {
2293 EFI_HII_DATABASE_NOTIFY_EXPORT_PACK,
2295 EFI_HII_PACKAGE_IMAGES,
2300 Package->ImagePkgHdr.Header.Length ==
2313 if (Package->ImageBlockSize != 0) {
2314 CopyMem (Buffer, Package->ImageBlock, Package->ImageBlockSize);
2315 Buffer = (UINT8 *)Buffer + Package->ImageBlockSize;
2321 if (Package->PaletteInfoSize != 0) {
2322 CopyMem (Buffer, Package->PaletteBlock, Package->PaletteInfoSize);
2323 Buffer = (UINT8 *)Buffer + Package->PaletteInfoSize;
2327 *ResultSize += PackageLength;
2355 Package = PackageList->ImagePkg;
2360 if (Package ==
NULL) {
2366 EFI_HII_DATABASE_NOTIFY_REMOVE_PACK,
2368 EFI_HII_PACKAGE_IMAGES,
2371 if (EFI_ERROR (Status)) {
2375 PackageList->PackageListHdr.PackageLength -= Package->ImagePkgHdr.Header.Length;
2378 if (Package->PaletteBlock !=
NULL) {
2384 PackageList->ImagePkg =
NULL;
2408 IN VOID *PackageHdr,
2418 if ((PackageHdr ==
NULL) || (PackageList ==
NULL)) {
2419 return EFI_INVALID_PARAMETER;
2426 if (SimpleFontPackage ==
NULL) {
2427 Status = EFI_OUT_OF_RESOURCES;
2431 SimpleFontPackage->Signature = HII_S_FONT_PACKAGE_SIGNATURE;
2439 if (SimpleFontPackage->SimpleFontPkgHdr ==
NULL) {
2440 Status = EFI_OUT_OF_RESOURCES;
2444 CopyMem (SimpleFontPackage->SimpleFontPkgHdr, PackageHdr, Header.Length);
2449 InsertTailList (&PackageList->SimpleFontPkgHdr, &SimpleFontPackage->SimpleFontEntry);
2450 *Package = SimpleFontPackage;
2452 if (NotifyType == EFI_HII_DATABASE_NOTIFY_ADD_PACK) {
2453 PackageList->PackageListHdr.PackageLength += Header.Length;
2460 if (SimpleFontPackage !=
NULL) {
2461 if (SimpleFontPackage->SimpleFontPkgHdr !=
NULL) {
2462 FreePool (SimpleFontPackage->SimpleFontPkgHdr);
2495 IN OUT VOID *Buffer,
2500 UINTN PackageLength;
2504 if ((Private ==
NULL) || (PackageList ==
NULL) || (ResultSize ==
NULL)) {
2505 return EFI_INVALID_PARAMETER;
2508 if ((BufferSize > 0) && (Buffer ==
NULL)) {
2509 return EFI_INVALID_PARAMETER;
2515 for (Link = PackageList->SimpleFontPkgHdr.ForwardLink; Link != &PackageList->SimpleFontPkgHdr; Link = Link->ForwardLink) {
2517 PackageLength += Package->SimpleFontPkgHdr->Header.Length;
2518 if (PackageLength + *ResultSize + UsedSize <= BufferSize) {
2524 EFI_HII_DATABASE_NOTIFY_EXPORT_PACK,
2526 EFI_HII_PACKAGE_SIMPLE_FONTS,
2534 CopyMem (Buffer, Package->SimpleFontPkgHdr, Package->SimpleFontPkgHdr->Header.Length);
2535 Buffer = (UINT8 *)Buffer + Package->SimpleFontPkgHdr->Header.Length;
2539 *ResultSize += PackageLength;
2568 ListHead = &PackageList->SimpleFontPkgHdr;
2572 ListHead->ForwardLink,
2575 HII_S_FONT_PACKAGE_SIGNATURE
2579 EFI_HII_DATABASE_NOTIFY_REMOVE_PACK,
2581 EFI_HII_PACKAGE_SIMPLE_FONTS,
2584 if (EFI_ERROR (Status)) {
2589 PackageList->PackageListHdr.PackageLength -= Package->SimpleFontPkgHdr->Header.Length;
2590 FreePool (Package->SimpleFontPkgHdr);
2620 UINT32 PackageLength;
2623 if ((DevicePath ==
NULL) || (PackageList ==
NULL)) {
2624 return EFI_INVALID_PARAMETER;
2630 if (PackageList->DevicePathPkg !=
NULL) {
2631 return EFI_INVALID_PARAMETER;
2636 if (PackageList->DevicePathPkg ==
NULL) {
2637 return EFI_OUT_OF_RESOURCES;
2640 Header.Length = PackageLength;
2641 Header.Type = EFI_HII_PACKAGE_DEVICE_PATH;
2653 PackageList->PackageListHdr.PackageLength += PackageLength;
2681 IN OUT VOID *Buffer,
2689 if ((Private ==
NULL) || (PackageList ==
NULL) || (ResultSize ==
NULL)) {
2690 return EFI_INVALID_PARAMETER;
2693 if ((BufferSize > 0) && (Buffer ==
NULL)) {
2694 return EFI_INVALID_PARAMETER;
2697 Package = PackageList->DevicePathPkg;
2699 if (Package ==
NULL) {
2705 if (Header.Length + *ResultSize + UsedSize <= BufferSize) {
2711 EFI_HII_DATABASE_NOTIFY_EXPORT_PACK,
2713 EFI_HII_PACKAGE_DEVICE_PATH,
2721 CopyMem (Buffer, Package, Header.Length);
2724 *ResultSize += Header.Length;
2752 Package = PackageList->DevicePathPkg;
2757 if (Package ==
NULL) {
2763 EFI_HII_DATABASE_NOTIFY_REMOVE_PACK,
2765 EFI_HII_PACKAGE_DEVICE_PATH,
2768 if (EFI_ERROR (Status)) {
2773 PackageList->PackageListHdr.PackageLength -= Header.Length;
2777 PackageList->DevicePathPkg =
NULL;
2810 if (DevicePath ==
NULL) {
2814 ASSERT (Private !=
NULL);
2815 ASSERT (DatabaseRecord !=
NULL);
2823 DatabaseRecord->PackageList
2825 if (EFI_ERROR (Status)) {
2832 (VOID *)DatabaseRecord->PackageList->DevicePathPkg,
2833 EFI_HII_PACKAGE_DEVICE_PATH,
2834 DatabaseRecord->Handle
2857 IN VOID *PackageHdr,
2867 if ((PackageHdr ==
NULL) || (PackageList ==
NULL)) {
2868 return EFI_INVALID_PARAMETER;
2877 if (KeyboardLayoutPackage ==
NULL) {
2878 Status = EFI_OUT_OF_RESOURCES;
2882 KeyboardLayoutPackage->Signature = HII_KB_LAYOUT_PACKAGE_SIGNATURE;
2884 KeyboardLayoutPackage->KeyboardPkg = (UINT8 *)
AllocateZeroPool (PackageHeader.Length);
2885 if (KeyboardLayoutPackage->KeyboardPkg ==
NULL) {
2886 Status = EFI_OUT_OF_RESOURCES;
2890 CopyMem (KeyboardLayoutPackage->KeyboardPkg, PackageHdr, PackageHeader.Length);
2891 InsertTailList (&PackageList->KeyboardLayoutHdr, &KeyboardLayoutPackage->KeyboardEntry);
2893 *Package = KeyboardLayoutPackage;
2895 if (NotifyType == EFI_HII_DATABASE_NOTIFY_ADD_PACK) {
2896 PackageList->PackageListHdr.PackageLength += PackageHeader.Length;
2903 if (KeyboardLayoutPackage !=
NULL) {
2904 if (KeyboardLayoutPackage->KeyboardPkg !=
NULL) {
2905 FreePool (KeyboardLayoutPackage->KeyboardPkg);
2939 IN OUT VOID *Buffer,
2944 UINTN PackageLength;
2949 if ((Private ==
NULL) || (PackageList ==
NULL) || (ResultSize ==
NULL)) {
2950 return EFI_INVALID_PARAMETER;
2953 if ((BufferSize > 0) && (Buffer ==
NULL)) {
2954 return EFI_INVALID_PARAMETER;
2960 for (Link = PackageList->KeyboardLayoutHdr.ForwardLink; Link != &PackageList->KeyboardLayoutHdr; Link = Link->ForwardLink) {
2963 PackageLength += PackageHeader.Length;
2964 if (PackageLength + *ResultSize + UsedSize <= BufferSize) {
2970 EFI_HII_DATABASE_NOTIFY_EXPORT_PACK,
2972 EFI_HII_PACKAGE_KEYBOARD_LAYOUT,
2980 CopyMem (Buffer, Package->KeyboardPkg, PackageHeader.Length);
2981 Buffer = (UINT8 *)Buffer + PackageHeader.Length;
2985 *ResultSize += PackageLength;
3016 ListHead = &PackageList->KeyboardLayoutHdr;
3020 ListHead->ForwardLink,
3023 HII_KB_LAYOUT_PACKAGE_SIGNATURE
3027 EFI_HII_DATABASE_NOTIFY_REMOVE_PACK,
3029 EFI_HII_PACKAGE_KEYBOARD_LAYOUT,
3032 if (EFI_ERROR (Status)) {
3038 PackageList->PackageListHdr.PackageLength -= PackageHeader.Length;
3084 UINT32 OldPackageListLen;
3085 BOOLEAN StringPkgIsAdd;
3090 StringPkgIsAdd =
FALSE;
3092 StringPackage =
NULL;
3095 ImagePackage =
NULL;
3096 SimpleFontPackage =
NULL;
3097 KeyboardLayoutPackage =
NULL;
3102 OldPackageListLen = DatabaseRecord->PackageList->PackageListHdr.PackageLength;
3104 &DatabaseRecord->PackageList->PackageListHdr,
3105 (VOID *)PackageList,
3108 if (NotifyType == EFI_HII_DATABASE_NOTIFY_ADD_PACK) {
3109 DatabaseRecord->PackageList->PackageListHdr.PackageLength = OldPackageListLen;
3117 while (PackageHeader.Type != EFI_HII_PACKAGE_END) {
3118 switch (PackageHeader.Type) {
3119 case EFI_HII_PACKAGE_TYPE_GUID:
3123 DatabaseRecord->PackageList,
3126 if (EFI_ERROR (Status)) {
3133 (VOID *)GuidPackage,
3134 (UINT8)(PackageHeader.Type),
3135 DatabaseRecord->Handle
3138 case EFI_HII_PACKAGE_FORMS:
3142 DatabaseRecord->PackageList,
3145 if (EFI_ERROR (Status)) {
3152 (VOID *)FormPackage,
3153 (UINT8)(PackageHeader.Type),
3154 DatabaseRecord->Handle
3163 if (gExportAfterReadyToBoot) {
3164 gExportConfigResp =
TRUE;
3168 case EFI_HII_PACKAGE_KEYBOARD_LAYOUT:
3172 DatabaseRecord->PackageList,
3173 &KeyboardLayoutPackage
3175 if (EFI_ERROR (Status)) {
3182 (VOID *)KeyboardLayoutPackage,
3183 (UINT8)(PackageHeader.Type),
3184 DatabaseRecord->Handle
3187 case EFI_HII_PACKAGE_STRINGS:
3192 DatabaseRecord->PackageList,
3195 if (EFI_ERROR (Status)) {
3199 ASSERT (StringPackage !=
NULL);
3203 (VOID *)StringPackage,
3204 (UINT8)(PackageHeader.Type),
3205 DatabaseRecord->Handle
3207 StringPkgIsAdd =
TRUE;
3209 case EFI_HII_PACKAGE_FONTS:
3214 DatabaseRecord->PackageList,
3217 if (EFI_ERROR (Status)) {
3224 (VOID *)FontPackage,
3225 (UINT8)(PackageHeader.Type),
3226 DatabaseRecord->Handle
3229 case EFI_HII_PACKAGE_IMAGES:
3233 DatabaseRecord->PackageList,
3236 if (EFI_ERROR (Status)) {
3243 (VOID *)ImagePackage,
3244 (UINT8)(PackageHeader.Type),
3245 DatabaseRecord->Handle
3248 case EFI_HII_PACKAGE_SIMPLE_FONTS:
3252 DatabaseRecord->PackageList,
3255 if (EFI_ERROR (Status)) {
3262 (VOID *)SimpleFontPackage,
3263 (UINT8)(PackageHeader.Type),
3264 DatabaseRecord->Handle
3267 case EFI_HII_PACKAGE_DEVICE_PATH:
3279 if (EFI_ERROR (Status)) {
3293 if (!EFI_ERROR (Status) && StringPkgIsAdd) {
3333 ASSERT (Private !=
NULL && PackageList !=
NULL && UsedSize !=
NULL);
3334 ASSERT (Private->Signature == HII_DATABASE_PRIVATE_DATA_SIGNATURE);
3337 if ((BufferSize > 0) && (Buffer ==
NULL)) {
3338 return EFI_INVALID_PARAMETER;
3346 if (ResultSize + *UsedSize <= BufferSize) {
3347 CopyMem ((VOID *)Buffer, PackageList, ResultSize);
3359 (VOID *)((UINT8 *)Buffer + ResultSize),
3362 if (EFI_ERROR (Status)) {
3372 (VOID *)((UINT8 *)Buffer + ResultSize),
3375 if (EFI_ERROR (Status)) {
3385 (VOID *)((UINT8 *)Buffer + ResultSize),
3388 if (EFI_ERROR (Status)) {
3398 (VOID *)((UINT8 *)Buffer + ResultSize),
3401 if (EFI_ERROR (Status)) {
3411 (VOID *)((UINT8 *)Buffer + ResultSize),
3414 if (EFI_ERROR (Status)) {
3424 (VOID *)((UINT8 *)Buffer + ResultSize),
3427 if (EFI_ERROR (Status)) {
3437 (VOID *)((UINT8 *)Buffer + ResultSize),
3440 if (EFI_ERROR (Status)) {
3450 (VOID *)((UINT8 *)Buffer + ResultSize),
3453 if (EFI_ERROR (Status)) {
3461 EndofPackageList.Type = EFI_HII_PACKAGE_END;
3464 (VOID *)((UINT8 *)Buffer + ResultSize),
3465 (VOID *)&EndofPackageList,
3491 EFI_STRING ConfigAltResp;
3494 ConfigAltResp =
NULL;
3497 Private = HII_DATABASE_DATABASE_PRIVATE_DATA_FROM_THIS (This);
3504 if (!EFI_ERROR (Status)) {
3505 ConfigSize =
StrSize (ConfigAltResp);
3506 if (ConfigSize > gConfigRespSize) {
3511 gConfigRespSize = ConfigSize + (ConfigSize >> 2);
3512 if (gRTConfigRespBuffer !=
NULL) {
3514 DEBUG ((DEBUG_WARN,
"[HiiDatabase]: Memory allocation is required after ReadyToBoot, which may change memory map and cause S4 resume issue.\n"));
3518 if (gRTConfigRespBuffer ==
NULL) {
3520 DEBUG ((DEBUG_ERROR,
"[HiiDatabase]: No enough memory resource to store the ConfigResp string.\n"));
3524 gBS->InstallConfigurationTable (&gEfiHiiConfigRoutingProtocolGuid,
NULL);
3525 return EFI_OUT_OF_RESOURCES;
3528 ZeroMem (gRTConfigRespBuffer, gConfigRespSize);
3531 CopyMem (gRTConfigRespBuffer, ConfigAltResp, ConfigSize);
3532 gBS->InstallConfigurationTable (&gEfiHiiConfigRoutingProtocolGuid, gRTConfigRespBuffer);
3555 UINTN DatabaseInfoSize;
3557 DatabaseInfo =
NULL;
3558 DatabaseInfoSize = 0;
3565 ASSERT (Status == EFI_BUFFER_TOO_SMALL);
3567 if (DatabaseInfoSize > gDatabaseInfoSize ) {
3572 gDatabaseInfoSize = DatabaseInfoSize + (DatabaseInfoSize >> 2);
3573 if (gRTDatabaseInfoBuffer !=
NULL) {
3575 DEBUG ((DEBUG_WARN,
"[HiiDatabase]: Memory allocation is required after ReadyToBoot, which may change memory map and cause S4 resume issue.\n"));
3579 if (gRTDatabaseInfoBuffer ==
NULL) {
3580 DEBUG ((DEBUG_ERROR,
"[HiiDatabase]: No enough memory resource to store the HiiDatabase info.\n"));
3584 gBS->InstallConfigurationTable (&gEfiHiiDatabaseProtocolGuid,
NULL);
3585 return EFI_OUT_OF_RESOURCES;
3588 ZeroMem (gRTDatabaseInfoBuffer, gDatabaseInfoSize);
3593 gBS->InstallConfigurationTable (&gEfiHiiDatabaseProtocolGuid, gRTDatabaseInfoBuffer);
3636 if ((This ==
NULL) || (PackageList ==
NULL) || (Handle ==
NULL)) {
3637 return EFI_INVALID_PARAMETER;
3640 Private = HII_DATABASE_DATABASE_PRIVATE_DATA_FROM_THIS (This);
3646 for (Link = Private->DatabaseList.ForwardLink; Link != &Private->DatabaseList; Link = Link->ForwardLink) {
3649 &(DatabaseRecord->PackageList->PackageListHdr.PackageListGuid),
3652 (DatabaseRecord->DriverHandle == DriverHandle))
3654 return EFI_INVALID_PARAMETER;
3664 if (EFI_ERROR (Status)) {
3673 Status =
AddPackages (Private, EFI_HII_DATABASE_NOTIFY_NEW_PACK, PackageList, DatabaseRecord);
3674 if (EFI_ERROR (Status)) {
3679 DatabaseRecord->DriverHandle = DriverHandle;
3684 Status =
gBS->HandleProtocol (
3686 &gEfiDevicePathProtocolGuid,
3687 (VOID **)&DevicePath
3689 if (!EFI_ERROR (Status)) {
3690 Status =
AddDevicePathPackage (Private, EFI_HII_DATABASE_NOTIFY_NEW_PACK, DevicePath, DatabaseRecord);
3694 *Handle = DatabaseRecord->Handle;
3700 if (gExportAfterReadyToBoot) {
3718 if (gExportAfterReadyToBoot && gExportConfigResp) {
3756 return EFI_INVALID_PARAMETER;
3760 return EFI_NOT_FOUND;
3765 Private = HII_DATABASE_DATABASE_PRIVATE_DATA_FROM_THIS (This);
3770 for (Link = Private->DatabaseList.ForwardLink; Link != &Private->DatabaseList; Link = Link->ForwardLink) {
3772 if (Node->Handle == Handle) {
3774 ASSERT (PackageList !=
NULL);
3781 if (EFI_ERROR (Status)) {
3787 if (EFI_ERROR (Status)) {
3793 if (EFI_ERROR (Status)) {
3799 if (EFI_ERROR (Status)) {
3805 if (EFI_ERROR (Status)) {
3811 if (EFI_ERROR (Status)) {
3817 if (EFI_ERROR (Status)) {
3823 if (EFI_ERROR (Status)) {
3835 Private->HiiHandleCount--;
3836 ASSERT (Private->HiiHandleCount >= 0);
3838 HiiHandle->Signature = 0;
3847 if (gExportAfterReadyToBoot) {
3866 if (gExportAfterReadyToBoot && gExportConfigResp) {
3875 return EFI_NOT_FOUND;
3912 if ((This ==
NULL) || (PackageList ==
NULL)) {
3913 return EFI_INVALID_PARAMETER;
3917 return EFI_NOT_FOUND;
3920 Private = HII_DATABASE_DATABASE_PRIVATE_DATA_FROM_THIS (This);
3930 for (Link = Private->DatabaseList.ForwardLink; Link != &Private->DatabaseList; Link = Link->ForwardLink) {
3932 if (Node->Handle == Handle) {
3933 OldPackageList = Node->PackageList;
3939 while (PackageHeader.Type != EFI_HII_PACKAGE_END) {
3940 switch (PackageHeader.Type) {
3941 case EFI_HII_PACKAGE_TYPE_GUID:
3944 case EFI_HII_PACKAGE_FORMS:
3947 case EFI_HII_PACKAGE_KEYBOARD_LAYOUT:
3950 case EFI_HII_PACKAGE_STRINGS:
3953 case EFI_HII_PACKAGE_FONTS:
3956 case EFI_HII_PACKAGE_IMAGES:
3959 case EFI_HII_PACKAGE_SIMPLE_FONTS:
3962 case EFI_HII_PACKAGE_DEVICE_PATH:
3967 if (EFI_ERROR (Status)) {
3979 Status =
AddPackages (Private, EFI_HII_DATABASE_NOTIFY_ADD_PACK, PackageList, Node);
3985 if (gExportAfterReadyToBoot && (Status ==
EFI_SUCCESS)) {
4004 if (gExportAfterReadyToBoot && gExportConfigResp && (Status ==
EFI_SUCCESS)) {
4013 return EFI_NOT_FOUND;
4054 IN UINT8 PackageType,
4073 if ((This ==
NULL) || (HandleBufferLength ==
NULL)) {
4074 return EFI_INVALID_PARAMETER;
4077 if ((*HandleBufferLength > 0) && (Handle ==
NULL)) {
4078 return EFI_INVALID_PARAMETER;
4081 if (((PackageType == EFI_HII_PACKAGE_TYPE_GUID) && (PackageGuid ==
NULL)) ||
4082 ((PackageType != EFI_HII_PACKAGE_TYPE_GUID) && (PackageGuid !=
NULL)))
4084 return EFI_INVALID_PARAMETER;
4087 Private = HII_DATABASE_DATABASE_PRIVATE_DATA_FROM_THIS (This);
4092 for (Link = Private->DatabaseList.ForwardLink; Link != &Private->DatabaseList; Link = Link->ForwardLink) {
4095 switch (PackageType) {
4096 case EFI_HII_PACKAGE_TYPE_GUID:
4097 for (Link1 = PackageList->GuidPkgHdr.ForwardLink; Link1 != &PackageList->GuidPkgHdr; Link1 = Link1->ForwardLink) {
4110 case EFI_HII_PACKAGE_FORMS:
4116 case EFI_HII_PACKAGE_KEYBOARD_LAYOUT:
4117 if (!
IsListEmpty (&PackageList->KeyboardLayoutHdr)) {
4122 case EFI_HII_PACKAGE_STRINGS:
4128 case EFI_HII_PACKAGE_FONTS:
4134 case EFI_HII_PACKAGE_IMAGES:
4135 if (PackageList->ImagePkg !=
NULL) {
4140 case EFI_HII_PACKAGE_SIMPLE_FONTS:
4141 if (!
IsListEmpty (&PackageList->SimpleFontPkgHdr)) {
4146 case EFI_HII_PACKAGE_DEVICE_PATH:
4147 if (PackageList->DevicePathPkg !=
NULL) {
4156 case EFI_HII_PACKAGE_TYPE_ALL:
4168 if (ResultSize <= *HandleBufferLength) {
4169 *Result++ = Node->Handle;
4176 if (ResultSize == 0) {
4177 return EFI_NOT_FOUND;
4180 if (*HandleBufferLength < ResultSize) {
4181 *HandleBufferLength = ResultSize;
4182 return EFI_BUFFER_TOO_SMALL;
4185 *HandleBufferLength = ResultSize;
4232 if ((This ==
NULL) || (BufferSize ==
NULL)) {
4233 return EFI_INVALID_PARAMETER;
4236 if ((*BufferSize > 0) && (Buffer ==
NULL)) {
4237 return EFI_INVALID_PARAMETER;
4241 return EFI_NOT_FOUND;
4244 Private = HII_DATABASE_DATABASE_PRIVATE_DATA_FROM_THIS (This);
4247 for (Link = Private->DatabaseList.ForwardLink; Link != &Private->DatabaseList; Link = Link->ForwardLink) {
4249 if (Handle ==
NULL) {
4262 }
else if ((Handle !=
NULL) && (Node->Handle == Handle)) {
4272 if (*BufferSize < UsedSize) {
4273 *BufferSize = UsedSize;
4274 return EFI_BUFFER_TOO_SMALL;
4281 if ((Handle ==
NULL) && (UsedSize != 0)) {
4282 if (*BufferSize < UsedSize) {
4283 *BufferSize = UsedSize;
4284 return EFI_BUFFER_TOO_SMALL;
4290 return EFI_NOT_FOUND;
4333 IN UINT8 PackageType,
4344 if ((This ==
NULL) || (NotifyHandle ==
NULL)) {
4345 return EFI_INVALID_PARAMETER;
4348 if (((PackageType == EFI_HII_PACKAGE_TYPE_GUID) && (PackageGuid ==
NULL)) ||
4349 ((PackageType != EFI_HII_PACKAGE_TYPE_GUID) && (PackageGuid !=
NULL)))
4351 return EFI_INVALID_PARAMETER;
4354 Private = HII_DATABASE_DATABASE_PRIVATE_DATA_FROM_THIS (This);
4360 if (Notify ==
NULL) {
4361 return EFI_OUT_OF_RESOURCES;
4367 Status =
gBS->InstallMultipleProtocolInterfaces (
4368 &Notify->NotifyHandle,
4378 Notify->Signature = HII_DATABASE_NOTIFY_SIGNATURE;
4379 Notify->PackageType = PackageType;
4380 Notify->PackageGuid = (
EFI_GUID *)PackageGuid;
4382 Notify->NotifyType = NotifyType;
4384 InsertTailList (&Private->DatabaseNotifyList, &Notify->DatabaseNotifyEntry);
4385 *NotifyHandle = Notify->NotifyHandle;
4417 return EFI_INVALID_PARAMETER;
4420 if (NotificationHandle ==
NULL) {
4421 return EFI_NOT_FOUND;
4424 Status =
gBS->OpenProtocol (
4430 EFI_OPEN_PROTOCOL_TEST_PROTOCOL
4432 if (EFI_ERROR (Status)) {
4433 return EFI_NOT_FOUND;
4436 Private = HII_DATABASE_DATABASE_PRIVATE_DATA_FROM_THIS (This);
4438 for (Link = Private->DatabaseNotifyList.ForwardLink; Link != &Private->DatabaseNotifyList; Link = Link->ForwardLink) {
4440 if (Notify->NotifyHandle == NotificationHandle) {
4445 Status =
gBS->UninstallMultipleProtocolInterfaces (
4446 Notify->NotifyHandle,
4458 return EFI_NOT_FOUND;
4489 IN OUT UINT16 *KeyGuidBufferLength,
4501 UINT16 LayoutLength;
4505 if ((This ==
NULL) || (KeyGuidBufferLength ==
NULL)) {
4506 return EFI_INVALID_PARAMETER;
4509 if ((*KeyGuidBufferLength > 0) && (KeyGuidBuffer ==
NULL)) {
4510 return EFI_INVALID_PARAMETER;
4513 Private = HII_DATABASE_DATABASE_PRIVATE_DATA_FROM_THIS (This);
4519 for (Link = Private->DatabaseList.ForwardLink; Link != &Private->DatabaseList; Link = Link->ForwardLink) {
4521 PackageList = Node->PackageList;
4522 for (Link1 = PackageList->KeyboardLayoutHdr.ForwardLink;
4523 Link1 != &PackageList->KeyboardLayoutHdr;
4524 Link1 = Link1->ForwardLink
4534 HII_KB_LAYOUT_PACKAGE_SIGNATURE
4542 for (Index = 0; Index < LayoutCount; Index++) {
4544 if (ResultSize <= *KeyGuidBufferLength) {
4546 CopyMem (&LayoutLength, Layout,
sizeof (UINT16));
4547 Layout = Layout + LayoutLength;
4553 if (ResultSize == 0) {
4554 return EFI_NOT_FOUND;
4557 if (*KeyGuidBufferLength < ResultSize) {
4558 *KeyGuidBufferLength = ResultSize;
4559 return EFI_BUFFER_TOO_SMALL;
4562 *KeyGuidBufferLength = ResultSize;
4597 IN OUT UINT16 *KeyboardLayoutLength,
4609 UINT16 LayoutLength;
4612 if ((This ==
NULL) || (KeyboardLayoutLength ==
NULL)) {
4613 return EFI_INVALID_PARAMETER;
4616 if ((*KeyboardLayoutLength > 0) && (KeyboardLayout ==
NULL)) {
4617 return EFI_INVALID_PARAMETER;
4620 Private = HII_DATABASE_DATABASE_PRIVATE_DATA_FROM_THIS (This);
4624 if (KeyGuid ==
NULL) {
4625 if (Private->CurrentLayout ==
NULL) {
4626 return EFI_NOT_FOUND;
4629 CopyMem (&LayoutLength, Private->CurrentLayout, sizeof (UINT16));
4630 if (*KeyboardLayoutLength < LayoutLength) {
4631 *KeyboardLayoutLength = LayoutLength;
4632 return EFI_BUFFER_TOO_SMALL;
4635 CopyMem (KeyboardLayout, Private->CurrentLayout, LayoutLength);
4639 for (Link = Private->DatabaseList.ForwardLink; Link != &Private->DatabaseList; Link = Link->ForwardLink) {
4642 for (Link1 = PackageList->KeyboardLayoutHdr.ForwardLink;
4643 Link1 != &PackageList->KeyboardLayoutHdr;
4644 Link1 = Link1->ForwardLink
4651 HII_KB_LAYOUT_PACKAGE_SIGNATURE
4654 Layout = (UINT8 *)Package->KeyboardPkg +
4656 CopyMem (&LayoutCount, Layout -
sizeof (UINT16),
sizeof (UINT16));
4657 for (Index = 0; Index < LayoutCount; Index++) {
4658 CopyMem (&LayoutLength, Layout,
sizeof (UINT16));
4660 if (LayoutLength <= *KeyboardLayoutLength) {
4661 CopyMem (KeyboardLayout, Layout, LayoutLength);
4664 *KeyboardLayoutLength = LayoutLength;
4665 return EFI_BUFFER_TOO_SMALL;
4669 Layout = Layout + LayoutLength;
4674 return EFI_NOT_FOUND;
4703 UINT16 KeyboardLayoutLength;
4706 if ((This ==
NULL) || (KeyGuid ==
NULL)) {
4707 return EFI_INVALID_PARAMETER;
4710 Private = HII_DATABASE_DATABASE_PRIVATE_DATA_FROM_THIS (This);
4716 if (
CompareGuid (&Private->CurrentLayoutGuid, KeyGuid)) {
4723 KeyboardLayoutLength = 0;
4724 KeyboardLayout =
NULL;
4726 if (Status != EFI_BUFFER_TOO_SMALL) {
4731 ASSERT (KeyboardLayout !=
NULL);
4739 if (Private->CurrentLayout !=
NULL) {
4743 Private->CurrentLayout = KeyboardLayout;
4749 Status =
gBS->SignalEvent (gHiiKeyboardLayoutChanged);
4785 if ((This ==
NULL) || (DriverHandle ==
NULL)) {
4786 return EFI_INVALID_PARAMETER;
4790 return EFI_INVALID_PARAMETER;
4793 Private = HII_DATABASE_DATABASE_PRIVATE_DATA_FROM_THIS (This);
4795 for (Link = Private->DatabaseList.ForwardLink; Link != &Private->DatabaseList; Link = Link->ForwardLink) {
4797 if (Node->Handle == PackageListHandle) {
4798 *DriverHandle = Node->DriverHandle;
4803 return EFI_NOT_FOUND;
UINTN EFIAPI StrSize(IN CONST CHAR16 *String)
BOOLEAN EFIAPI IsListEmpty(IN CONST LIST_ENTRY *ListHead)
RETURN_STATUS EFIAPI StrCpyS(OUT CHAR16 *Destination, IN UINTN DestMax, IN CONST CHAR16 *Source)
INTN EFIAPI StrCmp(IN CONST CHAR16 *FirstString, IN CONST CHAR16 *SecondString)
LIST_ENTRY *EFIAPI RemoveEntryList(IN CONST LIST_ENTRY *Entry)
LIST_ENTRY *EFIAPI InitializeListHead(IN OUT LIST_ENTRY *ListHead)
#define INITIALIZE_LIST_HEAD_VARIABLE(ListHead)
RETURN_STATUS EFIAPI AsciiStrToUnicodeStrS(IN CONST CHAR8 *Source, OUT CHAR16 *Destination, IN UINTN DestMax)
UINTN EFIAPI AsciiStrSize(IN CONST CHAR8 *String)
RETURN_STATUS EFIAPI AsciiStrCpyS(OUT CHAR8 *Destination, IN UINTN DestMax, IN CONST CHAR8 *Source)
LIST_ENTRY *EFIAPI InsertTailList(IN OUT LIST_ENTRY *ListHead, IN OUT LIST_ENTRY *Entry)
UINT32 EFIAPI BitFieldRead32(IN UINT32 Operand, IN UINTN StartBit, IN UINTN EndBit)
INTN EFIAPI CompareMem(IN CONST VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
BOOLEAN EFIAPI CompareGuid(IN CONST GUID *Guid1, IN CONST GUID *Guid2)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
EFI_STATUS EFIAPI HiiConfigRoutingExportConfig(IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, OUT EFI_STRING *Results)
EFI_STATUS InsertSimpleFontPackage(IN VOID *PackageHdr, IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType, IN OUT HII_DATABASE_PACKAGE_LIST_INSTANCE *PackageList, OUT HII_SIMPLE_FONT_PACKAGE_INSTANCE **Package)
EFI_STATUS ExportSimpleFontPackages(IN HII_DATABASE_PRIVATE_DATA *Private, IN EFI_HII_HANDLE Handle, IN HII_DATABASE_PACKAGE_LIST_INSTANCE *PackageList, IN UINTN UsedSize, IN UINTN BufferSize, IN OUT VOID *Buffer, IN OUT UINTN *ResultSize)
EFI_STATUS AddPackages(IN HII_DATABASE_PRIVATE_DATA *Private, IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType, IN CONST EFI_HII_PACKAGE_LIST_HEADER *PackageList, IN OUT HII_DATABASE_RECORD *DatabaseRecord)
EFI_STATUS HiiGetConfigRespInfo(IN CONST EFI_HII_DATABASE_PROTOCOL *This)
EFI_STATUS InsertGuidPackage(IN VOID *PackageHdr, IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType, IN OUT HII_DATABASE_PACKAGE_LIST_INSTANCE *PackageList, OUT HII_GUID_PACKAGE_INSTANCE **Package)
EFI_STATUS RemoveKeyboardLayoutPackages(IN HII_DATABASE_PRIVATE_DATA *Private, IN EFI_HII_HANDLE Handle, IN OUT HII_DATABASE_PACKAGE_LIST_INSTANCE *PackageList)
EFI_STATUS ExportFontPackages(IN HII_DATABASE_PRIVATE_DATA *Private, IN EFI_HII_HANDLE Handle, IN HII_DATABASE_PACKAGE_LIST_INSTANCE *PackageList, IN UINTN UsedSize, IN UINTN BufferSize, IN OUT VOID *Buffer, IN OUT UINTN *ResultSize)
EFI_STATUS GenerateHiiDatabaseRecord(IN HII_DATABASE_PRIVATE_DATA *Private, OUT HII_DATABASE_RECORD **DatabaseNode)
EFI_STATUS ExportPackageList(IN HII_DATABASE_PRIVATE_DATA *Private, IN EFI_HII_HANDLE Handle, IN HII_DATABASE_PACKAGE_LIST_INSTANCE *PackageList, IN OUT UINTN *UsedSize, IN UINTN BufferSize, OUT EFI_HII_PACKAGE_LIST_HEADER *Buffer)
EFI_STATUS InsertFormPackage(IN VOID *PackageHdr, IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType, IN OUT HII_DATABASE_PACKAGE_LIST_INSTANCE *PackageList, OUT HII_IFR_PACKAGE_INSTANCE **Package)
EFI_STATUS InsertKeyboardLayoutPackage(IN VOID *PackageHdr, IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType, IN OUT HII_DATABASE_PACKAGE_LIST_INSTANCE *PackageList, OUT HII_KEYBOARD_LAYOUT_PACKAGE_INSTANCE **Package)
EFI_STATUS EFIAPI HiiRegisterPackageNotify(IN CONST EFI_HII_DATABASE_PROTOCOL *This, IN UINT8 PackageType, IN CONST EFI_GUID *PackageGuid, IN CONST EFI_HII_DATABASE_NOTIFY PackageNotifyFn, IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType, OUT EFI_HANDLE *NotifyHandle)
EFI_STATUS AdjustStringPackage(IN OUT HII_DATABASE_PACKAGE_LIST_INSTANCE *PackageList)
EFI_STATUS EFIAPI HiiGetPackageListHandle(IN CONST EFI_HII_DATABASE_PROTOCOL *This, IN EFI_HII_HANDLE PackageListHandle, OUT EFI_HANDLE *DriverHandle)
EFI_STATUS ExportFormPackages(IN HII_DATABASE_PRIVATE_DATA *Private, IN EFI_HII_HANDLE Handle, IN HII_DATABASE_PACKAGE_LIST_INSTANCE *PackageList, IN UINTN UsedSize, IN UINTN BufferSize, IN OUT VOID *Buffer, IN OUT UINTN *ResultSize)
EFI_STATUS InsertImagePackage(IN VOID *PackageHdr, IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType, IN OUT HII_DATABASE_PACKAGE_LIST_INSTANCE *PackageList, OUT HII_IMAGE_PACKAGE_INSTANCE **Package)
EFI_STATUS HiiGetDatabaseInfo(IN CONST EFI_HII_DATABASE_PROTOCOL *This)
EFI_STATUS RemoveFormPackages(IN HII_DATABASE_PRIVATE_DATA *Private, IN EFI_HII_HANDLE Handle, IN OUT HII_DATABASE_PACKAGE_LIST_INSTANCE *PackageList)
EFI_STATUS AddDevicePathPackage(IN HII_DATABASE_PRIVATE_DATA *Private, IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN OUT HII_DATABASE_RECORD *DatabaseRecord)
VARIABLE_HEADER * FindVariableData(IN VARIABLE_STORE_HEADER *VariableStorage, IN EFI_GUID *VarGuid, IN UINT32 VarAttribute, IN CHAR16 *VarName)
EFI_STATUS ExportImagePackages(IN HII_DATABASE_PRIVATE_DATA *Private, IN EFI_HII_HANDLE Handle, IN HII_DATABASE_PACKAGE_LIST_INSTANCE *PackageList, IN UINTN UsedSize, IN UINTN BufferSize, IN OUT VOID *Buffer, IN OUT UINTN *ResultSize)
EFI_STATUS ExportDevicePathPackage(IN HII_DATABASE_PRIVATE_DATA *Private, IN EFI_HII_HANDLE Handle, IN HII_DATABASE_PACKAGE_LIST_INSTANCE *PackageList, IN UINTN UsedSize, IN UINTN BufferSize, IN OUT VOID *Buffer, IN OUT UINTN *ResultSize)
AUTHENTICATED_VARIABLE_HEADER * AuthFindVariableData(IN VARIABLE_STORE_HEADER *VariableStorage, IN EFI_GUID *VarGuid, IN UINT32 VarAttribute, IN CHAR16 *VarName)
BOOLEAN IsHiiHandleValid(EFI_HII_HANDLE Handle)
EFI_STATUS RemoveFontPackages(IN HII_DATABASE_PRIVATE_DATA *Private, IN EFI_HII_HANDLE Handle, IN OUT HII_DATABASE_PACKAGE_LIST_INSTANCE *PackageList)
EFI_STATUS EFIAPI HiiGetKeyboardLayout(IN CONST EFI_HII_DATABASE_PROTOCOL *This, IN CONST EFI_GUID *KeyGuid, IN OUT UINT16 *KeyboardLayoutLength, OUT EFI_HII_KEYBOARD_LAYOUT *KeyboardLayout)
EFI_STATUS EFIAPI HiiFindKeyboardLayouts(IN CONST EFI_HII_DATABASE_PROTOCOL *This, IN OUT UINT16 *KeyGuidBufferLength, OUT EFI_GUID *KeyGuidBuffer)
EFI_STATUS EFIAPI HiiExportPackageLists(IN CONST EFI_HII_DATABASE_PROTOCOL *This, IN EFI_HII_HANDLE Handle, IN OUT UINTN *BufferSize, OUT EFI_HII_PACKAGE_LIST_HEADER *Buffer)
EFI_STATUS EFIAPI HiiSetKeyboardLayout(IN CONST EFI_HII_DATABASE_PROTOCOL *This, IN CONST EFI_GUID *KeyGuid)
EFI_STATUS EFIAPI HiiUpdatePackageList(IN CONST EFI_HII_DATABASE_PROTOCOL *This, IN EFI_HII_HANDLE Handle, IN CONST EFI_HII_PACKAGE_LIST_HEADER *PackageList)
EFI_STATUS RemoveStringPackages(IN HII_DATABASE_PRIVATE_DATA *Private, IN EFI_HII_HANDLE Handle, IN OUT HII_DATABASE_PACKAGE_LIST_INSTANCE *PackageList)
EFI_STATUS EFIAPI HiiNewPackageList(IN CONST EFI_HII_DATABASE_PROTOCOL *This, IN CONST EFI_HII_PACKAGE_LIST_HEADER *PackageList, IN CONST EFI_HANDLE DriverHandle OPTIONAL, OUT EFI_HII_HANDLE *Handle)
EFI_STATUS InsertDevicePathPackage(IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType, IN OUT HII_DATABASE_PACKAGE_LIST_INSTANCE *PackageList)
EFI_STATUS RemoveImagePackages(IN HII_DATABASE_PRIVATE_DATA *Private, IN EFI_HII_HANDLE Handle, IN OUT HII_DATABASE_PACKAGE_LIST_INSTANCE *PackageList)
EFI_STATUS InvokeRegisteredFunction(IN HII_DATABASE_PRIVATE_DATA *Private, IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType, IN VOID *PackageInstance, IN UINT8 PackageType, IN EFI_HII_HANDLE Handle)
EFI_STATUS EFIAPI HiiListPackageLists(IN CONST EFI_HII_DATABASE_PROTOCOL *This, IN UINT8 PackageType, IN CONST EFI_GUID *PackageGuid, IN OUT UINTN *HandleBufferLength, OUT EFI_HII_HANDLE *Handle)
EFI_STATUS InsertFontPackage(IN HII_DATABASE_PRIVATE_DATA *Private, IN VOID *PackageHdr, IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType, IN OUT HII_DATABASE_PACKAGE_LIST_INSTANCE *PackageList, OUT HII_FONT_PACKAGE_INSTANCE **Package)
EFI_STATUS ExportKeyboardLayoutPackages(IN HII_DATABASE_PRIVATE_DATA *Private, IN EFI_HII_HANDLE Handle, IN HII_DATABASE_PACKAGE_LIST_INSTANCE *PackageList, IN UINTN UsedSize, IN UINTN BufferSize, IN OUT VOID *Buffer, IN OUT UINTN *ResultSize)
EFI_STATUS FindQuestionDefaultSetting(IN UINT16 DefaultId, IN EFI_IFR_VARSTORE_EFI *EfiVarStore, IN EFI_IFR_QUESTION_HEADER *IfrQuestionHdr, OUT VOID *ValueBuffer, IN UINTN Width, IN BOOLEAN BitFieldQuestion)
EFI_STATUS ExportGuidPackages(IN HII_DATABASE_PRIVATE_DATA *Private, IN EFI_HII_HANDLE Handle, IN HII_DATABASE_PACKAGE_LIST_INSTANCE *PackageList, IN UINTN UsedSize, IN UINTN BufferSize, IN OUT VOID *Buffer, IN OUT UINTN *ResultSize)
EFI_STATUS RemoveSimpleFontPackages(IN HII_DATABASE_PRIVATE_DATA *Private, IN EFI_HII_HANDLE Handle, IN OUT HII_DATABASE_PACKAGE_LIST_INSTANCE *PackageList)
EFI_STATUS RemoveDevicePathPackage(IN HII_DATABASE_PRIVATE_DATA *Private, IN EFI_HII_HANDLE Handle, IN OUT HII_DATABASE_PACKAGE_LIST_INSTANCE *PackageList)
EFI_STATUS ExportStringPackages(IN HII_DATABASE_PRIVATE_DATA *Private, IN EFI_HII_HANDLE Handle, IN HII_DATABASE_PACKAGE_LIST_INSTANCE *PackageList, IN UINTN UsedSize, IN UINTN BufferSize, IN OUT VOID *Buffer, IN OUT UINTN *ResultSize)
UINTN IsEfiVarStoreQuestion(EFI_IFR_QUESTION_HEADER *IfrQuestionHdr, EFI_IFR_VARSTORE_EFI **EfiVarStoreList, UINTN EfiVarStoreNumber)
EFI_STATUS RemoveGuidPackages(IN HII_DATABASE_PRIVATE_DATA *Private, IN EFI_HII_HANDLE Handle, IN OUT HII_DATABASE_PACKAGE_LIST_INSTANCE *PackageList)
EFI_STATUS InsertStringPackage(IN HII_DATABASE_PRIVATE_DATA *Private, IN VOID *PackageHdr, IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType, IN OUT HII_DATABASE_PACKAGE_LIST_INSTANCE *PackageList, OUT HII_STRING_PACKAGE_INSTANCE **Package)
EFI_STATUS EFIAPI HiiRemovePackageList(IN CONST EFI_HII_DATABASE_PROTOCOL *This, IN EFI_HII_HANDLE Handle)
VOID UpdateDefaultSettingInFormPackage(HII_IFR_PACKAGE_INSTANCE *FormPackage)
EFI_STATUS EFIAPI HiiUnregisterPackageNotify(IN CONST EFI_HII_DATABASE_PROTOCOL *This, IN EFI_HANDLE NotificationHandle)
UINTN EFIAPI GetDevicePathSize(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath)
VOID *EFIAPI ReallocatePool(IN UINTN OldSize, IN UINTN NewSize, IN VOID *OldBuffer OPTIONAL)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
VOID *EFIAPI AllocateRuntimeZeroPool(IN UINTN AllocationSize)
EFI_STATUS FindGlyphBlock(IN HII_FONT_PACKAGE_INSTANCE *FontPackage, IN CHAR16 CharValue, OUT UINT8 **GlyphBuffer OPTIONAL, OUT EFI_HII_GLYPH_INFO *Cell OPTIONAL, OUT UINTN *GlyphBufferLen OPTIONAL)
BOOLEAN IsFontInfoExisted(IN HII_DATABASE_PRIVATE_DATA *Private, IN EFI_FONT_INFO *FontInfo, IN EFI_FONT_INFO_MASK *FontInfoMask OPTIONAL, IN EFI_FONT_HANDLE FontHandle OPTIONAL, OUT HII_GLOBAL_FONT_INFO **GlobalFontInfo OPTIONAL)
BOOLEAN HiiCompareLanguage(IN CHAR8 *Language1, IN CHAR8 *Language2)
EFI_STATUS FindStringBlock(IN HII_DATABASE_PRIVATE_DATA *Private, IN HII_STRING_PACKAGE_INSTANCE *StringPackage, IN EFI_STRING_ID StringId, OUT UINT8 *BlockType OPTIONAL, OUT UINT8 **StringBlockAddr OPTIONAL, OUT UINTN *StringTextOffset OPTIONAL, OUT EFI_STRING_ID *LastStringId OPTIONAL, OUT EFI_STRING_ID *StartStringId OPTIONAL)
#define OFFSET_OF(TYPE, Field)
#define BASE_CR(Record, TYPE, Field)
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG(Expression)
#define CR(Record, TYPE, Field, TestSignature)
EFI_STATUS(EFIAPI * EFI_HII_DATABASE_NOTIFY)(IN UINT8 PackageType, IN CONST EFI_GUID *PackageGuid, IN CONST EFI_HII_PACKAGE_HEADER *Package, IN EFI_HII_HANDLE Handle, IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType)
UINTN EFI_HII_DATABASE_NOTIFY_TYPE
#define PcdGetSize(TokenName)
UINTN EFIAPI LibPcdGetSku(VOID)
#define PcdGetPtr(TokenName)
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
#define EFI_INITIALIZE_LOCK_VARIABLE(Priority)
VOID EFIAPI EfiReleaseLock(IN EFI_LOCK *Lock)
VOID EFIAPI EfiAcquireLock(IN EFI_LOCK *Lock)
UINT16 FontSize
character cell height in pixels