34 ASSERT (String !=
NULL);
41 TmpPtr =
StrStr (String, L
"&GUID=");
46 return (TmpPtr - String);
68 OUT UINT8 **DevicePathData
73 UINT8 *DevicePathBuffer;
79 if ((String ==
NULL) || (DevicePathData ==
NULL)) {
80 return EFI_INVALID_PARAMETER;
86 for ( ; (*String != 0 &&
StrnCmp (String, L
"PATH=",
StrLen (L
"PATH=")) != 0); String++) {
90 return EFI_INVALID_PARAMETER;
96 String +=
StrLen (L
"PATH=");
98 return EFI_INVALID_PARAMETER;
108 for (Length = 0; *String != 0 && *String != L
'&'; String++, Length++) {
115 return EFI_NOT_FOUND;
124 if (DevicePathBuffer ==
NULL) {
125 return EFI_OUT_OF_RESOURCES;
131 ZeroMem (TemStr,
sizeof (TemStr));
132 for (Index = 0; Index < Length; Index++) {
133 TemStr[0] = PathHdr[Index];
135 if ((Index & 1) == 0) {
136 DevicePathBuffer[Index/2] = DigitUint8;
138 DevicePathBuffer[Index/2] = (UINT8)((DevicePathBuffer[Index/2] << 4) + DigitUint8);
152 return EFI_NOT_FOUND;
161 *DevicePathData = DevicePathBuffer;
175 IN EFI_STRING ConfigString
181 ASSERT (ConfigString !=
NULL);
186 for (String = ConfigString, Lower =
FALSE; *String != L
'\0'; String++) {
187 if (*String == L
'=') {
189 }
else if (*String == L
'&') {
191 }
else if (Lower && (*String >= L
'A') && (*String <= L
'F')) {
192 *String = (CHAR16)(*String - L
'A' + L
'a');
227 OUT EFI_STRING *SubStr
232 EFI_STRING StringHeader;
238 ASSERT (String !=
NULL && SubStr !=
NULL);
240 if (Buffer ==
NULL) {
242 ASSERT (*SubStr !=
NULL);
249 Length =
StrLen (String) + BufferLen * 2 + 1 + 1;
251 ASSERT (Str !=
NULL);
255 StringHeader = Str +
StrLen (String);
256 TemString = (CHAR16 *)StringHeader;
263 TemBuffer = ((UINT8 *)Buffer);
264 for (Index = 0; Index < BufferLen; Index++, TemBuffer++) {
267 sizeof (CHAR16) * (Length -
StrnLenS (Str, Length)),
268 PREFIX_ZERO | RADIX_HEX,
280 TemName = (CHAR16 *)Buffer;
281 ASSERT ((BufferLen * 2 + 1) >= (
StrLen (TemName) * 4 + 1));
285 for ( ; *TemName != L
'\0'; TemName++) {
288 sizeof (CHAR16) * (Length -
StrnLenS (Str, Length)),
289 PREFIX_ZERO | RADIX_HEX,
301 TemBuffer = ((UINT8 *)Buffer) + BufferLen - 1;
302 for (Index = 0; Index < BufferLen; Index++, TemBuffer--) {
305 sizeof (CHAR16) * (Length -
StrnLenS (Str, Length)),
306 PREFIX_ZERO | RADIX_HEX,
344 IN EFI_STRING String,
345 OUT EFI_STRING *ConfigBody
352 if ((String ==
NULL) || (ConfigBody ==
NULL)) {
353 return EFI_INVALID_PARAMETER;
359 if (
StrnCmp (String, L
"&ALTCFG=",
StrLen (L
"&ALTCFG=")) == 0) {
360 return EFI_INVALID_PARAMETER;
363 TmpPtr =
StrStr (String, L
"GUID=");
364 if (TmpPtr ==
NULL) {
369 if (Result ==
NULL) {
370 return EFI_OUT_OF_RESOURCES;
372 *ConfigBody = Result;
377 Length = TmpPtr - String;
379 return EFI_NOT_FOUND;
383 if (Result ==
NULL) {
384 return EFI_OUT_OF_RESOURCES;
387 *(Result + Length - 1) = 0;
388 *ConfigBody = Result;
410 IN OUT EFI_STRING *MultiString,
411 IN EFI_STRING AppendString
414 UINTN AppendStringSize;
415 UINTN MultiStringSize;
418 if ((MultiString ==
NULL) || (*MultiString ==
NULL) || (AppendString ==
NULL)) {
419 return EFI_INVALID_PARAMETER;
422 AppendStringSize =
StrSize (AppendString);
423 MultiStringSize =
StrSize (*MultiString);
424 MaxLen = MAX_STRING_LENGTH /
sizeof (CHAR16);
429 if ((MultiStringSize + AppendStringSize > MAX_STRING_LENGTH) ||
430 (MultiStringSize > MAX_STRING_LENGTH))
434 MultiStringSize + AppendStringSize,
435 (VOID *)(*MultiString)
437 MaxLen = (MultiStringSize + AppendStringSize) /
sizeof (CHAR16);
438 ASSERT (*MultiString !=
NULL);
444 StrCatS (*MultiString, MaxLen, AppendString);
470 IN EFI_STRING StringPtr,
484 if ((StringPtr ==
NULL) || (*StringPtr == L
'\0') || (Number ==
NULL) || (Len ==
NULL)) {
485 return EFI_INVALID_PARAMETER;
491 while (*StringPtr != L
'\0' && *StringPtr != L
'&') {
495 *Len = StringPtr - TmpPtr;
500 Status = EFI_OUT_OF_RESOURCES;
504 CopyMem (Str, TmpPtr, *Len *
sizeof (CHAR16));
505 *(Str + *Len) = L
'\0';
507 Length = (Length + 1) / 2;
510 Status = EFI_OUT_OF_RESOURCES;
515 ZeroMem (TemStr,
sizeof (TemStr));
516 for (Index = 0; Index < Length; Index++) {
517 TemStr[0] = Str[Length - Index - 1];
519 if ((Index & 1) == 0) {
520 Buf[Index/2] = DigitUint8;
522 Buf[Index/2] = (UINT8)((DigitUint8 << 4) + Buf[Index/2]);
552 IN EFI_STRING String,
553 IN EFI_STRING BlockName,
566 BlockPtr =
StrStr (String, BlockName);
568 while (BlockPtr !=
NULL) {
569 BlockPtr +=
StrLen (BlockName);
571 if (EFI_ERROR (Status)) {
575 ASSERT (TempBuffer !=
NULL);
576 if ((BufferLen == Length) && (0 ==
CompareMem (Buffer, TempBuffer, Length))) {
584 BlockPtr =
StrStr (BlockPtr + 1, BlockName);
610 IN EFI_STRING DefaultAltCfgResp,
611 IN OUT EFI_STRING *ConfigAltResp,
612 IN EFI_STRING AltConfigHdr,
613 IN OUT BOOLEAN *ConfigAltRespChanged
618 EFI_STRING BlockPtrStart;
619 EFI_STRING StringPtr;
620 EFI_STRING AppendString;
621 EFI_STRING AltConfigHdrPtr;
633 AltConfigHdrPtr =
StrStr (DefaultAltCfgResp, AltConfigHdr);
634 ASSERT (AltConfigHdrPtr !=
NULL);
635 BlockPtr =
StrStr (AltConfigHdrPtr, L
"&OFFSET=");
639 StringPtr =
StrStr (*ConfigAltResp, AltConfigHdr);
640 ASSERT (StringPtr !=
NULL);
642 while (BlockPtr !=
NULL) {
646 BlockPtrStart = BlockPtr;
647 BlockPtr +=
StrLen (L
"&OFFSET=");
649 if (EFI_ERROR (Status)) {
650 Status = EFI_OUT_OF_RESOURCES;
658 if (TempBuffer !=
NULL) {
663 if (EFI_ERROR (Status)) {
664 Status = EFI_OUT_OF_RESOURCES;
674 BlockPtr =
StrStr (BlockPtr + 1, L
"&OFFSET=");
675 if (BlockPtr !=
NULL) {
676 AppendSize = (BlockPtr - BlockPtrStart) *
sizeof (CHAR16);
678 AppendSize =
StrSize (BlockPtrStart);
684 if (AppendString ==
NULL) {
686 StrnCatS (AppendString, AppendSize /
sizeof (CHAR16) + 1, BlockPtrStart, AppendSize /
sizeof (CHAR16));
688 TotalSize =
StrSize (AppendString) + AppendSize +
sizeof (CHAR16);
694 if (AppendString ==
NULL) {
695 Status = EFI_OUT_OF_RESOURCES;
699 StrnCatS (AppendString, TotalSize /
sizeof (CHAR16), BlockPtrStart, AppendSize /
sizeof (CHAR16));
705 BlockPtr =
StrStr (BlockPtr + 1, L
"&OFFSET=");
709 if (AppendString !=
NULL) {
713 TotalSize =
StrSize (*ConfigAltResp) +
StrSize (AppendString) +
sizeof (CHAR16);
719 if (*ConfigAltResp ==
NULL) {
720 Status = EFI_OUT_OF_RESOURCES;
724 StrCatS (*ConfigAltResp, TotalSize /
sizeof (CHAR16), AppendString);
725 *ConfigAltRespChanged =
TRUE;
731 if (AppendString !=
NULL) {
757 IN EFI_STRING DefaultAltCfgResp,
758 IN OUT EFI_STRING *ConfigAltResp,
759 IN EFI_STRING AltConfigHdr,
760 IN OUT BOOLEAN *ConfigAltRespChanged
764 EFI_STRING NvConfigPtr;
765 EFI_STRING NvConfigStart;
766 EFI_STRING NvConfigValuePtr;
767 EFI_STRING StringPtr;
768 EFI_STRING NvConfigExist;
769 EFI_STRING AppendString;
775 NvConfigExist =
NULL;
779 NvConfigPtr =
StrStr (DefaultAltCfgResp, AltConfigHdr);
780 ASSERT (NvConfigPtr !=
NULL);
781 NvConfigPtr =
StrStr (NvConfigPtr +
StrLen (AltConfigHdr), L
"&");
785 StringPtr =
StrStr (*ConfigAltResp, AltConfigHdr);
786 ASSERT (StringPtr !=
NULL);
787 StringPtr =
StrStr (StringPtr +
StrLen (AltConfigHdr), L
"&");
788 ASSERT (StringPtr !=
NULL);
790 while (NvConfigPtr !=
NULL) {
795 NvConfigStart = NvConfigPtr;
796 NvConfigValuePtr =
StrStr (NvConfigPtr + 1, L
"=");
797 ASSERT (NvConfigValuePtr !=
NULL);
798 TempChar = *NvConfigValuePtr;
799 *NvConfigValuePtr = L
'\0';
803 NvConfigExist =
StrStr (StringPtr, NvConfigPtr);
804 if (NvConfigExist ==
NULL) {
809 *NvConfigValuePtr = TempChar;
810 NvConfigPtr =
StrStr (NvConfigPtr + 1, L
"&");
811 if (NvConfigPtr !=
NULL) {
812 AppendSize = (NvConfigPtr - NvConfigStart) *
sizeof (CHAR16);
814 AppendSize =
StrSize (NvConfigStart);
820 if (AppendString ==
NULL) {
822 StrnCatS (AppendString, AppendSize /
sizeof (CHAR16) + 1, NvConfigStart, AppendSize /
sizeof (CHAR16));
824 TotalSize =
StrSize (AppendString) + AppendSize +
sizeof (CHAR16);
830 if (AppendString ==
NULL) {
831 Status = EFI_OUT_OF_RESOURCES;
835 StrnCatS (AppendString, TotalSize /
sizeof (CHAR16), NvConfigStart, AppendSize /
sizeof (CHAR16));
841 *NvConfigValuePtr = TempChar;
842 NvConfigPtr =
StrStr (NvConfigPtr + 1, L
"&");
846 if (AppendString !=
NULL) {
850 TotalSize =
StrSize (*ConfigAltResp) +
StrSize (AppendString) +
sizeof (CHAR16);
853 StrSize (*ConfigAltResp) +
StrSize (AppendString) +
sizeof (CHAR16),
856 if (*ConfigAltResp ==
NULL) {
857 Status = EFI_OUT_OF_RESOURCES;
861 StrCatS (*ConfigAltResp, TotalSize /
sizeof (CHAR16), AppendString);
862 *ConfigAltRespChanged =
TRUE;
868 if (AppendString !=
NULL) {
894 IN OUT EFI_STRING *AltCfgResp,
895 IN EFI_STRING DefaultAltCfgResp,
896 IN EFI_STRING AltConfigHdr
900 EFI_STRING AltCfgRespBackup;
901 EFI_STRING AltConfigHdrPtr;
902 EFI_STRING AltConfigHdrPtrNext;
903 EFI_STRING ConfigAltResp;
904 EFI_STRING StringPtr;
905 EFI_STRING StringPtrNext;
907 UINTN ReallocateSize;
910 BOOLEAN ConfigAltRespChanged;
912 Status = EFI_OUT_OF_RESOURCES;
914 AltConfigHdrPtrNext =
NULL;
915 StringPtrNext =
NULL;
916 ConfigAltResp =
NULL;
917 AltCfgRespBackup =
NULL;
920 ConfigAltRespChanged =
FALSE;
925 AltConfigHdrPtr =
StrStr (DefaultAltCfgResp, AltConfigHdr);
926 ASSERT (AltConfigHdrPtr !=
NULL);
927 AltConfigHdrPtrNext =
StrStr (AltConfigHdrPtr + 1, L
"&GUID");
928 if (AltConfigHdrPtrNext !=
NULL) {
929 TempChar = *AltConfigHdrPtrNext;
930 *AltConfigHdrPtrNext = L
'\0';
936 StringPtr =
StrStr (*AltCfgResp, AltConfigHdr);
937 ASSERT (StringPtr !=
NULL);
938 StringPtrNext =
StrStr (StringPtr + 1, L
"&GUID");
939 if (StringPtrNext !=
NULL) {
940 TempCharA = *StringPtrNext;
941 *StringPtrNext = L
'\0';
948 if (ConfigAltResp ==
NULL) {
955 BlockPtr =
StrStr (AltConfigHdrPtr, L
"&OFFSET=");
956 if (BlockPtr !=
NULL) {
963 if (EFI_ERROR (Status)) {
973 if (EFI_ERROR (Status)) {
981 if (StringPtrNext !=
NULL) {
982 *StringPtrNext = TempCharA;
988 if (!ConfigAltRespChanged) {
996 if (StringPtrNext !=
NULL) {
997 ReallocateSize =
StrSize (ConfigAltResp) +
StrSize (StringPtrNext) +
sizeof (CHAR16);
999 ReallocateSize =
StrSize (ConfigAltResp) +
sizeof (CHAR16);
1003 if (AltCfgRespBackup ==
NULL) {
1007 StrCatS (AltCfgRespBackup, ReallocateSize /
sizeof (CHAR16), ConfigAltResp);
1008 if (StringPtrNext !=
NULL) {
1009 StrCatS (AltCfgRespBackup, ReallocateSize /
sizeof (CHAR16), StringPtrNext);
1013 *AltCfgResp = AltCfgRespBackup;
1018 if (ConfigAltResp !=
NULL) {
1025 if ( AltConfigHdrPtrNext !=
NULL) {
1026 *AltConfigHdrPtrNext = TempChar;
1027 AltConfigHdrPtrNext =
NULL;
1051 IN OUT EFI_STRING *AltCfgResp,
1052 IN EFI_STRING DefaultAltCfgResp
1055 EFI_STRING StringPtrDefault;
1056 EFI_STRING StringPtrEnd;
1058 EFI_STRING StringPtr;
1059 EFI_STRING AltConfigHdr;
1061 UINTN SizeAltCfgResp;
1065 if (*AltCfgResp ==
NULL) {
1066 return EFI_INVALID_PARAMETER;
1073 StringPtr = *AltCfgResp;
1078 if (
StrnCmp (StringPtr, L
"GUID=",
StrLen (L
"GUID=")) != 0) {
1079 return EFI_INVALID_PARAMETER;
1082 while (*StringPtr != L
'\0' &&
StrnCmp (StringPtr, L
"&NAME=",
StrLen (L
"&NAME=")) != 0) {
1086 while (*StringPtr != L
'\0' &&
StrnCmp (StringPtr, L
"&PATH=",
StrLen (L
"&PATH=")) != 0) {
1090 if (*StringPtr == L
'\0') {
1091 return EFI_INVALID_PARAMETER;
1094 StringPtr +=
StrLen (L
"&PATH=");
1095 while (*StringPtr != L
'\0' && *StringPtr != L
'&') {
1099 HeaderLength = StringPtr - *AltCfgResp;
1105 MaxLen = 1 + HeaderLength + 8 + 4 + 1;
1107 if (AltConfigHdr ==
NULL) {
1108 return EFI_OUT_OF_RESOURCES;
1111 StrCpyS (AltConfigHdr, MaxLen, L
"&");
1112 StrnCatS (AltConfigHdr, MaxLen, *AltCfgResp, HeaderLength);
1113 StrCatS (AltConfigHdr, MaxLen, L
"&ALTCFG=");
1114 HeaderLength =
StrLen (AltConfigHdr);
1116 StringPtrDefault =
StrStr (DefaultAltCfgResp, AltConfigHdr);
1117 while (StringPtrDefault !=
NULL) {
1121 StrnCatS (AltConfigHdr, MaxLen, StringPtrDefault + HeaderLength, 4);
1122 StringPtr =
StrStr (*AltCfgResp, AltConfigHdr);
1127 if (StringPtr ==
NULL) {
1128 StringPtrEnd =
StrStr (StringPtrDefault + 1, L
"&GUID");
1129 SizeAltCfgResp =
StrSize (*AltCfgResp);
1130 if (StringPtrEnd ==
NULL) {
1134 TotalSize = SizeAltCfgResp +
StrSize (StringPtrDefault);
1138 (VOID *)(*AltCfgResp)
1140 if (*AltCfgResp ==
NULL) {
1142 return EFI_OUT_OF_RESOURCES;
1145 StrCatS (*AltCfgResp, TotalSize /
sizeof (CHAR16), StringPtrDefault);
1148 TempChar = *StringPtrEnd;
1149 *StringPtrEnd = L
'\0';
1150 TotalSize = SizeAltCfgResp +
StrSize (StringPtrDefault);
1154 (VOID *)(*AltCfgResp)
1156 if (*AltCfgResp ==
NULL) {
1158 return EFI_OUT_OF_RESOURCES;
1161 StrCatS (*AltCfgResp, TotalSize /
sizeof (CHAR16), StringPtrDefault);
1162 *StringPtrEnd = TempChar;
1176 *(AltConfigHdr + HeaderLength) = L
'\0';
1177 StringPtrDefault =
StrStr (StringPtrDefault + 1, AltConfigHdr);
1201 DefaultLink = &BlockData->DefaultValueEntry;
1203 for (Link = DefaultLink->ForwardLink; Link != DefaultLink; Link = Link->ForwardLink) {
1205 if (DefaultValueArray->DefaultId == DefaultValueData->DefaultId) {
1210 if ((DefaultValueData->Type > DefaultValueArray->Type) || ((DefaultValueData->Type == DefaultValueArray->Type) && (DefaultValueData->Type == DefaultValueFromOtherDefault))) {
1215 DefaultValueArray->Type = DefaultValueData->Type;
1216 DefaultValueArray->Cleaned = DefaultValueData->Cleaned;
1227 ASSERT (DefaultValueArray !=
NULL);
1249 BlockSingleData = *BlockData;
1251 if (BlockSingleData->Name !=
NULL) {
1259 for (Link = BlockLink->ForwardLink; Link != BlockLink; Link = Link->ForwardLink) {
1261 if (BlockArray->Offset == BlockSingleData->Offset) {
1262 if ((BlockArray->Width > BlockSingleData->Width) || (BlockSingleData->IsBitVar && (BlockArray->Width == BlockSingleData->Width))) {
1270 if ((!BlockSingleData->IsBitVar) && (BlockArray->Width == BlockSingleData->Width)) {
1274 if (BlockSingleData != BlockArray) {
1276 *BlockData = BlockArray;
1281 }
else if (BlockArray->Offset > BlockSingleData->Offset) {
1321 CHAR8 TempSupportedLanguages;
1322 CHAR8 *SupportedLanguages;
1324 ASSERT (HiiHandle !=
NULL);
1330 Status = mPrivate.HiiString.GetLanguages (&mPrivate.HiiString, HiiHandle, &TempSupportedLanguages, &LanguageSize);
1338 if (Status != EFI_BUFFER_TOO_SMALL) {
1349 if (SupportedLanguages ==
NULL) {
1359 Status = mPrivate.HiiString.GetLanguages (&mPrivate.HiiString, HiiHandle, SupportedLanguages, &LanguageSize);
1360 if (EFI_ERROR (Status)) {
1371 return SupportedLanguages;
1391 IN EFI_STRING_ID StringId
1398 CHAR8 *SupportedLanguages;
1399 CHAR8 *PlatformLanguage;
1400 CHAR8 *BestLanguage;
1403 ASSERT (HiiHandle !=
NULL);
1404 ASSERT (StringId != 0);
1409 SupportedLanguages =
NULL;
1410 PlatformLanguage =
NULL;
1411 BestLanguage =
NULL;
1419 if (SupportedLanguages ==
NULL) {
1435 PlatformLanguage !=
NULL ? PlatformLanguage :
"",
1439 if (BestLanguage ==
NULL) {
1447 Status = mPrivate.HiiString.GetString (
1448 &mPrivate.HiiString,
1462 if (Status != EFI_BUFFER_TOO_SMALL) {
1470 if (String ==
NULL) {
1477 Status = mPrivate.HiiString.GetString (
1478 &mPrivate.HiiString,
1486 if (EFI_ERROR (Status)) {
1498 if (SupportedLanguages !=
NULL) {
1502 if (PlatformLanguage !=
NULL) {
1506 if (BestLanguage !=
NULL) {
1531 IN UINT16 VarOffset,
1533 IN BOOLEAN IsNameValueType,
1544 if (RequestBlockArray ==
NULL) {
1551 for (Link = RequestBlockArray->Entry.ForwardLink; Link != &RequestBlockArray->Entry; Link = Link->ForwardLink) {
1554 if (IsNameValueType) {
1556 ASSERT (Name !=
NULL);
1565 if ((VarOffset >= BlockData->Offset) && ((VarOffset + VarWidth) <= (BlockData->Offset + BlockData->Width))) {
1585 IN OUT UINT8 **HiiFormPackage,
1593 if ((DataBaseRecord ==
NULL) || (HiiFormPackage ==
NULL) || (PackageSize ==
NULL)) {
1594 return EFI_INVALID_PARAMETER;
1604 DataBaseRecord->Handle,
1605 DataBaseRecord->PackageList,
1611 if (EFI_ERROR (Status)) {
1616 if (*HiiFormPackage ==
NULL) {
1617 Status = EFI_OUT_OF_RESOURCES;
1628 DataBaseRecord->Handle,
1629 DataBaseRecord->PackageList,
1635 if (EFI_ERROR (Status)) {
1639 *PackageSize = Size;
1656 IN EFI_STRING ConfigHdr,
1657 OUT BOOLEAN *IsEfiVarstore,
1663 UINTN PackageOffset;
1665 CHAR16 *VarStoreName;
1671 UINT8 *HiiFormPackage;
1676 HiiFormPackage =
NULL;
1682 *IsEfiVarstore =
FALSE;
1685 if (EFI_ERROR (Status)) {
1690 PackageOffset = IfrOffset;
1693 while (IfrOffset < PackageSize) {
1697 if (PackageOffset >= PackageHeader->Length) {
1702 IfrOffset += PackageOffset;
1707 IfrOffset += IfrOpHdr->Length;
1708 PackageOffset += IfrOpHdr->Length;
1710 if (IfrOpHdr->OpCode == EFI_IFR_VARSTORE_EFI_OP ) {
1721 NameSize =
AsciiStrSize ((CHAR8 *)IfrEfiVarStore->Name);
1723 if (VarStoreName ==
NULL) {
1724 Status = EFI_OUT_OF_RESOURCES;
1731 GenerateSubStr (L
"NAME=",
StrLen (VarStoreName) *
sizeof (CHAR16), (VOID *)VarStoreName, 2, &NameStr);
1732 LengthString =
StrLen (GuidStr);
1733 LengthString = LengthString +
StrLen (NameStr) + 1;
1735 if (TempStr ==
NULL) {
1739 Status = EFI_OUT_OF_RESOURCES;
1743 StrCpyS (TempStr, LengthString, GuidStr);
1744 StrCatS (TempStr, LengthString, NameStr);
1745 if ((ConfigHdr ==
NULL) || (
StrnCmp (ConfigHdr, TempStr,
StrLen (TempStr)) == 0)) {
1747 if (*EfiVarStore ==
NULL) {
1752 Status = EFI_OUT_OF_RESOURCES;
1756 *IsEfiVarstore =
TRUE;
1757 CopyMem (*EfiVarStore, IfrEfiVarStore, IfrOpHdr->Length);
1771 if (*IsEfiVarstore) {
1778 if (HiiFormPackage !=
NULL) {
1798 IN EFI_STRING ConfigRequest
1801 EFI_STRING TmpRequest;
1803 TmpRequest =
StrStr (ConfigRequest, L
"PATH=");
1804 ASSERT (TmpRequest !=
NULL);
1828 IN CHAR16 *ConfigHdr
1844 if ((Name ==
NULL) && (ConfigHdr !=
NULL) && (
StrStr (ConfigHdr, L
"NAME=&") ==
NULL)) {
1855 LengthString =
StrLen (GuidStr);
1856 LengthString = LengthString +
StrLen (NameStr) + 1;
1858 if (TempStr ==
NULL) {
1862 StrCpyS (TempStr, LengthString, GuidStr);
1863 StrCatS (TempStr, LengthString, NameStr);
1865 if ((ConfigHdr ==
NULL) || (
StrnCmp (ConfigHdr, TempStr,
StrLen (TempStr)) == 0)) {
1870 if (GuidStr !=
NULL) {
1874 if (NameStr !=
NULL) {
1878 if (TempStr !=
NULL) {
1897 IN EFI_STRING ConfigHdr
1902 UINTN PackageOffset;
1904 CHAR16 *VarStoreName;
1906 UINT8 *HiiFormPackage;
1912 BOOLEAN FindVarstore;
1914 HiiFormPackage =
NULL;
1915 VarStoreName =
NULL;
1917 FindVarstore =
FALSE;
1920 if (EFI_ERROR (Status)) {
1925 PackageOffset = IfrOffset;
1928 while (IfrOffset < PackageSize) {
1932 if (PackageOffset >= PackageHeader->Length) {
1937 IfrOffset += PackageOffset;
1942 IfrOffset += IfrOpHdr->Length;
1943 PackageOffset += IfrOpHdr->Length;
1945 switch (IfrOpHdr->OpCode) {
1946 case EFI_IFR_VARSTORE_OP:
1951 if (VarStoreName ==
NULL) {
1957 if (
IsThisVarstore ((VOID *)&IfrVarStore->Guid, VarStoreName, ConfigHdr)) {
1958 FindVarstore =
TRUE;
1962 VarStoreName =
NULL;
1967 case EFI_IFR_VARSTORE_EFI_OP:
1969 NameSize =
AsciiStrSize ((CHAR8 *)IfrEfiVarStore->Name);
1971 if (VarStoreName ==
NULL) {
1977 if (
IsThisVarstore (&IfrEfiVarStore->Guid, VarStoreName, ConfigHdr)) {
1978 FindVarstore =
TRUE;
1982 VarStoreName =
NULL;
1987 case EFI_IFR_VARSTORE_NAME_VALUE_OP:
1991 FindVarstore =
TRUE;
1997 case EFI_IFR_FORM_OP:
1998 case EFI_IFR_FORM_MAP_OP:
2010 if (HiiFormPackage !=
NULL) {
2014 if (VarStoreName !=
NULL) {
2018 return FindVarstore;
2050 EFI_STRING_ID NameId;
2062 if (VarStorageData->Type == EFI_HII_VARSTORE_NAME_VALUE) {
2063 NameId = IfrQuestionHdr->VarStoreInfo.VarName;
2072 return EFI_NOT_FOUND;
2079 BitOffset = IfrQuestionHdr->VarStoreInfo.VarOffset;
2080 BitWidth = VarWidth;
2081 VarOffset = BitOffset / 8;
2085 TotalBits = BitOffset % 8 + BitWidth;
2086 VarWidth = (TotalBits % 8 == 0 ? TotalBits / 8 : TotalBits / 8 + 1);
2088 VarOffset = IfrQuestionHdr->VarStoreInfo.VarOffset;
2089 BitWidth = VarWidth;
2090 BitOffset = VarOffset * 8;
2100 return EFI_NOT_FOUND;
2106 if (((VarOffset + VarWidth) > VarStorageData->Size)) {
2107 return EFI_INVALID_PARAMETER;
2112 if (BlockData ==
NULL) {
2113 return EFI_OUT_OF_RESOURCES;
2116 if (VarStorageData->Type == EFI_HII_VARSTORE_NAME_VALUE) {
2119 BlockData->Offset = VarOffset;
2122 BlockData->Width = VarWidth;
2123 BlockData->QuestionId = IfrQuestionHdr->QuestionId;
2124 BlockData->OpCode = IfrOpHdr->OpCode;
2125 BlockData->Scope = IfrOpHdr->Scope;
2126 BlockData->IsBitVar = IsBitVar;
2127 BlockData->BitOffset = BitOffset;
2128 BlockData->BitWidth = BitWidth;
2134 *ReturnData = BlockData;
2162 IN UINT32 PackageLength,
2163 IN EFI_STRING ConfigHdr,
2171 UINTN PackageOffset;
2189 CHAR16 *VarStoreName;
2191 UINTN NvDefaultStoreSize;
2193 UINT16 VarDefaultId;
2194 BOOLEAN FirstOneOfOption;
2195 BOOLEAN FirstOrderedList;
2200 EFI_VARSTORE_ID VarStoreId;
2201 UINT16 SmallestDefaultId;
2202 BOOLEAN SmallestIdFromFlag;
2203 BOOLEAN FromOtherDefaultOpcode;
2204 BOOLEAN QuestionReferBitField;
2208 DefaultDataPtr =
NULL;
2209 FirstOneOfOption =
FALSE;
2211 FirstOrderedList =
FALSE;
2212 VarStoreName =
NULL;
2214 SmallestDefaultId = 0xFFFF;
2215 FromOtherDefaultOpcode =
FALSE;
2216 QuestionReferBitField =
FALSE;
2217 IfrEfiVarStoreTmp =
NULL;
2224 IfrOffset = PackageOffset;
2225 while (IfrOffset < PackageLength) {
2229 if (PackageOffset >= PackageHeader->Length) {
2233 if (VarStoreId != 0) {
2246 switch (IfrOpHdr->OpCode) {
2247 case EFI_IFR_VARSTORE_OP:
2251 if (VarStoreId != 0) {
2259 if (VarStoreName ==
NULL) {
2260 Status = EFI_OUT_OF_RESOURCES;
2266 if (
IsThisVarstore ((VOID *)&IfrVarStore->Guid, VarStoreName, ConfigHdr)) {
2271 VarStorageData->Size = IfrVarStore->Size;
2272 VarStorageData->Name = VarStoreName;
2273 VarStorageData->Type = EFI_HII_VARSTORE_BUFFER;
2274 VarStoreId = IfrVarStore->VarStoreId;
2277 VarStoreName =
NULL;
2282 case EFI_IFR_VARSTORE_EFI_OP:
2286 if (VarStoreId != 0) {
2301 NameSize =
AsciiStrSize ((CHAR8 *)IfrEfiVarStore->Name);
2303 if (VarStoreName ==
NULL) {
2304 Status = EFI_OUT_OF_RESOURCES;
2309 if (IfrEfiVarStoreTmp !=
NULL) {
2314 if (IfrEfiVarStoreTmp ==
NULL) {
2315 Status = EFI_OUT_OF_RESOURCES;
2319 CopyMem (IfrEfiVarStoreTmp, IfrEfiVarStore, IfrEfiVarStore->Header.Length);
2322 if (
IsThisVarstore (&IfrEfiVarStore->Guid, VarStoreName, ConfigHdr)) {
2326 CopyGuid (&VarStorageData->Guid, (
EFI_GUID *)(VOID *)&IfrEfiVarStore->Guid);
2327 VarStorageData->Size = IfrEfiVarStore->Size;
2328 VarStorageData->Name = VarStoreName;
2329 VarStorageData->Type = EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER;
2330 VarStoreId = IfrEfiVarStore->VarStoreId;
2333 VarStoreName =
NULL;
2338 case EFI_IFR_VARSTORE_NAME_VALUE_OP:
2342 if (VarStoreId != 0) {
2352 CopyGuid (&VarStorageData->Guid, (
EFI_GUID *)(VOID *)&IfrNameValueVarStore->Guid);
2353 VarStorageData->Type = EFI_HII_VARSTORE_NAME_VALUE;
2354 VarStoreId = IfrNameValueVarStore->VarStoreId;
2359 case EFI_IFR_DEFAULTSTORE_OP:
2364 if (DefaultDataPtr ==
NULL) {
2365 Status = EFI_OUT_OF_RESOURCES;
2371 DefaultDataPtr =
NULL;
2374 case EFI_IFR_FORM_OP:
2375 case EFI_IFR_FORM_MAP_OP:
2379 if ( VarStoreId == 0) {
2386 case EFI_IFR_REF_OP:
2390 if ( VarStoreId == 0) {
2391 Status = EFI_INVALID_PARAMETER;
2399 if (IfrRef->Question.VarStoreId != VarStoreId) {
2408 if (BlockData !=
NULL) {
2413 if (EFI_ERROR (Status)) {
2414 if (Status == EFI_NOT_FOUND) {
2426 case EFI_IFR_ONE_OF_OP:
2427 case EFI_IFR_NUMERIC_OP:
2435 if (VarStoreId == 0) {
2436 Status = EFI_INVALID_PARAMETER;
2444 if (IfrOneOf->Question.VarStoreId != VarStoreId) {
2448 if (QuestionReferBitField) {
2449 VarWidth = IfrOneOf->Flags & EDKII_IFR_NUMERIC_SIZE_BIT;
2451 VarWidth = (UINT16)(1 << (IfrOneOf->Flags & EFI_IFR_NUMERIC_SIZE));
2457 if (BlockData !=
NULL) {
2461 Status =
IsThisOpcodeRequired (RequestBlockArray, HiiHandle, VarStorageData, IfrOpHdr, VarWidth, &BlockData, QuestionReferBitField);
2462 if (EFI_ERROR (Status)) {
2463 if (Status == EFI_NOT_FOUND) {
2476 ASSERT (BlockData !=
NULL);
2478 if (IfrOpHdr->OpCode == EFI_IFR_ONE_OF_OP) {
2482 FirstOneOfOption =
TRUE;
2483 }
else if (IfrOpHdr->OpCode == EFI_IFR_NUMERIC_OP) {
2487 DefaultData.Type = DefaultValueFromDefault;
2488 if (QuestionReferBitField) {
2492 CopyMem (&DefaultData.Value.u32, &IfrOneOf->data.u32.MinValue, sizeof (UINT32));
2494 switch (IfrOneOf->Flags & EFI_IFR_NUMERIC_SIZE) {
2495 case EFI_IFR_NUMERIC_SIZE_1:
2496 DefaultData.Value.u8 = IfrOneOf->data.u8.MinValue;
2499 case EFI_IFR_NUMERIC_SIZE_2:
2500 CopyMem (&DefaultData.Value.u16, &IfrOneOf->data.u16.MinValue, sizeof (UINT16));
2503 case EFI_IFR_NUMERIC_SIZE_4:
2504 CopyMem (&DefaultData.Value.u32, &IfrOneOf->data.u32.MinValue, sizeof (UINT32));
2507 case EFI_IFR_NUMERIC_SIZE_8:
2508 CopyMem (&DefaultData.Value.u64, &IfrOneOf->data.u64.MinValue, sizeof (UINT64));
2512 Status = EFI_INVALID_PARAMETER;
2520 NvDefaultStoreSize =
PcdGetSize (PcdNvStoreDefaultValueBuffer);
2521 for (LinkData = DefaultIdArray->Entry.ForwardLink; LinkData != &DefaultIdArray->Entry; LinkData = LinkData->ForwardLink) {
2523 DefaultData.DefaultId = DefaultDataPtr->DefaultId;
2525 FindQuestionDefaultSetting (DefaultData.DefaultId, IfrEfiVarStoreTmp, &(IfrOneOf->Question), &DefaultData.Value, VarWidth, QuestionReferBitField);
2534 case EFI_IFR_ORDERED_LIST_OP:
2540 FirstOrderedList =
TRUE;
2544 if (VarStoreId == 0) {
2545 Status = EFI_INVALID_PARAMETER;
2553 if (IfrOrderedList->Question.VarStoreId != VarStoreId) {
2558 VarWidth = IfrOrderedList->MaxContainers;
2563 if (BlockData !=
NULL) {
2568 if (EFI_ERROR (Status)) {
2569 if (Status == EFI_NOT_FOUND) {
2581 case EFI_IFR_CHECKBOX_OP:
2594 if (VarStoreId == 0) {
2595 Status = EFI_INVALID_PARAMETER;
2603 if (IfrCheckBox->Question.VarStoreId != VarStoreId) {
2607 VarWidth = (UINT16)
sizeof (BOOLEAN);
2612 if (BlockData !=
NULL) {
2616 if (QuestionReferBitField) {
2620 Status =
IsThisOpcodeRequired (RequestBlockArray, HiiHandle, VarStorageData, IfrOpHdr, VarWidth, &BlockData, QuestionReferBitField);
2621 if (EFI_ERROR (Status)) {
2622 if (Status == EFI_NOT_FOUND) {
2635 ASSERT (BlockData !=
NULL);
2637 SmallestIdFromFlag =
FALSE;
2642 VarDefaultId = EFI_HII_DEFAULT_CLASS_STANDARD;
2646 DefaultData.DefaultId = VarDefaultId;
2647 if ((IfrCheckBox->Flags & EFI_IFR_CHECKBOX_DEFAULT) == EFI_IFR_CHECKBOX_DEFAULT) {
2651 DefaultData.Type = DefaultValueFromFlag;
2652 if (QuestionReferBitField) {
2653 DefaultData.Value.u32 =
TRUE;
2655 DefaultData.Value.b =
TRUE;
2660 if (SmallestDefaultId > EFI_HII_DEFAULT_CLASS_STANDARD) {
2664 SmallestDefaultId = EFI_HII_DEFAULT_CLASS_STANDARD;
2665 SmallestIdFromFlag =
TRUE;
2672 VarDefaultId = EFI_HII_DEFAULT_CLASS_MANUFACTURING;
2676 DefaultData.DefaultId = VarDefaultId;
2677 if ((IfrCheckBox->Flags & EFI_IFR_CHECKBOX_DEFAULT_MFG) == EFI_IFR_CHECKBOX_DEFAULT_MFG) {
2681 DefaultData.Type = DefaultValueFromFlag;
2682 if (QuestionReferBitField) {
2683 DefaultData.Value.u32 =
TRUE;
2685 DefaultData.Value.b =
TRUE;
2690 if (SmallestDefaultId > EFI_HII_DEFAULT_CLASS_MANUFACTURING) {
2694 SmallestDefaultId = EFI_HII_DEFAULT_CLASS_MANUFACTURING;
2695 SmallestIdFromFlag =
TRUE;
2699 if (SmallestIdFromFlag) {
2703 DefaultData.Type = DefaultValueFromOtherDefault;
2704 if (QuestionReferBitField) {
2705 DefaultData.Value.u32 =
TRUE;
2707 DefaultData.Value.b =
TRUE;
2713 for (LinkData = DefaultIdArray->Entry.ForwardLink; LinkData != &DefaultIdArray->Entry; LinkData = LinkData->ForwardLink) {
2715 DefaultData.DefaultId = DefaultDataPtr->DefaultId;
2722 DefaultData.Type = DefaultValueFromDefault;
2723 if (QuestionReferBitField) {
2724 DefaultData.Value.u32 =
FALSE;
2726 DefaultData.Value.b =
FALSE;
2732 for (LinkData = DefaultIdArray->Entry.ForwardLink; LinkData != &DefaultIdArray->Entry; LinkData = LinkData->ForwardLink) {
2734 DefaultData.DefaultId = DefaultDataPtr->DefaultId;
2741 case EFI_IFR_DATE_OP:
2751 if (VarStoreId == 0) {
2752 Status = EFI_INVALID_PARAMETER;
2760 if (IfrDate->Question.VarStoreId != VarStoreId) {
2767 if (BlockData !=
NULL) {
2773 if (EFI_ERROR (Status)) {
2774 if (Status == EFI_NOT_FOUND) {
2786 case EFI_IFR_TIME_OP:
2796 if (VarStoreId == 0) {
2797 Status = EFI_INVALID_PARAMETER;
2805 if (IfrTime->Question.VarStoreId != VarStoreId) {
2812 if (BlockData !=
NULL) {
2818 if (EFI_ERROR (Status)) {
2819 if (Status == EFI_NOT_FOUND) {
2831 case EFI_IFR_STRING_OP:
2841 if (VarStoreId == 0) {
2842 Status = EFI_INVALID_PARAMETER;
2850 if (IfrString->Question.VarStoreId != VarStoreId) {
2857 if (BlockData !=
NULL) {
2861 VarWidth = (UINT16)(IfrString->MaxSize * sizeof (UINT16));
2863 if (EFI_ERROR (Status)) {
2864 if (Status == EFI_NOT_FOUND) {
2876 case EFI_IFR_PASSWORD_OP:
2886 if (VarStoreId == 0) {
2887 Status = EFI_INVALID_PARAMETER;
2895 if (IfrPassword->Question.VarStoreId != VarStoreId) {
2902 if (BlockData !=
NULL) {
2906 VarWidth = (UINT16)(IfrPassword->MaxSize * sizeof (UINT16));
2908 if (EFI_ERROR (Status)) {
2909 if (Status == EFI_NOT_FOUND) {
2925 case EFI_IFR_ONE_OF_OPTION_OP:
2929 if ((BlockData ==
NULL) || (BlockData->Scope == 0)) {
2934 if (BlockData->OpCode == EFI_IFR_ORDERED_LIST_OP) {
2935 if (!FirstOrderedList) {
2942 if ((IfrOneOfOption->Type == EFI_IFR_TYPE_NUM_SIZE_8) || (IfrOneOfOption->Type == EFI_IFR_TYPE_BOOLEAN)) {
2944 }
else if (IfrOneOfOption->Type == EFI_IFR_TYPE_NUM_SIZE_16) {
2946 }
else if (IfrOneOfOption->Type == EFI_IFR_TYPE_NUM_SIZE_32) {
2948 }
else if (IfrOneOfOption->Type == EFI_IFR_TYPE_NUM_SIZE_64) {
2954 Status = EFI_INVALID_PARAMETER;
2955 if (BlockData->Name !=
NULL) {
2966 BlockData->Width = (UINT16)(BlockData->Width * VarWidth);
2970 if (!
BlockArrayCheck (RequestBlockArray, BlockData->Offset, BlockData->Width, (BOOLEAN)(BlockData->Name !=
NULL), HiiHandle)) {
2974 if (BlockData->Name !=
NULL) {
2986 if ((BlockData->Name ==
NULL) && ((BlockData->Offset + BlockData->Width) > VarStorageData->Size)) {
2987 Status = EFI_INVALID_PARAMETER;
2997 FirstOrderedList =
FALSE;
3006 if (((IfrOneOfOption->Flags & EFI_IFR_OPTION_DEFAULT) == EFI_IFR_OPTION_DEFAULT) ||
3007 ((IfrOneOfOption->Flags & EFI_IFR_OPTION_DEFAULT_MFG) == EFI_IFR_OPTION_DEFAULT_MFG))
3013 FirstOneOfOption =
FALSE;
3015 SmallestIdFromFlag =
FALSE;
3019 DefaultData.Type = DefaultValueFromFlag;
3021 if ((IfrOneOfOption->Flags & EFI_IFR_OPTION_DEFAULT) == EFI_IFR_OPTION_DEFAULT) {
3022 DefaultData.DefaultId = EFI_HII_DEFAULT_CLASS_STANDARD;
3024 if (SmallestDefaultId > EFI_HII_DEFAULT_CLASS_STANDARD) {
3028 SmallestDefaultId = EFI_HII_DEFAULT_CLASS_STANDARD;
3029 SmallestIdFromFlag =
TRUE;
3033 if ((IfrOneOfOption->Flags & EFI_IFR_OPTION_DEFAULT_MFG) == EFI_IFR_OPTION_DEFAULT_MFG) {
3034 DefaultData.DefaultId = EFI_HII_DEFAULT_CLASS_MANUFACTURING;
3036 if (SmallestDefaultId > EFI_HII_DEFAULT_CLASS_MANUFACTURING) {
3040 SmallestDefaultId = EFI_HII_DEFAULT_CLASS_MANUFACTURING;
3041 SmallestIdFromFlag =
TRUE;
3045 if (SmallestIdFromFlag) {
3049 DefaultData.Type = DefaultValueFromOtherDefault;
3053 for (LinkData = DefaultIdArray->Entry.ForwardLink; LinkData != &DefaultIdArray->Entry; LinkData = LinkData->ForwardLink) {
3055 DefaultData.DefaultId = DefaultDataPtr->DefaultId;
3065 if (FirstOneOfOption) {
3067 FirstOneOfOption =
FALSE;
3072 DefaultData.Type = DefaultValueFromDefault;
3074 for (LinkData = DefaultIdArray->Entry.ForwardLink; LinkData != &DefaultIdArray->Entry; LinkData = LinkData->ForwardLink) {
3076 DefaultData.DefaultId = DefaultDataPtr->DefaultId;
3083 case EFI_IFR_DEFAULT_OP:
3087 if ((BlockData ==
NULL) || (BlockData->Scope == 0)) {
3098 VarDefaultId = IfrDefault->DefaultId;
3102 DefaultData.Type = DefaultValueFromOpcode;
3103 DefaultData.DefaultId = VarDefaultId;
3104 if (QuestionReferBitField) {
3105 CopyMem (&DefaultData.Value.u32, &IfrDefault->Value.u32, sizeof (UINT32));
3111 if (IfrDefault->Type == EFI_IFR_TYPE_OTHER) {
3112 DefaultData.Cleaned =
TRUE;
3126 if ((SmallestDefaultId > VarDefaultId) || ((SmallestDefaultId == VarDefaultId) && !FromOtherDefaultOpcode)) {
3127 FromOtherDefaultOpcode =
TRUE;
3128 SmallestDefaultId = VarDefaultId;
3129 for (LinkData = DefaultIdArray->Entry.ForwardLink; LinkData != &DefaultIdArray->Entry; LinkData = LinkData->ForwardLink) {
3131 if (DefaultDataPtr->DefaultId != DefaultData.DefaultId) {
3132 DefaultData.Type = DefaultValueFromOtherDefault;
3133 DefaultData.DefaultId = DefaultDataPtr->DefaultId;
3144 DefaultData.Cleaned =
FALSE;
3147 case EFI_IFR_END_OP:
3151 QuestionReferBitField =
FALSE;
3152 if (BlockData !=
NULL) {
3153 if (BlockData->Scope > 0) {
3157 if (BlockData->Scope == 0) {
3162 SmallestDefaultId = 0xFFFF;
3163 FromOtherDefaultOpcode =
FALSE;
3169 case EFI_IFR_GUID_OP:
3171 QuestionReferBitField =
TRUE;
3177 if (BlockData !=
NULL) {
3178 if (BlockData->Scope > 0) {
3179 BlockData->Scope = (UINT8)(BlockData->Scope + IfrOpHdr->Scope);
3182 if (BlockData->Scope == 0) {
3190 IfrOffset += IfrOpHdr->Length;
3191 PackageOffset += IfrOpHdr->Length;
3198 if (Status == EFI_NOT_FOUND) {
3203 for (LinkData = VarStorageData->BlockEntry.ForwardLink; LinkData != &VarStorageData->BlockEntry; LinkData = LinkData->ForwardLink) {
3205 for (LinkDefault = BlockData->DefaultValueEntry.ForwardLink; LinkDefault != &BlockData->DefaultValueEntry; ) {
3207 LinkDefault = LinkDefault->ForwardLink;
3208 if (DefaultDataPtr->Cleaned ==
TRUE) {
3215 if (IfrEfiVarStoreTmp !=
NULL) {
3232 IN EFI_STRING ConfigRequest,
3233 OUT EFI_STRING *Progress
3236 EFI_STRING StringPtr;
3253 if (RequestBlockArray ==
NULL) {
3269 StringPtr = ConfigRequest;
3270 while (*StringPtr != 0 &&
StrnCmp (StringPtr, L
"&OFFSET=",
StrLen (L
"&OFFSET=")) == 0) {
3274 *Progress = StringPtr;
3275 StringPtr +=
StrLen (L
"&OFFSET=");
3280 if (EFI_ERROR (Status)) {
3288 (((Length + 1) / 2) <
sizeof (UINT16)) ? ((Length + 1) / 2) :
sizeof (UINT16)
3292 StringPtr += Length;
3293 if (
StrnCmp (StringPtr, L
"&WIDTH=",
StrLen (L
"&WIDTH=")) != 0) {
3297 StringPtr +=
StrLen (L
"&WIDTH=");
3303 if (EFI_ERROR (Status)) {
3311 (((Length + 1) / 2) <
sizeof (UINT16)) ? ((Length + 1) / 2) :
sizeof (UINT16)
3315 StringPtr += Length;
3316 if ((*StringPtr != 0) && (*StringPtr != L
'&')) {
3324 if (BlockData ==
NULL) {
3328 BlockData->Offset = Offset;
3329 BlockData->Width = Width;
3335 if (
StrnCmp (StringPtr, L
"&VALUE=",
StrLen (L
"&VALUE=")) == 0) {
3336 StringPtr +=
StrLen (L
"&VALUE=");
3342 if (EFI_ERROR (Status)) {
3347 StringPtr += Length;
3348 if ((*StringPtr != 0) && (*StringPtr != L
'&')) {
3356 if (*StringPtr == 0) {
3364 Link = RequestBlockArray->Entry.ForwardLink;
3365 while ((Link != &RequestBlockArray->Entry) && (Link->ForwardLink != &RequestBlockArray->Entry)) {
3368 if ((NextBlockData->Offset >= BlockData->Offset) && (NextBlockData->Offset <= (BlockData->Offset + BlockData->Width))) {
3369 if ((NextBlockData->Offset + NextBlockData->Width) > (BlockData->Offset + BlockData->Width)) {
3370 BlockData->Width = (UINT16)(NextBlockData->Offset + NextBlockData->Width - BlockData->Offset);
3378 Link = Link->ForwardLink;
3381 return RequestBlockArray;
3384 if (RequestBlockArray !=
NULL) {
3388 while (!
IsListEmpty (&RequestBlockArray->Entry)) {
3410 IN EFI_STRING ConfigRequest,
3411 OUT EFI_STRING *Progress
3414 EFI_STRING StringPtr;
3420 StringPtr = ConfigRequest;
3426 if (RequestBlockArray ==
NULL) {
3441 while (StringPtr !=
NULL && *StringPtr == L
'&') {
3442 *Progress = StringPtr;
3449 if ((NextTag =
StrStr (StringPtr, L
"=")) !=
NULL) {
3452 }
else if ((NextTag =
StrStr (StringPtr, L
"&")) !=
NULL) {
3460 if (BlockData ==
NULL) {
3474 StringPtr = NextTag + 1;
3476 StringPtr =
StrStr (StringPtr, L
"&");
3477 }
else if (NextTag !=
NULL) {
3481 StringPtr = NextTag;
3486 return RequestBlockArray;
3489 if (RequestBlockArray !=
NULL) {
3493 while (!
IsListEmpty (&RequestBlockArray->Entry)) {
3496 if (BlockData->Name !=
NULL) {
3522 IN CHAR16 *ConfigHdr,
3525 IN OUT EFI_STRING *ConfigRequest
3531 CHAR16 *FullConfigRequest;
3550 Length =
StrLen (ConfigHdr) + 1;
3552 for (Link = VarStorageData->BlockEntry.ForwardLink; Link != &VarStorageData->BlockEntry; Link = Link->ForwardLink) {
3555 if (VarStorageData->Type == EFI_HII_VARSTORE_NAME_VALUE) {
3562 Length = Length + (1 +
StrLen (BlockData->Name));
3570 Length = Length + (8 + 4 + 7 + 4);
3586 if (FullConfigRequest ==
NULL) {
3587 *Status = EFI_OUT_OF_RESOURCES;
3591 StringPtr = FullConfigRequest;
3596 StrCpyS (StringPtr, Length, ConfigHdr);
3597 StringPtr +=
StrLen (StringPtr);
3602 for (Link = VarStorageData->BlockEntry.ForwardLink; Link != &VarStorageData->BlockEntry; Link = Link->ForwardLink) {
3604 if (VarStorageData->Type == EFI_HII_VARSTORE_NAME_VALUE) {
3610 (1 +
StrLen (BlockData->Name) + 1) * sizeof (CHAR16),
3620 (8 + 4 + 7 + 4 + 1) *
sizeof (CHAR16),
3621 L
"&OFFSET=%04X&WIDTH=%04X",
3627 StringPtr +=
StrLen (StringPtr);
3635 if (*ConfigRequest !=
NULL) {
3639 *ConfigRequest = FullConfigRequest;
3658 OUT EFI_STRING *ConfigHdr
3676 if (VarStorageData->Name !=
NULL) {
3677 GenerateSubStr (L
"NAME=",
StrLen (VarStorageData->Name) * sizeof (CHAR16), (VOID *)VarStorageData->Name, 2, &NameStr);
3690 if (VarStorageData->Name ==
NULL) {
3695 if (*ConfigHdr ==
NULL) {
3696 Status = EFI_OUT_OF_RESOURCES;
3700 StrCpyS (*ConfigHdr, Length, GuidStr);
3701 StrCatS (*ConfigHdr, Length, NameStr);
3702 if (VarStorageData->Name ==
NULL) {
3703 StrCatS (*ConfigHdr, Length, L
"&");
3706 StrCatS (*ConfigHdr, Length, PathStr);
3711 *(*ConfigHdr +
StrLen (*ConfigHdr) - 1) = L
'\0';
3714 if (GuidStr !=
NULL) {
3718 if (NameStr !=
NULL) {
3722 if (PathStr !=
NULL) {
3765 UINT32 BitFieldDefaultValue;
3767 for ( Link = BlockLink->ForwardLink; Link != BlockLink; Link = Link->ForwardLink) {
3769 if (!BlockData->IsBitVar) {
3773 ListEntry = &BlockData->DefaultValueEntry;
3777 for (LinkDefault = ListEntry->ForwardLink; LinkDefault != ListEntry; LinkDefault = LinkDefault->ForwardLink) {
3783 BitFieldDefaultValue = DefaultValueData->Value.u32;
3785 StartBit = BlockData->BitOffset % 8;
3786 EndBit = StartBit + BlockData->BitWidth - 1;
3791 DefaultValueData->Value.u32 =
BitFieldWrite32 (0, StartBit, EndBit, BitFieldDefaultValue);
3845 UINT32 *FirstDefaultValue;
3846 UINT32 *SecondDefaultValue;
3848 UINT64 ShiftedValue;
3851 FirstListEntry = &FirstBlock->DefaultValueEntry;
3852 for (FirstDefaultLink = FirstListEntry->ForwardLink; FirstDefaultLink != FirstListEntry; FirstDefaultLink = FirstDefaultLink->ForwardLink) {
3854 SecondListEntry = &SecondBlock->DefaultValueEntry;
3855 for (SecondDefaultLink = SecondListEntry->ForwardLink; SecondDefaultLink != SecondListEntry; SecondDefaultLink = SecondDefaultLink->ForwardLink) {
3857 if (FirstDefaultValueData->DefaultId != SecondDefaultValueData->DefaultId) {
3865 FirstDefaultValue = &FirstDefaultValueData->Value.u32;
3866 SecondDefaultValue = &SecondDefaultValueData->Value.u32;
3872 if (FirstBlock->Offset > SecondBlock->Offset) {
3873 OffsetShift = FirstBlock->Offset - SecondBlock->Offset;
3874 ShiftedValue =
LShiftU64 ((UINT64)(*FirstDefaultValue), OffsetShift * 8);
3875 TotalValue = ShiftedValue | (UINT64)(*SecondDefaultValue);
3876 *SecondDefaultValue = (UINT32)
BitFieldRead64 (TotalValue, 0, SecondBlock->Width * 8 -1);
3877 *FirstDefaultValue = (UINT32)
BitFieldRead64 (TotalValue, OffsetShift * 8, OffsetShift * 8 + FirstBlock->Width *8 -1);
3879 OffsetShift = SecondBlock->Offset -FirstBlock->Offset;
3880 ShiftedValue =
LShiftU64 ((UINT64)(*SecondDefaultValue), OffsetShift * 8);
3881 TotalValue = ShiftedValue | (UINT64)(*FirstDefaultValue);
3882 *FirstDefaultValue = (UINT32)
BitFieldRead64 (TotalValue, 0, FirstBlock->Width * 8 -1);
3883 *SecondDefaultValue = (UINT32)
BitFieldRead64 (TotalValue, OffsetShift * 8, OffsetShift * 8 + SecondBlock->Width *8 -1);
3919 for (Link = BlockLink->ForwardLink; Link != BlockLink; Link = Link->ForwardLink) {
3921 if (!BlockData->IsBitVar) {
3925 for (TempLink = Link->ForwardLink; TempLink != BlockLink; TempLink = TempLink->ForwardLink) {
3927 if (!NextBlockData->IsBitVar || (NextBlockData->Offset >= BlockData->Offset + BlockData->Width) || (BlockData->Offset >= NextBlockData->Offset + NextBlockData->Width)) {
3954 IN CHAR16 *ConfigHdr,
3957 IN OUT EFI_STRING *DefaultAltCfgResp
3972 CHAR16 *DefaultString;
3977 DefaultString =
NULL;
3981 Length =
StrLen (ConfigHdr) + 1;
3985 for (Link = DefaultIdArray->Entry.ForwardLink; Link != &DefaultIdArray->Entry; Link = Link->ForwardLink) {
3991 Length += (1 +
StrLen (ConfigHdr) + 8 + 4);
3993 for (LinkData = VarStorageData->BlockEntry.ForwardLink; LinkData != &VarStorageData->BlockEntry; LinkData = LinkData->ForwardLink) {
3995 ListEntry = &BlockData->DefaultValueEntry;
3996 for (LinkDefault = ListEntry->ForwardLink; LinkDefault != ListEntry; LinkDefault = LinkDefault->ForwardLink) {
3998 if (DefaultValueData->DefaultId != DefaultId->DefaultId) {
4002 if (VarStorageData->Type == EFI_HII_VARSTORE_NAME_VALUE) {
4007 Length += (1 +
StrLen (BlockData->Name) + 1 + BlockData->Width * 2);
4013 Length += (8 + 4 + 7 + 4 + 7 + BlockData->Width * 2);
4032 if (*DefaultAltCfgResp ==
NULL) {
4033 return EFI_OUT_OF_RESOURCES;
4036 StringPtr = *DefaultAltCfgResp;
4041 StrCpyS (StringPtr, Length, ConfigHdr);
4042 StringPtr +=
StrLen (StringPtr);
4044 for (Link = DefaultIdArray->Entry.ForwardLink; Link != &DefaultIdArray->Entry; Link = Link->ForwardLink) {
4052 (1 +
StrLen (ConfigHdr) + 8 + 4 + 1) *
sizeof (CHAR16),
4055 DefaultId->DefaultId
4057 StringPtr +=
StrLen (StringPtr);
4059 for (LinkData = VarStorageData->BlockEntry.ForwardLink; LinkData != &VarStorageData->BlockEntry; LinkData = LinkData->ForwardLink) {
4061 ListEntry = &BlockData->DefaultValueEntry;
4062 for (LinkDefault = ListEntry->ForwardLink; LinkDefault != ListEntry; LinkDefault = LinkDefault->ForwardLink) {
4064 if (DefaultValueData->DefaultId != DefaultId->DefaultId) {
4068 if (VarStorageData->Type == EFI_HII_VARSTORE_NAME_VALUE) {
4071 (1 +
StrLen (ConfigHdr) + 1) *
sizeof (CHAR16),
4075 StringPtr +=
StrLen (StringPtr);
4083 (8 + 4 + 7 + 4 + 7 + 1) *
sizeof (CHAR16),
4084 L
"&OFFSET=%04X&WIDTH=%04X&VALUE=",
4088 StringPtr +=
StrLen (StringPtr);
4091 Width = BlockData->Width;
4096 if (BlockData->OpCode == EFI_IFR_STRING_OP) {
4099 ASSERT (TmpBuffer !=
NULL);
4100 if (DefaultString !=
NULL) {
4109 TmpBuffer = (UINT8 *)&(DefaultValueData->Value);
4112 for ( ; Width > 0 && (TmpBuffer !=
NULL); Width--) {
4115 Length *
sizeof (CHAR16) - ((
UINTN)StringPtr - (
UINTN)*DefaultAltCfgResp),
4116 PREFIX_ZERO | RADIX_HEX,
4117 TmpBuffer[Width - 1],
4120 StringPtr +=
StrnLenS (StringPtr, Length - ((
UINTN)StringPtr - (
UINTN)*DefaultAltCfgResp) /
sizeof (CHAR16));
4123 if (DefaultString !=
NULL) {
4125 DefaultString =
NULL;
4128 if ((BlockData->OpCode == EFI_IFR_STRING_OP) && (TmpBuffer !=
NULL)) {
4189 IN OUT EFI_STRING *Request,
4190 IN OUT EFI_STRING *AltCfgResp,
4191 OUT EFI_STRING *PointerProgress OPTIONAL
4195 UINT8 *HiiFormPackage;
4203 EFI_STRING DefaultAltCfgResp;
4204 EFI_STRING ConfigHdr;
4205 EFI_STRING StringPtr;
4206 EFI_STRING Progress;
4208 if ((DataBaseRecord ==
NULL) || (DevicePath ==
NULL) || (Request ==
NULL) || (AltCfgResp ==
NULL)) {
4209 return EFI_INVALID_PARAMETER;
4215 RequestBlockArray =
NULL;
4216 DefaultIdArray =
NULL;
4217 VarStorageData =
NULL;
4218 DefaultAltCfgResp =
NULL;
4220 HiiFormPackage =
NULL;
4222 Progress = *Request;
4225 if (EFI_ERROR (Status)) {
4233 if (*Request !=
NULL) {
4234 StringPtr = *Request;
4238 if (
StrnCmp (StringPtr, L
"GUID=",
StrLen (L
"GUID=")) != 0) {
4239 Status = EFI_INVALID_PARAMETER;
4243 StringPtr +=
StrLen (L
"GUID=");
4244 while (*StringPtr != L
'\0' &&
StrnCmp (StringPtr, L
"&NAME=",
StrLen (L
"&NAME=")) != 0) {
4248 if (*StringPtr == L
'\0') {
4249 Status = EFI_INVALID_PARAMETER;
4253 StringPtr +=
StrLen (L
"&NAME=");
4254 while (*StringPtr != L
'\0' &&
StrnCmp (StringPtr, L
"&PATH=",
StrLen (L
"&PATH=")) != 0) {
4258 if (*StringPtr == L
'\0') {
4259 Status = EFI_INVALID_PARAMETER;
4263 StringPtr +=
StrLen (L
"&PATH=");
4264 while (*StringPtr != L
'\0' && *StringPtr != L
'&') {
4268 if (*StringPtr == L
'\0') {
4279 if (StringPtr !=
NULL) {
4280 if (
StrStr (StringPtr, L
"&OFFSET=") !=
NULL) {
4286 if (RequestBlockArray ==
NULL) {
4287 Status = EFI_INVALID_PARAMETER;
4296 if (DefaultIdArray ==
NULL) {
4297 Status = EFI_OUT_OF_RESOURCES;
4307 if (VarStorageData ==
NULL) {
4308 Status = EFI_OUT_OF_RESOURCES;
4323 DataBaseRecord->Handle,
4325 (UINT32)PackageSize,
4331 if (EFI_ERROR (Status)) {
4338 if ((VarStorageData->Type == 0) && (VarStorageData->Name ==
NULL)) {
4346 Status =
GenerateHdr (VarStorageData, DevicePath, &ConfigHdr);
4347 if (EFI_ERROR (Status)) {
4351 if (RequestBlockArray ==
NULL) {
4362 Status =
GenerateAltConfigResp (DataBaseRecord->Handle, ConfigHdr, VarStorageData, DefaultIdArray, &DefaultAltCfgResp);
4363 if (EFI_ERROR (Status)) {
4370 if ((*AltCfgResp !=
NULL) && (DefaultAltCfgResp !=
NULL)) {
4373 }
else if (*AltCfgResp ==
NULL) {
4374 *AltCfgResp = DefaultAltCfgResp;
4378 if (RequestBlockArray !=
NULL) {
4382 while (!
IsListEmpty (&RequestBlockArray->Entry)) {
4385 if (BlockData->Name !=
NULL) {
4395 if (VarStorageData !=
NULL) {
4399 while (!
IsListEmpty (&VarStorageData->BlockEntry)) {
4402 if (BlockData->Name !=
NULL) {
4409 while (!
IsListEmpty (&BlockData->DefaultValueEntry)) {
4418 if (VarStorageData->Name !=
NULL) {
4420 VarStorageData->Name =
NULL;
4426 if (DefaultIdArray !=
NULL) {
4442 if (ConfigHdr !=
NULL) {
4449 if (HiiFormPackage !=
NULL) {
4453 if (PointerProgress !=
NULL) {
4454 if (*Request ==
NULL) {
4455 *PointerProgress =
NULL;
4456 }
else if (EFI_ERROR (Status)) {
4457 *PointerProgress = *Request;
4459 *PointerProgress = *Request +
StrLen (*Request);
4496 IN EFI_STRING Request,
4497 OUT EFI_STRING *RequestResp,
4498 OUT EFI_STRING *AccessProgress
4502 EFI_STRING VarStoreName;
4510 VarStoreName =
NULL;
4511 *AccessProgress = Request;
4513 NameSize =
AsciiStrSize ((CHAR8 *)EfiVarStoreInfo->Name);
4515 if (VarStoreName ==
NULL) {
4516 Status = EFI_OUT_OF_RESOURCES;
4522 Status =
gRT->GetVariable (VarStoreName, &EfiVarStoreInfo->Guid,
NULL, &BufferSize,
NULL);
4523 if (Status != EFI_BUFFER_TOO_SMALL) {
4528 ASSERT (VarStore !=
NULL);
4529 Status =
gRT->GetVariable (VarStoreName, &EfiVarStoreInfo->Guid,
NULL, &BufferSize, VarStore);
4530 if (EFI_ERROR (Status)) {
4534 Status =
HiiBlockToConfig (This, Request, VarStore, BufferSize, RequestResp, AccessProgress);
4535 if (EFI_ERROR (Status)) {
4540 if (VarStoreName !=
NULL) {
4544 if (VarStore !=
NULL) {
4573 IN EFI_STRING RequestResp,
4574 OUT EFI_STRING *Result
4578 EFI_STRING VarStoreName;
4587 VarStoreName =
NULL;
4588 *Result = RequestResp;
4590 NameSize =
AsciiStrSize ((CHAR8 *)EfiVarStoreInfo->Name);
4592 if (VarStoreName ==
NULL) {
4593 Status = EFI_OUT_OF_RESOURCES;
4599 Status =
gRT->GetVariable (VarStoreName, &EfiVarStoreInfo->Guid,
NULL, &BufferSize,
NULL);
4600 if (Status != EFI_BUFFER_TOO_SMALL) {
4601 DEBUG ((DEBUG_ERROR,
"The variable does not exist!"));
4605 BlockSize = BufferSize;
4607 ASSERT (VarStore !=
NULL);
4608 Status =
gRT->GetVariable (VarStoreName, &EfiVarStoreInfo->Guid,
NULL, &BufferSize, VarStore);
4609 if (EFI_ERROR (Status)) {
4613 Status =
HiiConfigToBlock (This, RequestResp, VarStore, &BlockSize, Result);
4614 if (EFI_ERROR (Status)) {
4618 Status =
gRT->SetVariable (VarStoreName, &EfiVarStoreInfo->Guid, EfiVarStoreInfo->Attributes, BufferSize, VarStore);
4619 if (EFI_ERROR (Status)) {
4620 *Result = RequestResp;
4625 if (VarStoreName !=
NULL) {
4629 if (VarStore !=
NULL) {
4647 CHAR16 *ConfigElements
4653 StringPtr = ConfigElements;
4657 if (
StrnCmp (StringPtr, L
"&OFFSET=",
StrLen (L
"&OFFSET=")) != 0) {
4661 while (*StringPtr != L
'\0' &&
StrnCmp (StringPtr, L
"&WIDTH=",
StrLen (L
"&WIDTH=")) != 0) {
4665 if (*StringPtr == L
'\0') {
4669 StringPtr +=
StrLen (L
"&WIDTH=");
4670 while (*StringPtr != L
'\0' &&
StrnCmp (StringPtr, L
"&OFFSET=",
StrLen (L
"&OFFSET=")) != 0) {
4674 if (*StringPtr == L
'\0') {
4692 CHAR16 *ConfigElements
4698 StringPtr = ConfigElements;
4702 if (*StringPtr != L
'&') {
4708 StringPtr =
StrStr (StringPtr, L
"&");
4710 if (StringPtr ==
NULL) {
4727 CHAR16 *ConfigRequest
4730 BOOLEAN HasNameField;
4733 HasNameField =
TRUE;
4734 StringPtr = ConfigRequest;
4739 if (
StrnCmp (StringPtr, L
"GUID=",
StrLen (L
"GUID=")) != 0) {
4740 return ConfigRequest;
4743 StringPtr +=
StrLen (L
"GUID=");
4744 while (*StringPtr != L
'\0' &&
StrnCmp (StringPtr, L
"&NAME=",
StrLen (L
"&NAME=")) != 0) {
4748 if (*StringPtr == L
'\0') {
4749 return ConfigRequest;
4752 StringPtr +=
StrLen (L
"&NAME=");
4753 if (*StringPtr == L
'&') {
4754 HasNameField =
FALSE;
4757 while (*StringPtr != L
'\0' &&
StrnCmp (StringPtr, L
"&PATH=",
StrLen (L
"&PATH=")) != 0) {
4761 if (*StringPtr == L
'\0') {
4762 return ConfigRequest;
4765 StringPtr +=
StrLen (L
"&PATH=");
4766 while (*StringPtr != L
'\0' && *StringPtr != L
'&') {
4770 if (*StringPtr == L
'\0') {
4833 OUT EFI_STRING *Progress,
4834 OUT EFI_STRING *Results
4838 EFI_STRING StringPtr;
4839 EFI_STRING ConfigRequest;
4846 UINT8 *DevicePathPkg;
4847 UINT8 *CurrentDevicePath;
4851 EFI_STRING AccessProgress;
4852 EFI_STRING AccessResults;
4853 EFI_STRING AccessProgressBackup;
4854 EFI_STRING AccessResultsBackup;
4855 EFI_STRING DefaultResults;
4856 BOOLEAN FirstElement;
4857 BOOLEAN IfrDataParsedFlag;
4858 BOOLEAN IsEfiVarStore;
4860 EFI_STRING ErrorPtr;
4861 UINTN DevicePathSize;
4862 UINTN ConigStringSize;
4863 UINTN ConigStringSizeNewsize;
4864 EFI_STRING ConfigStringPtr;
4866 if ((This ==
NULL) || (Progress ==
NULL) || (Results ==
NULL)) {
4867 return EFI_INVALID_PARAMETER;
4870 if (Request ==
NULL) {
4872 return EFI_INVALID_PARAMETER;
4875 Private = CONFIG_ROUTING_DATABASE_PRIVATE_DATA_FROM_THIS (This);
4876 StringPtr = Request;
4877 *Progress = StringPtr;
4878 DefaultResults =
NULL;
4879 ConfigRequest =
NULL;
4881 AccessResults =
NULL;
4882 AccessProgress =
NULL;
4883 AccessResultsBackup =
NULL;
4884 AccessProgressBackup =
NULL;
4886 IfrDataParsedFlag =
FALSE;
4887 IsEfiVarStore =
FALSE;
4888 EfiVarStoreInfo =
NULL;
4894 if (
StrnCmp (StringPtr, L
"GUID=",
StrLen (L
"GUID=")) != 0) {
4895 return EFI_INVALID_PARAMETER;
4898 FirstElement =
TRUE;
4905 if (*Results ==
NULL) {
4906 return EFI_OUT_OF_RESOURCES;
4909 while (*StringPtr != 0 &&
StrnCmp (StringPtr, L
"GUID=",
StrLen (L
"GUID=")) == 0) {
4914 if (StringPtr == Request) {
4915 *Progress = StringPtr;
4917 *Progress = StringPtr - 1;
4924 ConfigRequest =
AllocateCopyPool ((Length + 1) *
sizeof (CHAR16), StringPtr);
4925 if (ConfigRequest ==
NULL) {
4926 Status = EFI_OUT_OF_RESOURCES;
4930 *(ConfigRequest + Length) = 0;
4935 Status =
GetDevicePath (ConfigRequest, (UINT8 **)&DevicePath);
4936 if (EFI_ERROR (Status)) {
4943 DriverHandle =
NULL;
4946 for (Link = Private->DatabaseList.ForwardLink;
4947 Link != &Private->DatabaseList;
4948 Link = Link->ForwardLink
4952 if ((DevicePathPkg = Database->PackageList->DevicePathPkg) !=
NULL) {
4956 DriverHandle = Database->DriverHandle;
4957 HiiHandle = Database->Handle;
4966 if (DriverHandle ==
NULL) {
4967 TempDevicePath = DevicePath;
4968 Status =
gBS->LocateDevicePath (
4969 &gEfiDevicePathProtocolGuid,
4973 if (EFI_ERROR (Status) || (DriverHandle ==
NULL)) {
4978 *Progress = StringPtr;
4979 Status = EFI_NOT_FOUND;
4988 if (ErrorPtr !=
NULL) {
4989 *Progress =
StrStr (StringPtr, ErrorPtr);
4990 Status = EFI_INVALID_PARAMETER;
4997 IfrDataParsedFlag =
FALSE;
5002 IfrDataParsedFlag =
TRUE;
5004 if (EFI_ERROR (Status)) {
5009 ASSERT (AccessProgress !=
NULL);
5010 *Progress =
StrStr (StringPtr, AccessProgress);
5019 goto NextConfigString;
5026 Status =
GetVarStoreType (Database, ConfigRequest, &IsEfiVarStore, &EfiVarStoreInfo);
5027 if (EFI_ERROR (Status)) {
5031 if (IsEfiVarStore) {
5037 if (EFI_ERROR (Status)) {
5042 *Progress =
StrStr (StringPtr, AccessProgress);
5049 Status =
gBS->HandleProtocol (
5051 &gEfiHiiConfigAccessProtocolGuid,
5052 (VOID **)&ConfigAccess
5054 if (EFI_ERROR (Status)) {
5061 Status = ConfigAccess->ExtractConfig (
5064 &AccessProgressBackup,
5065 &AccessResultsBackup
5067 if (!EFI_ERROR (Status)) {
5071 if ((AccessResultsBackup !=
NULL) && (
StrStr (AccessResultsBackup, L
"&ALTCFG=") !=
NULL)) {
5072 ConigStringSize =
StrSize (AccessResults);
5073 ConfigStringPtr =
StrStr (AccessResultsBackup, L
"&GUID=");
5074 ConigStringSizeNewsize =
StrSize (ConfigStringPtr) + ConigStringSize +
sizeof (CHAR16);
5077 ConigStringSizeNewsize,
5080 StrCatS (AccessResults, ConigStringSizeNewsize /
sizeof (CHAR16), ConfigStringPtr);
5090 if (AccessResultsBackup !=
NULL) {
5092 AccessResultsBackup =
NULL;
5099 Status =
gBS->HandleProtocol (
5101 &gEfiHiiConfigAccessProtocolGuid,
5102 (VOID **)&ConfigAccess
5104 if (EFI_ERROR (Status)) {
5108 Status = ConfigAccess->ExtractConfig (
5116 if (EFI_ERROR (Status)) {
5121 *Progress =
StrStr (StringPtr, AccessProgress);
5129 ASSERT (*AccessProgress == 0);
5134 if (!IfrDataParsedFlag && (HiiHandle !=
NULL)) {
5142 if (DefaultResults !=
NULL) {
5146 DefaultResults =
NULL;
5150 if (!FirstElement) {
5158 FirstElement =
FALSE;
5161 AccessResults =
NULL;
5163 ConfigRequest =
NULL;
5168 StringPtr += Length;
5169 if (*StringPtr == 0) {
5170 *Progress = StringPtr;
5178 if (EFI_ERROR (Status)) {
5183 if (ConfigRequest !=
NULL) {
5187 if (AccessResults !=
NULL) {
5191 if (DefaultResults !=
NULL) {
5195 if (DevicePath !=
NULL) {
5228 OUT EFI_STRING *Results
5233 EFI_STRING AccessResults;
5234 EFI_STRING Progress;
5235 EFI_STRING StringPtr;
5236 EFI_STRING ConfigRequest;
5239 UINTN NumberConfigAccessHandles;
5240 BOOLEAN FirstElement;
5243 EFI_STRING DefaultResults;
5247 UINT8 *DevicePathPkg;
5248 UINT8 *CurrentDevicePath;
5249 BOOLEAN IfrDataParsedFlag;
5251 if ((This ==
NULL) || (Results ==
NULL)) {
5252 return EFI_INVALID_PARAMETER;
5255 Private = CONFIG_ROUTING_DATABASE_PRIVATE_DATA_FROM_THIS (This);
5262 if (*Results ==
NULL) {
5263 return EFI_OUT_OF_RESOURCES;
5266 NumberConfigAccessHandles = 0;
5267 Status =
gBS->LocateHandleBuffer (
5269 &gEfiHiiConfigAccessProtocolGuid,
5271 &NumberConfigAccessHandles,
5272 &ConfigAccessHandles
5274 if (EFI_ERROR (Status)) {
5278 FirstElement =
TRUE;
5280 for (Index = 0; Index < NumberConfigAccessHandles; Index++) {
5281 Status =
gBS->HandleProtocol (
5282 ConfigAccessHandles[Index],
5283 &gEfiHiiConfigAccessProtocolGuid,
5284 (VOID **)&ConfigAccess
5286 if (EFI_ERROR (Status)) {
5293 IfrDataParsedFlag =
FALSE;
5296 DefaultResults =
NULL;
5298 ConfigRequest =
NULL;
5300 if (DevicePath !=
NULL) {
5301 for (Link = Private->DatabaseList.ForwardLink;
5302 Link != &Private->DatabaseList;
5303 Link = Link->ForwardLink
5307 if ((DevicePathPkg = Database->PackageList->DevicePathPkg) !=
NULL) {
5315 HiiHandle = Database->Handle;
5322 Status = ConfigAccess->ExtractConfig (
5328 if (EFI_ERROR (Status)) {
5332 if ((HiiHandle !=
NULL) && (DevicePath !=
NULL)) {
5333 IfrDataParsedFlag =
TRUE;
5338 if (!EFI_ERROR (Status) && (ConfigRequest !=
NULL)) {
5339 Status = ConfigAccess->ExtractConfig (
5347 Status = EFI_NOT_FOUND;
5352 if (!EFI_ERROR (Status)) {
5356 if (!IfrDataParsedFlag && (HiiHandle !=
NULL) && (DevicePath !=
NULL)) {
5357 StringPtr =
StrStr (AccessResults, L
"&GUID=");
5358 if (StringPtr !=
NULL) {
5367 if (StringPtr !=
NULL) {
5375 if (DefaultResults !=
NULL) {
5379 DefaultResults =
NULL;
5386 if (!FirstElement) {
5394 FirstElement =
FALSE;
5397 AccessResults =
NULL;
5435 IN CONST EFI_STRING Configuration,
5436 OUT EFI_STRING *Progress
5440 EFI_STRING StringPtr;
5441 EFI_STRING ConfigResp;
5448 UINT8 *DevicePathPkg;
5449 UINT8 *CurrentDevicePath;
5452 EFI_STRING AccessProgress;
5454 BOOLEAN IsEfiVarstore;
5455 UINTN DevicePathSize;
5457 if ((This ==
NULL) || (Progress ==
NULL)) {
5458 return EFI_INVALID_PARAMETER;
5461 if (Configuration ==
NULL) {
5463 return EFI_INVALID_PARAMETER;
5466 Private = CONFIG_ROUTING_DATABASE_PRIVATE_DATA_FROM_THIS (This);
5467 StringPtr = Configuration;
5468 *Progress = StringPtr;
5470 AccessProgress =
NULL;
5471 EfiVarStoreInfo =
NULL;
5472 IsEfiVarstore =
FALSE;
5478 if (
StrnCmp (StringPtr, L
"GUID=",
StrLen (L
"GUID=")) != 0) {
5479 return EFI_INVALID_PARAMETER;
5482 while (*StringPtr != 0 &&
StrnCmp (StringPtr, L
"GUID=",
StrLen (L
"GUID=")) == 0) {
5487 if (StringPtr == Configuration) {
5488 *Progress = StringPtr;
5490 *Progress = StringPtr - 1;
5498 if (ConfigResp ==
NULL) {
5499 return EFI_OUT_OF_RESOURCES;
5505 *(ConfigResp + Length) = 0;
5511 if (EFI_ERROR (Status)) {
5519 DriverHandle =
NULL;
5520 for (Link = Private->DatabaseList.ForwardLink;
5521 Link != &Private->DatabaseList;
5522 Link = Link->ForwardLink
5527 if ((DevicePathPkg = Database->PackageList->DevicePathPkg) !=
NULL) {
5531 DriverHandle = Database->DriverHandle;
5540 if (DriverHandle ==
NULL) {
5541 TempDevicePath = DevicePath;
5542 Status =
gBS->LocateDevicePath (
5543 &gEfiDevicePathProtocolGuid,
5547 if (EFI_ERROR (Status) || (DriverHandle ==
NULL)) {
5553 *Progress = StringPtr;
5555 return EFI_NOT_FOUND;
5564 Status =
GetVarStoreType (Database, ConfigResp, &IsEfiVarstore, &EfiVarStoreInfo);
5565 if (EFI_ERROR (Status)) {
5569 if (IsEfiVarstore) {
5579 Status =
gBS->HandleProtocol (
5581 &gEfiHiiConfigAccessProtocolGuid,
5582 (VOID **)&ConfigAccess
5584 if (EFI_ERROR (Status)) {
5585 *Progress = StringPtr;
5587 return EFI_NOT_FOUND;
5590 Status = ConfigAccess->RouteConfig (
5597 if (EFI_ERROR (Status)) {
5598 ASSERT (AccessProgress !=
NULL);
5603 *Progress =
StrStr (StringPtr, AccessProgress);
5615 StringPtr += Length;
5616 if (*StringPtr == 0) {
5617 *Progress = StringPtr;
5666 IN CONST EFI_STRING ConfigRequest,
5669 OUT EFI_STRING *Config,
5670 OUT EFI_STRING *Progress
5674 EFI_STRING StringPtr;
5682 EFI_STRING ValueStr;
5683 EFI_STRING ConfigElement;
5690 if ((This ==
NULL) || (Progress ==
NULL) || (Config ==
NULL)) {
5691 return EFI_INVALID_PARAMETER;
5694 if ((Block ==
NULL) || (ConfigRequest ==
NULL)) {
5695 *Progress = ConfigRequest;
5696 return EFI_INVALID_PARAMETER;
5699 Private = CONFIG_ROUTING_DATABASE_PRIVATE_DATA_FROM_THIS (This);
5700 ASSERT (Private !=
NULL);
5702 StringPtr = ConfigRequest;
5705 ConfigElement =
NULL;
5712 if (*Config ==
NULL) {
5713 return EFI_OUT_OF_RESOURCES;
5719 if (
StrnCmp (StringPtr, L
"GUID=",
StrLen (L
"GUID=")) != 0) {
5720 *Progress = StringPtr;
5721 Status = EFI_INVALID_PARAMETER;
5725 while (*StringPtr != 0 &&
StrnCmp (StringPtr, L
"PATH=",
StrLen (L
"PATH=")) != 0) {
5729 if (*StringPtr == 0) {
5730 *Progress = StringPtr - 1;
5731 Status = EFI_INVALID_PARAMETER;
5735 while (*StringPtr != L
'&' && *StringPtr != 0) {
5739 if (*StringPtr == 0) {
5740 *Progress = StringPtr;
5756 TemString =
AllocateCopyPool (
sizeof (CHAR16) * (StringPtr - ConfigRequest + 1), ConfigRequest);
5757 if (TemString ==
NULL) {
5758 return EFI_OUT_OF_RESOURCES;
5761 TemString[StringPtr - ConfigRequest] =
'\0';
5770 while (*StringPtr != 0 &&
StrnCmp (StringPtr, L
"OFFSET=",
StrLen (L
"OFFSET=")) == 0) {
5776 StringPtr +=
StrLen (L
"OFFSET=");
5781 if (EFI_ERROR (Status)) {
5782 *Progress = TmpPtr - 1;
5790 (((Length + 1) / 2) <
sizeof (
UINTN)) ? ((Length + 1) / 2) :
sizeof (
UINTN)
5794 StringPtr += Length;
5795 if (
StrnCmp (StringPtr, L
"&WIDTH=",
StrLen (L
"&WIDTH=")) != 0) {
5796 *Progress = TmpPtr - 1;
5797 Status = EFI_INVALID_PARAMETER;
5801 StringPtr +=
StrLen (L
"&WIDTH=");
5807 if (EFI_ERROR (Status)) {
5808 *Progress = TmpPtr - 1;
5816 (((Length + 1) / 2) <
sizeof (
UINTN)) ? ((Length + 1) / 2) :
sizeof (
UINTN)
5820 StringPtr += Length;
5821 if ((*StringPtr != 0) && (*StringPtr != L
'&')) {
5822 *Progress = TmpPtr - 1;
5823 Status = EFI_INVALID_PARAMETER;
5830 if (Offset + Width > BlockSize) {
5831 *Progress = StringPtr;
5832 Status = EFI_DEVICE_ERROR;
5837 if (Value ==
NULL) {
5838 *Progress = ConfigRequest;
5839 Status = EFI_OUT_OF_RESOURCES;
5843 CopyMem (Value, (UINT8 *)Block + Offset, Width);
5845 Length = Width * 2 + 1;
5847 if (ValueStr ==
NULL) {
5848 *Progress = ConfigRequest;
5849 Status = EFI_OUT_OF_RESOURCES;
5853 TemString = ValueStr;
5854 TemBuffer = Value + Width - 1;
5855 for (Index = 0; Index < Width; Index++, TemBuffer--) {
5858 Length *
sizeof (CHAR16) - ((
UINTN)TemString - (
UINTN)ValueStr),
5859 PREFIX_ZERO | RADIX_HEX,
5863 TemString +=
StrnLenS (TemString, Length - ((
UINTN)TemString - (
UINTN)ValueStr) /
sizeof (CHAR16));
5872 Length += StringPtr - TmpPtr + 1 +
StrLen (L
"VALUE=");
5874 if (ConfigElement ==
NULL) {
5875 Status = EFI_OUT_OF_RESOURCES;
5879 CopyMem (ConfigElement, TmpPtr, (StringPtr - TmpPtr + 1) *
sizeof (CHAR16));
5880 if (*StringPtr == 0) {
5881 *(ConfigElement + (StringPtr - TmpPtr)) = L
'&';
5884 *(ConfigElement + (StringPtr - TmpPtr) + 1) = 0;
5885 StrCatS (ConfigElement, Length, L
"VALUE=");
5886 StrCatS (ConfigElement, Length, ValueStr);
5892 ConfigElement =
NULL;
5898 if (*StringPtr == 0) {
5906 if (*StringPtr != 0) {
5907 *Progress = StringPtr - 1;
5908 Status = EFI_INVALID_PARAMETER;
5913 *Progress = StringPtr;
5917 if (*Config !=
NULL) {
5922 if (ValueStr !=
NULL) {
5926 if (Value !=
NULL) {
5930 if (ConfigElement !=
NULL) {
5988 IN CONST EFI_STRING ConfigResp,
5989 IN OUT UINT8 *Block,
5991 OUT EFI_STRING *Progress
5995 EFI_STRING StringPtr;
6008 if ((This ==
NULL) || (BlockSize ==
NULL) || (Progress ==
NULL)) {
6009 return EFI_INVALID_PARAMETER;
6012 *Progress = ConfigResp;
6013 if (ConfigResp ==
NULL) {
6014 return EFI_INVALID_PARAMETER;
6017 Private = CONFIG_ROUTING_DATABASE_PRIVATE_DATA_FROM_THIS (This);
6018 ASSERT (Private !=
NULL);
6020 StringPtr = ConfigResp;
6021 BufferSize = *BlockSize;
6028 if (
StrnCmp (StringPtr, L
"GUID=",
StrLen (L
"GUID=")) != 0) {
6029 *Progress = StringPtr;
6030 Status = EFI_INVALID_PARAMETER;
6034 while (*StringPtr != 0 &&
StrnCmp (StringPtr, L
"PATH=",
StrLen (L
"PATH=")) != 0) {
6038 if (*StringPtr == 0) {
6039 *Progress = StringPtr;
6040 Status = EFI_INVALID_PARAMETER;
6044 while (*StringPtr != L
'&' && *StringPtr != 0) {
6048 if (*StringPtr == 0) {
6049 *Progress = StringPtr;
6050 Status = EFI_INVALID_PARAMETER;
6059 while (*StringPtr != 0 &&
StrnCmp (StringPtr, L
"&OFFSET=",
StrLen (L
"&OFFSET=")) == 0) {
6061 StringPtr +=
StrLen (L
"&OFFSET=");
6066 if (EFI_ERROR (Status)) {
6075 (((Length + 1) / 2) <
sizeof (
UINTN)) ? ((Length + 1) / 2) :
sizeof (
UINTN)
6079 StringPtr += Length;
6080 if (
StrnCmp (StringPtr, L
"&WIDTH=",
StrLen (L
"&WIDTH=")) != 0) {
6082 Status = EFI_INVALID_PARAMETER;
6086 StringPtr +=
StrLen (L
"&WIDTH=");
6092 if (EFI_ERROR (Status)) {
6101 (((Length + 1) / 2) <
sizeof (
UINTN)) ? ((Length + 1) / 2) :
sizeof (
UINTN)
6105 StringPtr += Length;
6106 if (
StrnCmp (StringPtr, L
"&VALUE=",
StrLen (L
"&VALUE=")) != 0) {
6108 Status = EFI_INVALID_PARAMETER;
6112 StringPtr +=
StrLen (L
"&VALUE=");
6118 if (EFI_ERROR (Status)) {
6123 StringPtr += Length;
6124 if ((*StringPtr != 0) && (*StringPtr != L
'&')) {
6126 Status = EFI_INVALID_PARAMETER;
6133 if ((Block !=
NULL) && (Offset + Width <= BufferSize)) {
6134 CopyMem (Block + Offset, Value, Width);
6137 if (Offset + Width > MaxBlockSize) {
6138 MaxBlockSize = Offset + Width;
6147 if (*StringPtr == 0) {
6155 if (*StringPtr != 0) {
6156 *Progress = StringPtr;
6157 Status = EFI_INVALID_PARAMETER;
6161 *Progress = StringPtr +
StrLen (StringPtr);
6162 *BlockSize = MaxBlockSize - 1;
6164 if (MaxBlockSize > BufferSize) {
6165 *BlockSize = MaxBlockSize;
6166 if (Block !=
NULL) {
6167 return EFI_BUFFER_TOO_SMALL;
6171 if (Block ==
NULL) {
6172 *Progress = ConfigResp;
6173 return EFI_INVALID_PARAMETER;
6180 if (Value !=
NULL) {
6231 IN CONST EFI_STRING Configuration,
6236 OUT EFI_STRING *AltCfgResp
6240 EFI_STRING StringPtr;
6241 EFI_STRING HdrStart;
6248 EFI_STRING AltIdStr;
6265 if ((This ==
NULL) || (Configuration ==
NULL) || (AltCfgResp ==
NULL)) {
6266 return EFI_INVALID_PARAMETER;
6269 StringPtr = Configuration;
6270 if (
StrnCmp (StringPtr, L
"GUID=",
StrLen (L
"GUID=")) != 0) {
6271 return EFI_INVALID_PARAMETER;
6285 if (AltCfgId !=
NULL) {
6286 GenerateSubStr (L
"ALTCFG=",
sizeof (UINT16), (VOID *)AltCfgId, 3, &AltIdStr);
6295 while (*StringPtr != 0) {
6300 TmpPtr =
StrStr (StringPtr, GuidStr);
6301 if (TmpPtr ==
NULL) {
6302 Status = EFI_NOT_FOUND;
6312 StringPtr = TmpPtr +
StrLen (GuidStr);
6314 StringPtr =
StrStr (TmpPtr, L
"NAME=");
6315 if (StringPtr ==
NULL) {
6316 Status = EFI_NOT_FOUND;
6327 if (GuidFlag && !NameFlag) {
6335 StringPtr +=
StrLen (NameStr);
6337 StringPtr =
StrStr (StringPtr, L
"PATH=");
6338 if (StringPtr ==
NULL) {
6339 Status = EFI_NOT_FOUND;
6351 if (GuidFlag && NameFlag && !PathFlag) {
6359 if (DevicePath !=
NULL) {
6360 StringPtr +=
StrLen (PathStr);
6362 StringPtr =
StrStr (StringPtr, L
"&");
6363 if (StringPtr ==
NULL) {
6364 Status = EFI_NOT_FOUND;
6379 if (GuidFlag && NameFlag && PathFlag) {
6380 if (AltCfgId ==
NULL) {
6391 if (
StrnCmp (StringPtr, AltIdStr,
StrLen (AltIdStr)) != 0) {
6399 StringPtr = StringPtr +
StrLen (AltIdStr);
6406 Status = EFI_NOT_FOUND;
6410 if (!EFI_ERROR (Status) && (Result !=
NULL)) {
6414 Length = HdrEnd - HdrStart +
StrLen (Result) + 1;
6416 if (*AltCfgResp ==
NULL) {
6417 Status = EFI_OUT_OF_RESOURCES;
6419 StrnCpyS (*AltCfgResp, Length, HdrStart, HdrEnd - HdrStart);
6420 StrCatS (*AltCfgResp, Length, Result);
6425 if (GuidStr !=
NULL) {
6429 if (NameStr !=
NULL) {
6433 if (PathStr !=
NULL) {
6437 if (AltIdStr !=
NULL) {
6441 if (Result !=
NULL) {
UINT64 EFIAPI StrHexToUint64(IN CONST CHAR16 *String)
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)
UINT32 EFIAPI BitFieldWrite32(IN UINT32 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT32 Value)
RETURN_STATUS EFIAPI StrCatS(IN OUT CHAR16 *Destination, IN UINTN DestMax, IN CONST CHAR16 *Source)
UINTN EFIAPI StrnLenS(IN CONST CHAR16 *String, IN UINTN MaxSize)
INTN EFIAPI StrnCmp(IN CONST CHAR16 *FirstString, IN CONST CHAR16 *SecondString, IN UINTN Length)
LIST_ENTRY *EFIAPI RemoveEntryList(IN CONST LIST_ENTRY *Entry)
LIST_ENTRY *EFIAPI InitializeListHead(IN OUT LIST_ENTRY *ListHead)
RETURN_STATUS EFIAPI StrnCatS(IN OUT CHAR16 *Destination, IN UINTN DestMax, IN CONST CHAR16 *Source, IN UINTN Length)
UINT64 EFIAPI BitFieldRead64(IN UINT64 Operand, IN UINTN StartBit, IN UINTN EndBit)
UINT64 EFIAPI LShiftU64(IN UINT64 Operand, IN UINTN Count)
RETURN_STATUS EFIAPI AsciiStrToUnicodeStrS(IN CONST CHAR8 *Source, OUT CHAR16 *Destination, IN UINTN DestMax)
UINTN EFIAPI AsciiStrSize(IN CONST CHAR8 *String)
RETURN_STATUS EFIAPI StrnCpyS(OUT CHAR16 *Destination, IN UINTN DestMax, IN CONST CHAR16 *Source, IN UINTN Length)
UINTN EFIAPI StrLen(IN CONST CHAR16 *String)
CHAR16 *EFIAPI StrStr(IN CONST CHAR16 *String, IN CONST CHAR16 *SearchString)
LIST_ENTRY *EFIAPI InsertTailList(IN OUT LIST_ENTRY *ListHead, IN OUT LIST_ENTRY *Entry)
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)
GUID *EFIAPI CopyGuid(OUT GUID *DestinationGuid, IN CONST GUID *SourceGuid)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
EFI_STATUS RouteConfigRespForEfiVarStore(IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, IN EFI_IFR_VARSTORE_EFI *EfiVarStoreInfo, IN EFI_STRING RequestResp, OUT EFI_STRING *Result)
VOID UpdateDefaultValue(IN LIST_ENTRY *BlockLink)
EFI_STRING InternalGetString(IN EFI_HII_HANDLE HiiHandle, IN EFI_STRING_ID StringId)
CHAR8 * GetSupportedLanguages(IN EFI_HII_HANDLE HiiHandle)
IFR_BLOCK_DATA * GetNameElement(IN EFI_STRING ConfigRequest, OUT EFI_STRING *Progress)
EFI_STATUS EFIAPI HiiConfigRoutingExportConfig(IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, OUT EFI_STRING *Results)
EFI_STATUS CompareBlockElementDefault(IN EFI_STRING DefaultAltCfgResp, IN OUT EFI_STRING *ConfigAltResp, IN EFI_STRING AltConfigHdr, IN OUT BOOLEAN *ConfigAltRespChanged)
EFI_STATUS FindSameBlockElement(IN EFI_STRING String, IN EFI_STRING BlockName, IN UINT8 *Buffer, OUT BOOLEAN *Found, IN UINTN BufferLen)
BOOLEAN GenerateConfigRequest(IN CHAR16 *ConfigHdr, IN IFR_VARSTORAGE_DATA *VarStorageData, OUT EFI_STATUS *Status, IN OUT EFI_STRING *ConfigRequest)
IFR_BLOCK_DATA * GetBlockElement(IN EFI_STRING ConfigRequest, OUT EFI_STRING *Progress)
EFI_STATUS AppendToMultiString(IN OUT EFI_STRING *MultiString, IN EFI_STRING AppendString)
BOOLEAN IsThisVarstore(IN EFI_GUID *VarstoreGuid, IN CHAR16 *Name, IN CHAR16 *ConfigHdr)
EFI_STATUS EFIAPI HiiGetAltCfg(IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, IN CONST EFI_STRING Configuration, IN CONST EFI_GUID *Guid, IN CONST EFI_STRING Name, IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN CONST UINT16 *AltCfgId, OUT EFI_STRING *AltCfgResp)
EFI_STATUS CompareNameElementDefault(IN EFI_STRING DefaultAltCfgResp, IN OUT EFI_STRING *ConfigAltResp, IN EFI_STRING AltConfigHdr, IN OUT BOOLEAN *ConfigAltRespChanged)
CHAR16 * OffsetWidthValidate(CHAR16 *ConfigElements)
EFI_STATUS IsThisOpcodeRequired(IN IFR_BLOCK_DATA *RequestBlockArray, IN EFI_HII_HANDLE HiiHandle, IN OUT IFR_VARSTORAGE_DATA *VarStorageData, IN EFI_IFR_OP_HEADER *IfrOpHdr, IN UINT16 VarWidth, OUT IFR_BLOCK_DATA **ReturnData, IN BOOLEAN IsBitVar)
EFI_STATUS EFIAPI ParseIfrData(IN EFI_HII_HANDLE HiiHandle, IN UINT8 *Package, IN UINT32 PackageLength, IN EFI_STRING ConfigHdr, IN IFR_BLOCK_DATA *RequestBlockArray, IN OUT IFR_VARSTORAGE_DATA *VarStorageData, OUT IFR_DEFAULT_DATA *DefaultIdArray)
BOOLEAN IsThisPackageList(IN HII_DATABASE_RECORD *DataBaseRecord, IN EFI_STRING ConfigHdr)
VOID GenerateSubStr(IN CONST EFI_STRING String, IN UINTN BufferLen, IN VOID *Buffer, IN UINT8 Flag, OUT EFI_STRING *SubStr)
EFI_STATUS EFIAPI HiiConfigRoutingRouteConfig(IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, IN CONST EFI_STRING Configuration, OUT EFI_STRING *Progress)
EFI_STATUS GetVarStoreType(IN HII_DATABASE_RECORD *DataBaseRecord, IN EFI_STRING ConfigHdr, OUT BOOLEAN *IsEfiVarstore, OUT EFI_IFR_VARSTORE_EFI **EfiVarStore)
VOID InsertBlockData(IN LIST_ENTRY *BlockLink, IN IFR_BLOCK_DATA **BlockData)
CHAR16 * NameValueValidate(CHAR16 *ConfigElements)
VOID UpdateBlockDataArray(IN LIST_ENTRY *BlockLink)
VOID EFIAPI HiiToLower(IN EFI_STRING ConfigString)
EFI_STATUS GenerateHdr(IN IFR_VARSTORAGE_DATA *VarStorageData, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, OUT EFI_STRING *ConfigHdr)
EFI_STATUS EFIAPI HiiConfigRoutingExtractConfig(IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, IN CONST EFI_STRING Request, OUT EFI_STRING *Progress, OUT EFI_STRING *Results)
EFI_STATUS GetConfigRespFromEfiVarStore(IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, IN EFI_IFR_VARSTORE_EFI *EfiVarStoreInfo, IN EFI_STRING Request, OUT EFI_STRING *RequestResp, OUT EFI_STRING *AccessProgress)
EFI_STATUS EFIAPI GetFullStringFromHiiFormPackages(IN HII_DATABASE_RECORD *DataBaseRecord, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN OUT EFI_STRING *Request, IN OUT EFI_STRING *AltCfgResp, OUT EFI_STRING *PointerProgress OPTIONAL)
EFI_STATUS EFIAPI HiiBlockToConfig(IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, IN CONST EFI_STRING ConfigRequest, IN CONST UINT8 *Block, IN CONST UINTN BlockSize, OUT EFI_STRING *Config, OUT EFI_STRING *Progress)
EFI_STATUS OutputConfigBody(IN EFI_STRING String, OUT EFI_STRING *ConfigBody)
EFI_STATUS CompareAndMergeDefaultString(IN OUT EFI_STRING *AltCfgResp, IN EFI_STRING DefaultAltCfgResp, IN EFI_STRING AltConfigHdr)
EFI_STATUS GetDevicePath(IN EFI_STRING String, OUT UINT8 **DevicePathData)
EFI_STATUS GetValueOfNumber(IN EFI_STRING StringPtr, OUT UINT8 **Number, OUT UINTN *Len)
BOOLEAN BlockArrayCheck(IN IFR_BLOCK_DATA *RequestBlockArray, IN UINT16 VarOffset, IN UINT16 VarWidth, IN BOOLEAN IsNameValueType, IN EFI_HII_HANDLE HiiHandle)
EFI_STATUS GenerateAltConfigResp(IN EFI_HII_HANDLE HiiHandle, IN CHAR16 *ConfigHdr, IN IFR_VARSTORAGE_DATA *VarStorageData, IN IFR_DEFAULT_DATA *DefaultIdArray, IN OUT EFI_STRING *DefaultAltCfgResp)
BOOLEAN GetElementsFromRequest(IN EFI_STRING ConfigRequest)
EFI_STATUS GetFormPackageData(IN HII_DATABASE_RECORD *DataBaseRecord, IN OUT UINT8 **HiiFormPackage, OUT UINTN *PackageSize)
CHAR16 * ConfigRequestValidate(CHAR16 *ConfigRequest)
VOID InsertDefaultValue(IN IFR_BLOCK_DATA *BlockData, IN IFR_DEFAULT_DATA *DefaultValueData)
UINTN CalculateConfigStringLen(IN EFI_STRING String)
EFI_STATUS EFIAPI HiiConfigToBlock(IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, IN CONST EFI_STRING ConfigResp, IN OUT UINT8 *Block, IN OUT UINTN *BlockSize, OUT EFI_STRING *Progress)
EFI_STATUS EFIAPI MergeDefaultString(IN OUT EFI_STRING *AltCfgResp, IN EFI_STRING DefaultAltCfgResp)
VOID MergeBlockDefaultValue(IN OUT IFR_BLOCK_DATA *FirstBlock, IN OUT IFR_BLOCK_DATA *SecondBlock)
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 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)
UINTN EFIAPI DevicePathNodeLength(IN CONST VOID *Node)
BOOLEAN EFIAPI IsDevicePathEnd(IN CONST VOID *Node)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI NextDevicePathNode(IN CONST VOID *Node)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI DevicePathFromHandle(IN EFI_HANDLE Handle)
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 AllocateCopyPool(IN UINTN AllocationSize, IN CONST VOID *Buffer)
RETURN_STATUS EFIAPI UnicodeValueToStringS(IN OUT CHAR16 *Buffer, IN UINTN BufferSize, IN UINTN Flags, IN INT64 Value, IN UINTN Width)
UINTN EFIAPI UnicodeSPrint(OUT CHAR16 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR16 *FormatString,...)
EFI_RUNTIME_SERVICES * gRT
#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)
#define PcdGetSize(TokenName)
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
VOID EFIAPI Exit(IN EFI_STATUS Status)
EFI_STATUS EFIAPI GetEfiGlobalVariable2(IN CONST CHAR16 *Name, OUT VOID **Value, OUT UINTN *Size OPTIONAL)
CHAR8 *EFIAPI GetBestLanguage(IN CONST CHAR8 *SupportedLanguages, IN UINTN Iso639Language,...)
EFI_STRING_ID string
EFI_IFR_TYPE_STRING, EFI_IFR_TYPE_ACTION.