32 OUT UINT8 **DevicePathData,
33 OUT EFI_STRING *NextString
38 UINT8 *DevicePathBuffer;
42 EFI_DEVICE_PATH_PROTOCOL *DevicePath;
44 ASSERT (NextString != NULL && DevicePathData != NULL);
50 *DevicePathData = NULL;
58 if (*String == L
'&') {
65 if (StrnCmp (String, L
"PATH=",
L_STR_LEN (L
"PATH=")) != 0) {
66 if (StrnCmp (String, L
"KEYWORD=",
L_STR_LEN (L
"KEYWORD=")) != 0) {
67 return EFI_INVALID_PARAMETER;
72 *DevicePathData = NULL;
83 return EFI_INVALID_PARAMETER;
93 for (
Length = 0; *String != 0 && *String != L
'&'; String++,
Length++) {
104 if (((
Length + 1) / 2) <
sizeof (EFI_DEVICE_PATH_PROTOCOL)) {
105 return EFI_INVALID_PARAMETER;
113 DevicePathBuffer = (UINT8 *)AllocateZeroPool ((
Length + 1) / 2);
114 if (DevicePathBuffer == NULL) {
115 return EFI_OUT_OF_RESOURCES;
121 ZeroMem (TemStr,
sizeof (TemStr));
122 for (Index = 0; Index <
Length; Index++) {
123 TemStr[0] = PathHdr[Index];
124 DigitUint8 = (UINT8)StrHexToUint64 (TemStr);
125 if ((Index & 1) == 0) {
126 DevicePathBuffer[Index/2] = DigitUint8;
128 DevicePathBuffer[Index/2] = (UINT8)((DevicePathBuffer[Index/2] << 4) + DigitUint8);
135 DevicePath = (EFI_DEVICE_PATH_PROTOCOL *)DevicePathBuffer;
136 while (!IsDevicePathEnd (DevicePath)) {
137 if ((DevicePath->Type == 0) || (DevicePath->SubType == 0) || (DevicePathNodeLength (DevicePath) <
sizeof (EFI_DEVICE_PATH_PROTOCOL))) {
141 FreePool (DevicePathBuffer);
142 return EFI_INVALID_PARAMETER;
145 DevicePath = NextDevicePathNode (DevicePath);
151 *DevicePathData = DevicePathBuffer;
539 IN UINT8 *OpCodeData,
540 IN CHAR16 *KeywordRequest,
541 OUT CHAR16 **NextString,
542 OUT BOOLEAN *ReadOnly
548 EFI_IFR_QUESTION_HEADER *QuestionHdr;
549 EFI_IFR_OP_HEADER *OpCodeHdr;
553 RetVal = KEYWORD_HANDLER_NO_ERROR;
554 StringPtr = KeywordRequest;
556 OpCodeHdr = (EFI_IFR_OP_HEADER *)OpCodeData;
557 QuestionHdr = (EFI_IFR_QUESTION_HEADER *)(OpCodeData +
sizeof (EFI_IFR_OP_HEADER));
558 if ((OpCodeHdr->OpCode == EFI_IFR_ONE_OF_OP) || (OpCodeHdr->OpCode == EFI_IFR_NUMERIC_OP)) {
559 Flags = *(OpCodeData +
sizeof (EFI_IFR_OP_HEADER) +
sizeof (EFI_IFR_QUESTION_HEADER));
569 while (
ExtractFilter (StringPtr, &FilterFlags, &NextFilter)) {
570 switch (FilterFlags) {
572 if ((QuestionHdr->Flags & EFI_IFR_FLAG_READ_ONLY) == 0) {
573 RetVal = KEYWORD_HANDLER_INCOMPATIBLE_VALUE_DETECTED;
580 if ((QuestionHdr->Flags & EFI_IFR_FLAG_READ_ONLY) != 0) {
581 RetVal = KEYWORD_HANDLER_INCOMPATIBLE_VALUE_DETECTED;
591 if ((OpCodeHdr->OpCode == EFI_IFR_ONE_OF_OP) || (OpCodeHdr->OpCode == EFI_IFR_NUMERIC_OP) || (OpCodeHdr->OpCode == EFI_IFR_CHECKBOX_OP)) {
592 RetVal = KEYWORD_HANDLER_INCOMPATIBLE_VALUE_DETECTED;
599 if ((OpCodeHdr->OpCode != EFI_IFR_ONE_OF_OP) && (OpCodeHdr->OpCode != EFI_IFR_NUMERIC_OP) && (OpCodeHdr->OpCode != EFI_IFR_CHECKBOX_OP)) {
600 RetVal = KEYWORD_HANDLER_INCOMPATIBLE_VALUE_DETECTED;
610 if ((OpCodeHdr->OpCode != EFI_IFR_ONE_OF_OP) && (OpCodeHdr->OpCode != EFI_IFR_NUMERIC_OP) && (OpCodeHdr->OpCode != EFI_IFR_CHECKBOX_OP)) {
611 RetVal = KEYWORD_HANDLER_INCOMPATIBLE_VALUE_DETECTED;
618 if ((OpCodeHdr->OpCode == EFI_IFR_ONE_OF_OP) || (OpCodeHdr->OpCode == EFI_IFR_NUMERIC_OP)) {
619 switch (Flags & EFI_IFR_NUMERIC_SIZE) {
620 case EFI_IFR_NUMERIC_SIZE_1:
622 RetVal = KEYWORD_HANDLER_INCOMPATIBLE_VALUE_DETECTED;
628 case EFI_IFR_NUMERIC_SIZE_2:
630 RetVal = KEYWORD_HANDLER_INCOMPATIBLE_VALUE_DETECTED;
636 case EFI_IFR_NUMERIC_SIZE_4:
638 RetVal = KEYWORD_HANDLER_INCOMPATIBLE_VALUE_DETECTED;
644 case EFI_IFR_NUMERIC_SIZE_8:
646 RetVal = KEYWORD_HANDLER_INCOMPATIBLE_VALUE_DETECTED;
668 StringPtr = NextFilter;
675 *NextString = StringPtr;
780 IN CHAR16 *KeywordValue,
781 OUT EFI_STRING_ID *StringId
785 EFI_STRING_ID CurrentStringId;
788 UINT8 *StringTextPtr;
793 EFI_HII_SIBT_EXT2_BLOCK Ext2;
797 CHAR8 *AsciiKeywordValue;
798 UINTN KeywordValueSize;
801 ASSERT (StringPackage != NULL && KeywordValue != NULL && StringId != NULL);
805 Status = EFI_SUCCESS;
807 BlockHdr = StringPackage->StringBlock;
814 KeywordValueSize = StrLen (KeywordValue) + 1;
815 AsciiKeywordValue = AllocatePool (KeywordValueSize);
816 if (AsciiKeywordValue == NULL) {
817 return EFI_OUT_OF_RESOURCES;
820 UnicodeStrToAsciiStrS (KeywordValue, AsciiKeywordValue, KeywordValueSize);
822 while (*BlockHdr != EFI_HII_SIBT_END) {
824 case EFI_HII_SIBT_STRING_SCSU:
825 Offset =
sizeof (EFI_HII_STRING_BLOCK);
826 StringTextPtr = BlockHdr + Offset;
827 BlockSize += Offset + AsciiStrSize ((CHAR8 *)StringTextPtr);
828 if (AsciiStrCmp (AsciiKeywordValue, (CHAR8 *)StringTextPtr) == 0) {
829 *StringId = CurrentStringId;
836 case EFI_HII_SIBT_STRING_SCSU_FONT:
837 Offset =
sizeof (EFI_HII_SIBT_STRING_SCSU_FONT_BLOCK) -
sizeof (UINT8);
838 StringTextPtr = BlockHdr + Offset;
839 if (AsciiStrCmp (AsciiKeywordValue, (CHAR8 *)StringTextPtr) == 0) {
840 *StringId = CurrentStringId;
844 BlockSize += Offset + AsciiStrSize ((CHAR8 *)StringTextPtr);
848 case EFI_HII_SIBT_STRINGS_SCSU:
849 CopyMem (&StringCount, BlockHdr +
sizeof (EFI_HII_STRING_BLOCK),
sizeof (UINT16));
850 StringTextPtr = (UINT8 *)((UINTN)BlockHdr +
sizeof (EFI_HII_SIBT_STRINGS_SCSU_BLOCK) -
sizeof (UINT8));
853 for (Index = 0; Index < StringCount; Index++) {
854 BlockSize += AsciiStrSize ((CHAR8 *)StringTextPtr);
855 if (AsciiStrCmp (AsciiKeywordValue, (CHAR8 *)StringTextPtr) == 0) {
856 *StringId = CurrentStringId;
860 StringTextPtr = StringTextPtr + AsciiStrSize ((CHAR8 *)StringTextPtr);
866 case EFI_HII_SIBT_STRINGS_SCSU_FONT:
869 (UINT8 *)((UINTN)BlockHdr +
sizeof (EFI_HII_STRING_BLOCK) +
sizeof (UINT8)),
872 StringTextPtr = (UINT8 *)((UINTN)BlockHdr +
sizeof (EFI_HII_SIBT_STRINGS_SCSU_FONT_BLOCK) -
sizeof (UINT8));
875 for (Index = 0; Index < StringCount; Index++) {
876 BlockSize += AsciiStrSize ((CHAR8 *)StringTextPtr);
877 if (AsciiStrCmp (AsciiKeywordValue, (CHAR8 *)StringTextPtr) == 0) {
878 *StringId = CurrentStringId;
882 StringTextPtr = StringTextPtr + AsciiStrSize ((CHAR8 *)StringTextPtr);
888 case EFI_HII_SIBT_STRING_UCS2:
889 Offset =
sizeof (EFI_HII_STRING_BLOCK);
890 StringTextPtr = BlockHdr + Offset;
896 if (EFI_ERROR (Status)) {
901 if (StrCmp (KeywordValue, String) == 0) {
902 *StringId = CurrentStringId;
910 case EFI_HII_SIBT_STRING_UCS2_FONT:
911 Offset =
sizeof (EFI_HII_SIBT_STRING_UCS2_FONT_BLOCK) -
sizeof (CHAR16);
912 StringTextPtr = BlockHdr + Offset;
918 if (EFI_ERROR (Status)) {
923 if (StrCmp (KeywordValue, String) == 0) {
924 *StringId = CurrentStringId;
932 case EFI_HII_SIBT_STRINGS_UCS2:
933 Offset =
sizeof (EFI_HII_SIBT_STRINGS_UCS2_BLOCK) -
sizeof (CHAR16);
934 StringTextPtr = BlockHdr + Offset;
936 CopyMem (&StringCount, BlockHdr +
sizeof (EFI_HII_STRING_BLOCK),
sizeof (UINT16));
937 for (Index = 0; Index < StringCount; Index++) {
939 if (EFI_ERROR (Status)) {
945 if (StrCmp (KeywordValue, String) == 0) {
946 *StringId = CurrentStringId;
950 StringTextPtr = StringTextPtr + StringSize;
956 case EFI_HII_SIBT_STRINGS_UCS2_FONT:
957 Offset =
sizeof (EFI_HII_SIBT_STRINGS_UCS2_FONT_BLOCK) -
sizeof (CHAR16);
958 StringTextPtr = BlockHdr + Offset;
962 (UINT8 *)((UINTN)BlockHdr +
sizeof (EFI_HII_STRING_BLOCK) +
sizeof (UINT8)),
965 for (Index = 0; Index < StringCount; Index++) {
967 if (EFI_ERROR (Status)) {
973 if (StrCmp (KeywordValue, String) == 0) {
974 *StringId = CurrentStringId;
978 StringTextPtr = StringTextPtr + StringSize;
984 case EFI_HII_SIBT_DUPLICATE:
985 BlockSize +=
sizeof (EFI_HII_SIBT_DUPLICATE_BLOCK);
989 case EFI_HII_SIBT_SKIP1:
990 SkipCount = (UINT16)(*(UINT8 *)((UINTN)BlockHdr +
sizeof (EFI_HII_STRING_BLOCK)));
991 CurrentStringId = (UINT16)(CurrentStringId + SkipCount);
992 BlockSize +=
sizeof (EFI_HII_SIBT_SKIP1_BLOCK);
995 case EFI_HII_SIBT_SKIP2:
996 CopyMem (&SkipCount, BlockHdr +
sizeof (EFI_HII_STRING_BLOCK),
sizeof (UINT16));
997 CurrentStringId = (UINT16)(CurrentStringId + SkipCount);
998 BlockSize +=
sizeof (EFI_HII_SIBT_SKIP2_BLOCK);
1001 case EFI_HII_SIBT_EXT1:
1004 (UINT8 *)((UINTN)BlockHdr +
sizeof (EFI_HII_STRING_BLOCK) +
sizeof (UINT8)),
1010 case EFI_HII_SIBT_EXT2:
1011 CopyMem (&Ext2, BlockHdr,
sizeof (EFI_HII_SIBT_EXT2_BLOCK));
1015 case EFI_HII_SIBT_EXT4:
1018 (UINT8 *)((UINTN)BlockHdr +
sizeof (EFI_HII_STRING_BLOCK) +
sizeof (UINT8)),
1029 if (String != NULL) {
1034 BlockHdr = StringPackage->StringBlock +
BlockSize;
1037 Status = EFI_NOT_FOUND;
1040 if (AsciiKeywordValue != NULL) {
1041 FreePool (AsciiKeywordValue);
1044 if (String != NULL) {
1066 IN EFI_STRING_ID StringId,
1067 OUT EFI_STRING *KeywordValue
1071 EFI_STRING_ID CurrentStringId;
1074 UINT8 *StringTextPtr;
1079 EFI_HII_SIBT_EXT2_BLOCK Ext2;
1085 ASSERT (StringPackage != NULL);
1088 CurrentStringId = 1;
1095 BlockHdr = StringPackage->StringBlock;
1098 while (*BlockHdr != EFI_HII_SIBT_END) {
1099 switch (*BlockHdr) {
1100 case EFI_HII_SIBT_STRING_SCSU:
1101 Offset =
sizeof (EFI_HII_STRING_BLOCK);
1102 StringTextPtr = BlockHdr + Offset;
1105 StringSize = AsciiStrSize ((CHAR8 *)StringTextPtr);
1106 *KeywordValue = AllocatePool (StringSize *
sizeof (CHAR16));
1107 if (*KeywordValue == NULL) {
1111 AsciiStrToUnicodeStrS ((CHAR8 *)StringTextPtr, *KeywordValue, StringSize);
1112 return CurrentStringId;
1113 }
else if (CurrentStringId == StringId) {
1117 BlockSize += Offset + AsciiStrSize ((CHAR8 *)StringTextPtr);
1121 case EFI_HII_SIBT_STRING_SCSU_FONT:
1122 Offset =
sizeof (EFI_HII_SIBT_STRING_SCSU_FONT_BLOCK) -
sizeof (UINT8);
1123 StringTextPtr = BlockHdr + Offset;
1126 StringSize = AsciiStrSize ((CHAR8 *)StringTextPtr);
1127 *KeywordValue = AllocatePool (StringSize *
sizeof (CHAR16));
1128 if (*KeywordValue == NULL) {
1132 AsciiStrToUnicodeStrS ((CHAR8 *)StringTextPtr, *KeywordValue, StringSize);
1133 return CurrentStringId;
1134 }
else if (CurrentStringId == StringId) {
1138 BlockSize += Offset + AsciiStrSize ((CHAR8 *)StringTextPtr);
1142 case EFI_HII_SIBT_STRINGS_SCSU:
1143 CopyMem (&StringCount, BlockHdr +
sizeof (EFI_HII_STRING_BLOCK),
sizeof (UINT16));
1144 StringTextPtr = (UINT8 *)((UINTN)BlockHdr +
sizeof (EFI_HII_SIBT_STRINGS_SCSU_BLOCK) -
sizeof (UINT8));
1147 for (Index = 0; Index < StringCount; Index++) {
1149 StringSize = AsciiStrSize ((CHAR8 *)StringTextPtr);
1150 *KeywordValue = AllocatePool (StringSize *
sizeof (CHAR16));
1151 if (*KeywordValue == NULL) {
1155 AsciiStrToUnicodeStrS ((CHAR8 *)StringTextPtr, *KeywordValue, StringSize);
1156 return CurrentStringId;
1157 }
else if (CurrentStringId == StringId) {
1161 BlockSize += AsciiStrSize ((CHAR8 *)StringTextPtr);
1162 StringTextPtr = StringTextPtr + AsciiStrSize ((CHAR8 *)StringTextPtr);
1168 case EFI_HII_SIBT_STRINGS_SCSU_FONT:
1171 (UINT8 *)((UINTN)BlockHdr +
sizeof (EFI_HII_STRING_BLOCK) +
sizeof (UINT8)),
1174 StringTextPtr = (UINT8 *)((UINTN)BlockHdr +
sizeof (EFI_HII_SIBT_STRINGS_SCSU_FONT_BLOCK) -
sizeof (UINT8));
1177 for (Index = 0; Index < StringCount; Index++) {
1179 StringSize = AsciiStrSize ((CHAR8 *)StringTextPtr);
1180 *KeywordValue = AllocatePool (StringSize *
sizeof (CHAR16));
1181 if (*KeywordValue == NULL) {
1185 AsciiStrToUnicodeStrS ((CHAR8 *)StringTextPtr, *KeywordValue, StringSize);
1186 return CurrentStringId;
1187 }
else if (CurrentStringId == StringId) {
1191 BlockSize += AsciiStrSize ((CHAR8 *)StringTextPtr);
1192 StringTextPtr = StringTextPtr + AsciiStrSize ((CHAR8 *)StringTextPtr);
1198 case EFI_HII_SIBT_STRING_UCS2:
1199 Offset =
sizeof (EFI_HII_STRING_BLOCK);
1200 StringTextPtr = BlockHdr + Offset;
1206 if (FindString && (String != NULL) && (*String != L
'\0')) {
1212 *KeywordValue = String;
1213 return CurrentStringId;
1214 }
else if (CurrentStringId == StringId) {
1222 case EFI_HII_SIBT_STRING_UCS2_FONT:
1223 Offset =
sizeof (EFI_HII_SIBT_STRING_UCS2_FONT_BLOCK) -
sizeof (CHAR16);
1224 StringTextPtr = BlockHdr + Offset;
1231 *KeywordValue = String;
1232 return CurrentStringId;
1233 }
else if (CurrentStringId == StringId) {
1241 case EFI_HII_SIBT_STRINGS_UCS2:
1242 Offset =
sizeof (EFI_HII_SIBT_STRINGS_UCS2_BLOCK) -
sizeof (CHAR16);
1243 StringTextPtr = BlockHdr + Offset;
1245 CopyMem (&StringCount, BlockHdr +
sizeof (EFI_HII_STRING_BLOCK),
sizeof (UINT16));
1246 for (Index = 0; Index < StringCount; Index++) {
1250 *KeywordValue = String;
1251 return CurrentStringId;
1252 }
else if (CurrentStringId == StringId) {
1257 StringTextPtr = StringTextPtr + StringSize;
1263 case EFI_HII_SIBT_STRINGS_UCS2_FONT:
1264 Offset =
sizeof (EFI_HII_SIBT_STRINGS_UCS2_FONT_BLOCK) -
sizeof (CHAR16);
1265 StringTextPtr = BlockHdr + Offset;
1269 (UINT8 *)((UINTN)BlockHdr +
sizeof (EFI_HII_STRING_BLOCK) +
sizeof (UINT8)),
1272 for (Index = 0; Index < StringCount; Index++) {
1275 *KeywordValue = String;
1276 return CurrentStringId;
1277 }
else if (CurrentStringId == StringId) {
1282 StringTextPtr = StringTextPtr + StringSize;
1288 case EFI_HII_SIBT_DUPLICATE:
1289 BlockSize +=
sizeof (EFI_HII_SIBT_DUPLICATE_BLOCK);
1293 case EFI_HII_SIBT_SKIP1:
1294 SkipCount = (UINT16)(*(UINT8 *)((UINTN)BlockHdr +
sizeof (EFI_HII_STRING_BLOCK)));
1295 CurrentStringId = (UINT16)(CurrentStringId + SkipCount);
1296 BlockSize +=
sizeof (EFI_HII_SIBT_SKIP1_BLOCK);
1299 case EFI_HII_SIBT_SKIP2:
1300 CopyMem (&SkipCount, BlockHdr +
sizeof (EFI_HII_STRING_BLOCK),
sizeof (UINT16));
1301 CurrentStringId = (UINT16)(CurrentStringId + SkipCount);
1302 BlockSize +=
sizeof (EFI_HII_SIBT_SKIP2_BLOCK);
1305 case EFI_HII_SIBT_EXT1:
1308 (UINT8 *)((UINTN)BlockHdr +
sizeof (EFI_HII_STRING_BLOCK) +
sizeof (UINT8)),
1314 case EFI_HII_SIBT_EXT2:
1315 CopyMem (&Ext2, BlockHdr,
sizeof (EFI_HII_SIBT_EXT2_BLOCK));
1319 case EFI_HII_SIBT_EXT4:
1322 (UINT8 *)((UINTN)BlockHdr +
sizeof (EFI_HII_STRING_BLOCK) +
sizeof (UINT8)),
1333 if (String != NULL) {
1338 BlockHdr = StringPackage->StringBlock +
BlockSize;
1363 IN CHAR8 **NameSpace,
1364 IN CHAR16 *KeywordValue,
1365 OUT EFI_STRING_ID *StringId
1375 ASSERT (DatabaseRecord != NULL && NameSpace != NULL && KeywordValue != NULL);
1377 PackageListNode = DatabaseRecord->PackageList;
1378 RetVal = KEYWORD_HANDLER_NAMESPACE_ID_NOT_FOUND;
1380 if (*NameSpace != NULL) {
1383 Name = UEFI_CONFIG_LANG;
1386 for (Link = PackageListNode->
StringPkgHdr.ForwardLink; Link != &PackageListNode->
StringPkgHdr; Link = Link->ForwardLink) {
1389 if (AsciiStrnCmp (Name, StringPackage->
StringPkgHdr->Language, AsciiStrLen (Name)) == 0) {
1391 if (EFI_ERROR (Status)) {
1392 return KEYWORD_HANDLER_KEYWORD_NOT_FOUND;
1394 if (*NameSpace == NULL) {
1395 *NameSpace = AllocateCopyPool (AsciiStrSize (StringPackage->
StringPkgHdr->Language), StringPackage->
StringPkgHdr->Language);
1396 if (*NameSpace == NULL) {
1397 return KEYWORD_HANDLER_UNDEFINED_PROCESSING_ERROR;
1401 return KEYWORD_HANDLER_NO_ERROR;
1582 IN UINT8 *OpCodeData
1585 UINT8 *NextOpCodeData;
1587 ASSERT (OpCodeData != NULL);
1589 switch (((EFI_IFR_OP_HEADER *)OpCodeData)->OpCode) {
1590 case EFI_IFR_REF_OP:
1591 return (UINT16)
sizeof (EFI_HII_REF);
1593 case EFI_IFR_ONE_OF_OP:
1594 case EFI_IFR_NUMERIC_OP:
1595 switch (((EFI_IFR_ONE_OF *)OpCodeData)->Flags & EFI_IFR_NUMERIC_SIZE) {
1596 case EFI_IFR_NUMERIC_SIZE_1:
1597 return (UINT16)
sizeof (UINT8);
1599 case EFI_IFR_NUMERIC_SIZE_2:
1600 return (UINT16)
sizeof (UINT16);
1602 case EFI_IFR_NUMERIC_SIZE_4:
1603 return (UINT16)
sizeof (UINT32);
1605 case EFI_IFR_NUMERIC_SIZE_8:
1606 return (UINT16)
sizeof (UINT64);
1613 case EFI_IFR_ORDERED_LIST_OP:
1614 NextOpCodeData = OpCodeData + ((EFI_IFR_ORDERED_LIST *)OpCodeData)->Header.Length;
1618 ASSERT (((EFI_IFR_OP_HEADER *)NextOpCodeData)->OpCode == EFI_IFR_ONE_OF_OPTION_OP);
1619 switch (((EFI_IFR_ONE_OF_OPTION *)NextOpCodeData)->Type) {
1620 case EFI_IFR_TYPE_NUM_SIZE_8:
1621 return (UINT16)
sizeof (UINT8) * ((EFI_IFR_ORDERED_LIST *)OpCodeData)->MaxContainers;
1623 case EFI_IFR_TYPE_NUM_SIZE_16:
1624 return (UINT16)
sizeof (UINT16) * ((EFI_IFR_ORDERED_LIST *)OpCodeData)->MaxContainers;
1626 case EFI_IFR_TYPE_NUM_SIZE_32:
1627 return (UINT16)
sizeof (UINT32) * ((EFI_IFR_ORDERED_LIST *)OpCodeData)->MaxContainers;
1629 case EFI_IFR_TYPE_NUM_SIZE_64:
1630 return (UINT16)
sizeof (UINT64) * ((EFI_IFR_ORDERED_LIST *)OpCodeData)->MaxContainers;
1637 case EFI_IFR_CHECKBOX_OP:
1638 return (UINT16)
sizeof (BOOLEAN);
1640 case EFI_IFR_PASSWORD_OP:
1641 return (UINT16)((UINTN)((EFI_IFR_PASSWORD *)OpCodeData)->MaxSize *
sizeof (CHAR16));
1643 case EFI_IFR_STRING_OP:
1644 return (UINT16)((UINTN)((EFI_IFR_STRING *)OpCodeData)->MaxSize *
sizeof (CHAR16));
1646 case EFI_IFR_DATE_OP:
1647 return (UINT16)
sizeof (EFI_HII_DATE);
1649 case EFI_IFR_TIME_OP:
1650 return (UINT16)
sizeof (EFI_HII_TIME);
1715 IN UINT8 *OpCodeData,
1716 IN EFI_HANDLE DriverHandle
1720 EFI_DEVICE_PATH_PROTOCOL *DevicePath;
1721 UINTN DevicePathSize;
1723 CHAR16 *ReturnString;
1732 ASSERT (OpCodeData != NULL);
1734 switch (((EFI_IFR_OP_HEADER *)OpCodeData)->OpCode) {
1735 case EFI_IFR_VARSTORE_OP:
1736 Guid = (EFI_GUID *)(UINTN *)&((EFI_IFR_VARSTORE *)OpCodeData)->Guid;
1737 AsciiName = (CHAR8 *)((EFI_IFR_VARSTORE *)OpCodeData)->Name;
1740 case EFI_IFR_VARSTORE_NAME_VALUE_OP:
1741 Guid = (EFI_GUID *)(UINTN *)&((EFI_IFR_VARSTORE_NAME_VALUE *)OpCodeData)->Guid;
1745 case EFI_IFR_VARSTORE_EFI_OP:
1746 Guid = (EFI_GUID *)(UINTN *)&((EFI_IFR_VARSTORE_EFI *)OpCodeData)->Guid;
1747 AsciiName = (CHAR8 *)((EFI_IFR_VARSTORE_EFI *)OpCodeData)->Name;
1757 if (AsciiName != NULL) {
1758 NameSize = AsciiStrSize (AsciiName);
1759 Name = AllocateZeroPool (NameSize *
sizeof (CHAR16));
1761 AsciiStrToUnicodeStrS (AsciiName, Name, NameSize);
1772 NameLength = StrLen (Name);
1780 if (DriverHandle != NULL) {
1782 if (DevicePath == NULL) {
1789 DevicePathSize = GetDevicePathSize (DevicePath);
1796 MaxLen = 5 +
sizeof (EFI_GUID) * 2 + 6 + NameLength * 4 + 6 + DevicePathSize * 2 + 1;
1797 String = AllocateZeroPool (MaxLen *
sizeof (CHAR16));
1798 if (String == NULL) {
1805 StrCpyS (String, MaxLen, L
"GUID=");
1806 ReturnString = String;
1807 String += StrLen (String);
1813 for (Index = 0,
Buffer = (UINT8 *)Guid; Index <
sizeof (EFI_GUID); Index++) {
1814 UnicodeValueToStringS (
1816 MaxLen *
sizeof (CHAR16) - ((UINTN)String - (UINTN)ReturnString),
1817 PREFIX_ZERO | RADIX_HEX,
1821 String += StrnLenS (String, MaxLen - ((UINTN)String - (UINTN)ReturnString) /
sizeof (CHAR16));
1828 StrCatS (ReturnString, MaxLen, L
"&NAME=");
1829 String += StrLen (String);
1835 for ( ; *Name != L
'\0'; Name++) {
1836 UnicodeValueToStringS (
1838 MaxLen *
sizeof (CHAR16) - ((UINTN)String - (UINTN)ReturnString),
1839 PREFIX_ZERO | RADIX_HEX,
1843 String += StrnLenS (String, MaxLen - ((UINTN)String - (UINTN)ReturnString) /
sizeof (CHAR16));
1850 StrCatS (ReturnString, MaxLen, L
"&PATH=");
1851 String += StrLen (String);
1856 for (Index = 0,
Buffer = (UINT8 *)DevicePath; Index < DevicePathSize; Index++) {
1857 UnicodeValueToStringS (
1859 MaxLen *
sizeof (CHAR16) - ((UINTN)String - (UINTN)ReturnString),
1860 PREFIX_ZERO | RADIX_HEX,
1864 String += StrnLenS (String, MaxLen - ((UINTN)String - (UINTN)ReturnString) /
sizeof (CHAR16));
2063 IN EFI_STRING_ID KeywordStrId,
2064 OUT UINT8 **OpCodeData,
2065 OUT EFI_STRING *ConfigRequest
2071 EFI_IFR_QUESTION_HEADER *
Header;
2078 CHAR16 *RequestElement;
2082 ASSERT (DatabaseRecord != NULL && OpCodeData != NULL && ConfigRequest != NULL);
2089 PackageListNode = DatabaseRecord->PackageList;
2094 for (Link = PackageListNode->
FormPkgHdr.ForwardLink; Link != &PackageListNode->
FormPkgHdr; Link = Link->ForwardLink) {
2098 if (OpCode != NULL) {
2099 *OpCodeData = OpCode;
2100 Header = (EFI_IFR_QUESTION_HEADER *)(OpCode +
sizeof (EFI_IFR_OP_HEADER));
2105 DEBUG ((EFI_D_INFO,
"Varstore Id: 0x%x\n",
Header->VarStoreId));
2108 ASSERT (Storage != NULL);
2110 if (((EFI_IFR_OP_HEADER *)Storage)->OpCode == EFI_IFR_VARSTORE_NAME_VALUE_OP) {
2113 Offset =
Header->VarStoreInfo.VarOffset;
2119 ASSERT (ConfigHdr != NULL);
2121 MaxLen = StrLen (ConfigHdr) + 1 + StrLen (RequestElement) + 1;
2122 *ConfigRequest = AllocatePool (MaxLen *
sizeof (CHAR16));
2123 if (*ConfigRequest == NULL) {
2124 FreePool (ConfigHdr);
2125 FreePool (RequestElement);
2126 return EFI_OUT_OF_RESOURCES;
2129 StringPtr = *ConfigRequest;
2131 StrCpyS (StringPtr, MaxLen, ConfigHdr);
2133 StrCatS (StringPtr, MaxLen, L
"&");
2135 StrCatS (StringPtr, MaxLen, RequestElement);
2137 FreePool (ConfigHdr);
2138 FreePool (RequestElement);
2144 return EFI_NOT_FOUND;
2167 IN EFI_STRING_ID KeywordStrId,
2168 IN EFI_STRING ValueElement,
2169 OUT UINT8 **OpCodeData,
2170 OUT EFI_STRING *ConfigResp
2176 EFI_IFR_QUESTION_HEADER *
Header;
2183 CHAR16 *RequestElement;
2187 ASSERT ((DatabaseRecord != NULL) && (OpCodeData != NULL) && (ConfigResp != NULL) && (ValueElement != NULL));
2194 PackageListNode = DatabaseRecord->PackageList;
2199 for (Link = PackageListNode->
FormPkgHdr.ForwardLink; Link != &PackageListNode->
FormPkgHdr; Link = Link->ForwardLink) {
2203 if (OpCode != NULL) {
2204 *OpCodeData = OpCode;
2205 Header = (EFI_IFR_QUESTION_HEADER *)(OpCode +
sizeof (EFI_IFR_OP_HEADER));
2210 DEBUG ((EFI_D_INFO,
"Varstore Id: 0x%x\n",
Header->VarStoreId));
2213 ASSERT (Storage != NULL);
2215 if (((EFI_IFR_OP_HEADER *)Storage)->OpCode == EFI_IFR_VARSTORE_NAME_VALUE_OP) {
2218 Offset =
Header->VarStoreInfo.VarOffset;
2225 ASSERT (ConfigHdr != NULL);
2227 MaxLen = StrLen (ConfigHdr) + 1 + StrLen (RequestElement) + 1 +
L_STR_LEN (L
"VALUE=") + StrLen (ValueElement) + 1;
2228 *ConfigResp = AllocatePool (MaxLen *
sizeof (CHAR16));
2229 if (*ConfigResp == NULL) {
2230 FreePool (ConfigHdr);
2231 FreePool (RequestElement);
2232 return EFI_OUT_OF_RESOURCES;
2235 StringPtr = *ConfigResp;
2237 StrCpyS (StringPtr, MaxLen, ConfigHdr);
2239 StrCatS (StringPtr, MaxLen, L
"&");
2241 StrCatS (StringPtr, MaxLen, RequestElement);
2243 StrCatS (StringPtr, MaxLen, L
"&");
2245 StrCatS (StringPtr, MaxLen, L
"VALUE=");
2247 StrCatS (StringPtr, MaxLen, ValueElement);
2249 FreePool (ConfigHdr);
2250 FreePool (RequestElement);
2256 return EFI_NOT_FOUND;
2339 IN EFI_DEVICE_PATH_PROTOCOL **DevicePath,
2340 IN CHAR8 **NameSpace,
2341 IN CHAR16 *KeywordData,
2342 OUT UINT32 *ProgressErr,
2343 OUT EFI_STRING_ID *KeywordStringId,
2349 BOOLEAN FindNameSpace;
2350 EFI_DEVICE_PATH_PROTOCOL *DestDevicePath;
2351 UINT8 *DevicePathPkg;
2352 UINTN DevicePathSize;
2354 ASSERT ((NameSpace != NULL) && (KeywordData != NULL) && (ProgressErr != NULL) && (KeywordStringId != NULL) && (DataBaseRecord != NULL));
2356 FindNameSpace = FALSE;
2358 if (*DevicePath != NULL) {
2363 if (Record == NULL) {
2368 *ProgressErr = KEYWORD_HANDLER_MALFORMED_STRING;
2369 return EFI_INVALID_PARAMETER;
2376 switch (*ProgressErr) {
2377 case KEYWORD_HANDLER_NO_ERROR:
2378 *DataBaseRecord = Record;
2381 case KEYWORD_HANDLER_NAMESPACE_ID_NOT_FOUND:
2382 return EFI_INVALID_PARAMETER;
2385 ASSERT (*ProgressErr == KEYWORD_HANDLER_KEYWORD_NOT_FOUND);
2386 return EFI_NOT_FOUND;
2396 if (*ProgressErr == KEYWORD_HANDLER_NO_ERROR) {
2397 *DataBaseRecord = Record;
2400 DestDevicePath = (EFI_DEVICE_PATH_PROTOCOL *)(DevicePathPkg +
sizeof (EFI_HII_PACKAGE_HEADER));
2401 DevicePathSize = GetDevicePathSize ((EFI_DEVICE_PATH_PROTOCOL *)DestDevicePath);
2402 *DevicePath = AllocateCopyPool (DevicePathSize, DestDevicePath);
2403 if (*DevicePath == NULL) {
2404 return EFI_OUT_OF_RESOURCES;
2414 }
else if (*ProgressErr == KEYWORD_HANDLER_UNDEFINED_PROCESSING_ERROR) {
2415 return EFI_OUT_OF_RESOURCES;
2416 }
else if (*ProgressErr == KEYWORD_HANDLER_KEYWORD_NOT_FOUND) {
2417 FindNameSpace = TRUE;
2425 if (FindNameSpace) {
2426 return EFI_NOT_FOUND;
2428 return EFI_INVALID_PARAMETER;
2451 IN CHAR8 *NameSpace,
2452 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
2453 IN EFI_STRING KeywordData,
2454 IN EFI_STRING ValueStr,
2455 IN BOOLEAN ReadOnly,
2456 OUT EFI_STRING *KeywordResp
2462 CHAR16 *UnicodeNameSpace;
2463 UINTN NameSpaceLength;
2465 ASSERT ((NameSpace != NULL) && (DevicePath != NULL) && (KeywordData != NULL) && (ValueStr != NULL) && (KeywordResp != NULL));
2474 NameSpaceLength = AsciiStrLen (NameSpace);
2475 RespStrLen = 10 + NameSpaceLength;
2476 UnicodeNameSpace = AllocatePool ((NameSpaceLength + 1) *
sizeof (CHAR16));
2477 if (UnicodeNameSpace == NULL) {
2478 return EFI_OUT_OF_RESOURCES;
2481 AsciiStrToUnicodeStrS (NameSpace, UnicodeNameSpace, NameSpaceLength + 1);
2490 GetDevicePathSize ((EFI_DEVICE_PATH_PROTOCOL *)DevicePath),
2495 RespStrLen += StrLen (PathHdr);
2501 RespStrLen += 8 + StrLen (KeywordData);
2507 RespStrLen += StrLen (ValueStr);
2521 *KeywordResp = AllocatePool (RespStrLen *
sizeof (CHAR16));
2522 if (*KeywordResp == NULL) {
2523 if (UnicodeNameSpace != NULL) {
2524 FreePool (UnicodeNameSpace);
2527 return EFI_OUT_OF_RESOURCES;
2530 RespStr = *KeywordResp;
2535 StrCpyS (RespStr, RespStrLen, L
"NAMESPACE=");
2537 StrCatS (RespStr, RespStrLen, UnicodeNameSpace);
2542 StrCatS (RespStr, RespStrLen, PathHdr);
2547 StrCatS (RespStr, RespStrLen, L
"KEYWORD=");
2549 StrCatS (RespStr, RespStrLen, KeywordData);
2554 StrCatS (RespStr, RespStrLen, ValueStr);
2560 StrCatS (RespStr, RespStrLen, L
"&READONLY");
2563 if (UnicodeNameSpace != NULL) {
2564 FreePool (UnicodeNameSpace);
2567 if (PathHdr != NULL) {
2639 IN CHAR8 *NameSpace,
2640 OUT EFI_STRING *MultiResp,
2641 OUT UINT32 *ProgressErr
2645 LIST_ENTRY *StringLink;
2646 UINT8 *DevicePathPkg;
2651 CHAR8 *LocalNameSpace;
2652 EFI_STRING_ID NextStringId;
2655 CHAR16 *ConfigRequest;
2656 CHAR16 *ValueElement;
2657 CHAR16 *KeywordResp;
2658 CHAR16 *MultiKeywordResp;
2659 CHAR16 *KeywordData;
2661 BOOLEAN FindKeywordPackages;
2663 DataBaseRecord = NULL;
2664 Status = EFI_SUCCESS;
2665 MultiKeywordResp = NULL;
2667 LocalNameSpace = NULL;
2668 ConfigRequest = NULL;
2669 ValueElement = NULL;
2671 FindKeywordPackages = FALSE;
2673 if (NameSpace == NULL) {
2674 NameSpace = UEFI_CONFIG_LANG;
2683 DevicePath = DevicePathPkg +
sizeof (EFI_HII_PACKAGE_HEADER);
2688 for (StringLink = PackageListNode->
StringPkgHdr.ForwardLink; StringLink != &PackageListNode->
StringPkgHdr; StringLink = StringLink->ForwardLink) {
2694 if (AsciiStrnCmp (NameSpace, StringPackage->
StringPkgHdr->Language, AsciiStrLen (NameSpace)) == 0) {
2695 FindKeywordPackages = TRUE;
2699 LocalNameSpace = AllocateCopyPool (AsciiStrSize (StringPackage->
StringPkgHdr->Language), StringPackage->
StringPkgHdr->Language);
2700 if (LocalNameSpace == NULL) {
2701 return EFI_OUT_OF_RESOURCES;
2714 while ((NextStringId =
GetNextStringId (StringPackage, NextStringId, &KeywordData)) != 0) {
2719 if (EFI_ERROR (Status)) {
2730 if (EFI_ERROR (Status)) {
2731 if (Status != EFI_OUT_OF_RESOURCES) {
2752 ASSERT (DevicePath != NULL);
2753 Status =
GenerateKeywordResp (LocalNameSpace, (EFI_DEVICE_PATH_PROTOCOL *)DevicePath, KeywordData, ValueElement, ReadOnly, &KeywordResp);
2754 if (Status != EFI_SUCCESS) {
2765 if (EFI_ERROR (Status)) {
2773 if (ConfigRequest != NULL) {
2774 FreePool (ConfigRequest);
2775 ConfigRequest = NULL;
2778 if (ValueElement != NULL) {
2779 FreePool (ValueElement);
2780 ValueElement = NULL;
2783 if (KeywordResp != NULL) {
2784 FreePool (KeywordResp);
2789 if (LocalNameSpace != NULL) {
2790 FreePool (LocalNameSpace);
2791 LocalNameSpace = NULL;
2800 if (MultiKeywordResp == NULL) {
2801 Status = EFI_NOT_FOUND;
2802 if (!FindKeywordPackages) {
2803 *ProgressErr = KEYWORD_HANDLER_NAMESPACE_ID_NOT_FOUND;
2805 *ProgressErr = KEYWORD_HANDLER_KEYWORD_NOT_FOUND;
2808 Status = EFI_SUCCESS;
2811 *MultiResp = MultiKeywordResp;
2814 if (LocalNameSpace != NULL) {
2815 FreePool (LocalNameSpace);
2818 if (ConfigRequest != NULL) {
2819 FreePool (ConfigRequest);
2822 if (ValueElement != NULL) {
2823 FreePool (ValueElement);
2891 IN EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL *This,
2892 IN CONST EFI_STRING KeywordString,
2893 OUT EFI_STRING *Progress,
2894 OUT UINT32 *ProgressErr
2900 EFI_DEVICE_PATH_PROTOCOL *DevicePath;
2901 CHAR16 *NextStringPtr;
2902 CHAR16 *KeywordData;
2903 EFI_STRING_ID KeywordStringId;
2908 CHAR16 *MultiConfigResp;
2909 CHAR16 *ValueElement;
2911 EFI_STRING InternalProgress;
2913 CHAR16 *KeywordStartPos;
2915 if ((This == NULL) || (Progress == NULL) || (ProgressErr == NULL) || (KeywordString == NULL)) {
2916 return EFI_INVALID_PARAMETER;
2919 *Progress = KeywordString;
2920 *ProgressErr = KEYWORD_HANDLER_UNDEFINED_PROCESSING_ERROR;
2921 Status = EFI_SUCCESS;
2922 MultiConfigResp = NULL;
2926 ValueElement = NULL;
2928 KeywordStartPos = NULL;
2929 KeywordStringId = 0;
2934 TempString = AllocateCopyPool (StrSize (KeywordString), KeywordString);
2935 ASSERT (TempString != NULL);
2936 StringPtr = TempString;
2938 while ((StringPtr != NULL) && (*StringPtr != L
'\0')) {
2943 if (EFI_ERROR (Status)) {
2944 *ProgressErr = KEYWORD_HANDLER_MALFORMED_STRING;
2948 ASSERT (NameSpace != NULL);
2952 if (AsciiStrnCmp (NameSpace, UEFI_CONFIG_LANG,
L_STR_LEN (UEFI_CONFIG_LANG)) != 0) {
2953 *ProgressErr = KEYWORD_HANDLER_MALFORMED_STRING;
2954 Status = EFI_INVALID_PARAMETER;
2958 StringPtr = NextStringPtr;
2964 if (EFI_ERROR (Status)) {
2965 *ProgressErr = KEYWORD_HANDLER_MALFORMED_STRING;
2969 StringPtr = NextStringPtr;
2974 KeywordStartPos = StringPtr;
2975 Status =
ExtractKeyword (StringPtr, &KeywordData, &NextStringPtr);
2976 if (EFI_ERROR (Status)) {
2980 *ProgressErr = KEYWORD_HANDLER_MALFORMED_STRING;
2981 Status = EFI_INVALID_PARAMETER;
2985 StringPtr = NextStringPtr;
2990 Status =
ExtractValue (StringPtr, &ValueElement, &NextStringPtr);
2991 if (EFI_ERROR (Status)) {
2995 *ProgressErr = KEYWORD_HANDLER_MALFORMED_STRING;
2996 Status = EFI_INVALID_PARAMETER;
3000 StringPtr = NextStringPtr;
3005 if ((StringPtr != NULL) && (StrnCmp (StringPtr, L
"&READONLY",
L_STR_LEN (L
"&READONLY")) == 0)) {
3015 Status =
GetStringIdFromDatabase (&DevicePath, &NameSpace, KeywordData, &RetVal, &KeywordStringId, &DataBaseRecord);
3016 if (EFI_ERROR (Status)) {
3017 *ProgressErr = RetVal;
3024 Status =
ExtractConfigResp (DataBaseRecord, KeywordStringId, ValueElement, &OpCode, &ConfigResp);
3025 if (EFI_ERROR (Status)) {
3037 *ProgressErr = KEYWORD_HANDLER_INCOMPATIBLE_VALUE_DETECTED;
3038 Status = EFI_INVALID_PARAMETER;
3043 *ProgressErr = KEYWORD_HANDLER_ACCESS_NOT_PERMITTED;
3044 Status = EFI_ACCESS_DENIED;
3052 if (EFI_ERROR (Status)) {
3059 FreePool (NameSpace);
3060 FreePool (DevicePath);
3061 FreePool (KeywordData);
3062 FreePool (ValueElement);
3066 ValueElement = NULL;
3067 if (ConfigResp != NULL) {
3068 FreePool (ConfigResp);
3072 KeywordStartPos = NULL;
3080 (EFI_STRING)MultiConfigResp,
3083 if (EFI_ERROR (Status)) {
3084 Status = EFI_DEVICE_ERROR;
3088 *ProgressErr = KEYWORD_HANDLER_NO_ERROR;
3091 if (KeywordStartPos != NULL) {
3092 *Progress = KeywordString + (KeywordStartPos - TempString);
3094 *Progress = KeywordString + (StringPtr - TempString);
3097 ASSERT (TempString != NULL);
3098 FreePool (TempString);
3099 if (NameSpace != NULL) {
3100 FreePool (NameSpace);
3103 if (DevicePath != NULL) {
3104 FreePool (DevicePath);
3107 if (KeywordData != NULL) {
3108 FreePool (KeywordData);
3111 if (ValueElement != NULL) {
3112 FreePool (ValueElement);
3115 if (ConfigResp != NULL) {
3116 FreePool (ConfigResp);
3119 if ((MultiConfigResp != NULL) && (MultiConfigResp != ConfigResp)) {
3120 FreePool (MultiConfigResp);
3198 IN EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL *This,
3199 IN CONST EFI_STRING NameSpaceId, OPTIONAL
3200 IN CONST EFI_STRING KeywordString, OPTIONAL
3201 OUT EFI_STRING *Progress,
3202 OUT UINT32 *ProgressErr,
3203 OUT EFI_STRING *Results
3208 EFI_DEVICE_PATH_PROTOCOL *DevicePath;
3211 CHAR16 *NextStringPtr;
3212 CHAR16 *KeywordData;
3213 EFI_STRING_ID KeywordStringId;
3215 CHAR16 *ConfigRequest;
3216 CHAR16 *ValueElement;
3219 CHAR16 *KeywordResp;
3220 CHAR16 *MultiKeywordResp;
3223 if ((This == NULL) || (Progress == NULL) || (ProgressErr == NULL) || (Results == NULL)) {
3224 return EFI_INVALID_PARAMETER;
3227 *ProgressErr = KEYWORD_HANDLER_UNDEFINED_PROCESSING_ERROR;
3228 Status = EFI_SUCCESS;
3232 ConfigRequest = NULL;
3233 StringPtr = KeywordString;
3235 MultiKeywordResp = NULL;
3236 KeywordStringId = 0;
3242 if (NameSpaceId != NULL) {
3243 TempString = AllocateCopyPool (StrSize (NameSpaceId), NameSpaceId);
3244 ASSERT (TempString != NULL);
3251 if (TempString != NULL) {
3252 FreePool (TempString);
3256 if (EFI_ERROR (Status)) {
3257 *ProgressErr = KEYWORD_HANDLER_MALFORMED_STRING;
3264 if (NameSpace != NULL) {
3265 if (AsciiStrnCmp (NameSpace, UEFI_CONFIG_LANG,
L_STR_LEN (UEFI_CONFIG_LANG)) != 0) {
3266 *ProgressErr = KEYWORD_HANDLER_MALFORMED_STRING;
3267 return EFI_INVALID_PARAMETER;
3271 if (KeywordString != NULL) {
3275 TempString = AllocateCopyPool (StrSize (KeywordString), KeywordString);
3276 ASSERT (TempString != NULL);
3277 StringPtr = TempString;
3279 while (*StringPtr != L
'\0') {
3284 if (EFI_ERROR (Status)) {
3285 *ProgressErr = KEYWORD_HANDLER_MALFORMED_STRING;
3289 StringPtr = NextStringPtr;
3296 Status =
ExtractKeyword (StringPtr, &KeywordData, &NextStringPtr);
3297 if (EFI_ERROR (Status)) {
3301 *ProgressErr = KEYWORD_HANDLER_MALFORMED_STRING;
3302 Status = EFI_INVALID_PARAMETER;
3309 Status =
GetStringIdFromDatabase (&DevicePath, &NameSpace, KeywordData, &RetVal, &KeywordStringId, &DataBaseRecord);
3310 if (EFI_ERROR (Status)) {
3311 *ProgressErr = RetVal;
3319 if (EFI_ERROR (Status)) {
3327 if (EFI_ERROR (Status)) {
3328 if (Status != EFI_OUT_OF_RESOURCES) {
3329 Status = EFI_DEVICE_ERROR;
3335 StringPtr = NextStringPtr;
3340 RetVal =
ValidateFilter (OpCode, StringPtr, &NextStringPtr, &ReadOnly);
3341 if (RetVal != KEYWORD_HANDLER_NO_ERROR) {
3342 *ProgressErr = RetVal;
3343 Status = EFI_INVALID_PARAMETER;
3347 StringPtr = NextStringPtr;
3352 Status =
GenerateKeywordResp (NameSpace, DevicePath, KeywordData, ValueElement, ReadOnly, &KeywordResp);
3353 if (Status != EFI_SUCCESS) {
3361 if (EFI_ERROR (Status)) {
3368 *Results = MultiKeywordResp;
3373 FreePool (DevicePath);
3374 FreePool (KeywordData);
3375 FreePool (ValueElement);
3376 FreePool (ConfigRequest);
3379 ValueElement = NULL;
3380 ConfigRequest = NULL;
3381 if (KeywordResp != NULL) {
3382 FreePool (KeywordResp);
3391 if (EFI_ERROR (Status)) {
3395 *Results = MultiKeywordResp;
3398 *ProgressErr = KEYWORD_HANDLER_NO_ERROR;
3401 *Progress = KeywordString + (StringPtr - TempString);
3403 if (TempString != NULL) {
3404 FreePool (TempString);
3407 if (NameSpace != NULL) {
3408 FreePool (NameSpace);
3411 if (DevicePath != NULL) {
3412 FreePool (DevicePath);
3415 if (KeywordData != NULL) {
3416 FreePool (KeywordData);