Update HiiDataBase to fix parsing Hii package error. Some HiiPackages have no varstore and question, they has no the built in default value.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8314 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
lgao4 2009-05-14 12:37:02 +00:00
parent 84f9a9ec8f
commit 76c2425177
4 changed files with 54 additions and 26 deletions

View File

@ -286,18 +286,17 @@ HiiConstructConfigHdr (
);
/**
It has the many same logic to HiiValidateSetting API.
Reset the default value specified by DefaultId to the driver
configuration got by Request string.
NULL request string support depends on the ExtractConfig interface of
NULL request string support depends on the ExportConfig interface of
HiiConfigRouting protocol in UEFI specification.
@param EFI_STRING Request A null-terminated Unicode string in
<MultiConfigRequest> format. It can be NULL.
If it is NULL, all configuration for the
entirety of the current HII database will be reset.
@param UINT16 DefaultId Specifies the type of defaults to retrieve.
@param Request A null-terminated Unicode string in
<MultiConfigRequest> format. It can be NULL.
If it is NULL, all configuration for the
entirety of the current HII database will be reset.
@param DefaultId Specifies the type of defaults to retrieve.
@retval TURE The default value is set successfully.
@retval FALSE The default value can't be found and set.
@ -311,15 +310,14 @@ HiiSetToDefaults (
/**
Validate the current configuration by parsing HII form IFR opcode.
It can share the most logic with HiiSetToDefaults.
NULL request string support depends on the ExtractConfig interface of
HiiConfigRouting protocol in UEFI specification.
@param EFI_STRING Request A null-terminated Unicode string in
<MultiConfigRequest> format. It can be NULL.
If it is NULL, all current configuration for the
entirety of the current HII database will be validated.
@param Request A null-terminated Unicode string in
<MultiConfigRequest> format. It can be NULL.
If it is NULL, all current configuration for the
entirety of the current HII database will be validated.
@retval TURE Current configuration is valid.
@retval FALSE Current configuration is invalid.

View File

@ -1177,6 +1177,11 @@ InternalHiiValidateCurrentSetting (
}
Link = Link->ForwardLink;
}
if (IsListEmpty (&CurrentBlockArray->Entry)) {
Status = EFI_SUCCESS;
goto Done;
}
//
// 2. Check IFR value is in block data, then Validate Vaule
@ -1233,7 +1238,7 @@ InternalHiiValidateCurrentSetting (
// Check the matched VarStoreId is found.
//
if (IfrVarStore == NULL) {
Status = EFI_NOT_FOUND;
Status = EFI_SUCCESS;
goto Done;
}
break;
@ -1580,7 +1585,7 @@ BOOLEAN
EFIAPI
InternalHiiIfrValueAction (
IN CONST EFI_STRING Request, OPTIONAL
IN UINT16 DefaultId,
IN UINT16 DefaultId,
IN UINT8 ActionType
)
{
@ -1738,6 +1743,7 @@ InternalHiiIfrValueAction (
// Its default value and validating can't execute by parsing IFR data.
// Directly jump into the next ConfigAltResp string for another pair Guid, Name, and Path.
//
Status = EFI_SUCCESS;
goto NextConfigAltResp;
}
@ -1819,7 +1825,8 @@ InternalHiiIfrValueAction (
// Not found the matched default string ID
//
if (EFI_ERROR (Status)) {
goto Done;
Status = EFI_SUCCESS;
goto NextConfigAltResp;
}
}
@ -1838,7 +1845,8 @@ InternalHiiIfrValueAction (
);
if (EFI_ERROR (Status)) {
goto Done;
Status = EFI_SUCCESS;
goto NextConfigAltResp;
}
//
@ -1861,6 +1869,7 @@ InternalHiiIfrValueAction (
goto Done;
}
NextConfigAltResp:
//
// Free the allocated pacakge buffer and the got ConfigResp string.
//
@ -1868,11 +1877,12 @@ InternalHiiIfrValueAction (
FreePool (HiiPackageList);
HiiPackageList = NULL;
}
if (ConfigResp != NULL) {
FreePool (ConfigResp);
ConfigResp = NULL;
}
FreePool (ConfigResp);
ConfigResp = NULL;
NextConfigAltResp:
//
// Free the allocated buffer.
//

View File

@ -418,6 +418,7 @@ ExtractConfig (
if (Request == NULL) {
FreePool (ConfigRequest);
*Progress = NULL;
}
return Status;

View File

@ -1728,6 +1728,13 @@ GetFullStringFromHiiFormPackages (
PackageOffset += PacakgeHeader.Length;
}
//
// No requested varstore in IFR data and directly return
//
if (VarStorageData->Size == 0) {
goto Done;
}
//
// 3. Construct Request Element (Block Name) for 2.1 and 2.2 case.
@ -2204,6 +2211,13 @@ HiiConfigRoutingExtractConfig (
if (EFI_ERROR (Status)) {
goto Done;
}
//
// Not any request block is found.
//
if (StrStr (ConfigRequest, L"&OFFSET=") == NULL) {
AccessResults = AllocateCopyPool (StrSize (ConfigRequest), ConfigRequest);
goto NextConfigString;
}
}
//
@ -2261,7 +2275,8 @@ HiiConfigRoutingExtractConfig (
FreePool (DefaultResults);
DefaultResults = NULL;
}
NextConfigString:
if (!FirstElement) {
Status = AppendToMultiString (Results, L"&");
ASSERT_EFI_ERROR (Status);
@ -2292,6 +2307,7 @@ HiiConfigRoutingExtractConfig (
Done:
if (EFI_ERROR (Status)) {
FreePool (*Results);
*Results = NULL;
}
if (ConfigRequest != NULL) {
@ -2783,7 +2799,7 @@ HiiBlockToConfig (
StringPtr++;
}
if (*StringPtr == 0) {
*Progress = StringPtr;
*Progress = StringPtr - 1;
Status = EFI_INVALID_PARAMETER;
goto Exit;
}
@ -2792,7 +2808,7 @@ HiiBlockToConfig (
StringPtr++;
}
if (*StringPtr == 0) {
*Progress = StringPtr;
*Progress = StringPtr - 1;
Status = EFI_INVALID_PARAMETER;
goto Exit;
}
@ -2947,7 +2963,10 @@ HiiBlockToConfig (
return EFI_SUCCESS;
Exit:
FreePool (*Config);
if (*Config != NULL) {
FreePool (*Config);
*Config = NULL;
}
if (ValueStr != NULL) {
FreePool (ValueStr);
}
@ -3401,7 +3420,7 @@ HiiGetAltCfg (
Status = EFI_NOT_FOUND;
Exit:
*AltCfgResp = NULL;
if (!EFI_ERROR (Status) && (Result != NULL)) {
//
// Copy the <ConfigHdr> and <ConfigBody>