}\r
\r
/**\r
- This function shares the same logic to parse ConfigAltResp string \r
- for setting default value and validating current setting.\r
-\r
- @param ConfigResp \r
- @param HiiPackageList \r
- @param PackageListLength \r
- @param VarGuid\r
- @param VarName\r
+ This internal function parses IFR data to validate current setting.\r
+\r
+ @param ConfigResp ConfigResp string contains the current setting.\r
+ @param HiiPackageList Point to Hii package list.\r
+ @param PackageListLength The length of the pacakge.\r
+ @param VarGuid Guid of the buffer storage.\r
+ @param VarName Name of the buffer storage.\r
\r
- @retval EFI_SUCCESS\r
+ @retval EFI_SUCCESS The current setting is valid.\r
+ @retval EFI_OUT_OF_RESOURCES The memory is not enough.\r
+ @retval EFI_INVALID_PARAMETER The config string or the Hii package is invalid.\r
**/\r
EFI_STATUS\r
EFIAPI\r
}\r
//\r
// Find the matched VarStoreId to the input VarGuid and VarName\r
- // \r
+ //\r
IfrVarStore = (EFI_IFR_VARSTORE *) IfrOpHdr;\r
if (CompareGuid ((EFI_GUID *) (VOID *) &IfrVarStore->Guid, VarGuid)) {\r
VarStoreName = (CHAR8 *) IfrVarStore->Name;\r
break;\r
case EFI_IFR_ONE_OF_OP:\r
//\r
- // Check whether current value is the one of option. \r
+ // Check whether current value is the one of option.\r
//\r
\r
//\r
+ // OneOf question is not in IFR Form. This IFR form is not valid. \r
+ //\r
+ if (IfrVarStore == NULL) {\r
+ Status = EFI_INVALID_PARAMETER;\r
+ goto Done;\r
+ }\r
+ // \r
// Check whether this question is for the requested varstore.\r
//\r
IfrOneOf = (EFI_IFR_ONE_OF *) IfrOpHdr;\r
// Check the current value is in the numeric range.\r
//\r
\r
+ //\r
+ // Numeric question is not in IFR Form. This IFR form is not valid. \r
+ //\r
+ if (IfrVarStore == NULL) {\r
+ Status = EFI_INVALID_PARAMETER;\r
+ goto Done;\r
+ }\r
//\r
// Check whether this question is for the requested varstore.\r
//\r
// Check value is BOOLEAN type, only 0 and 1 is valid.\r
//\r
\r
+ //\r
+ // CheckBox question is not in IFR Form. This IFR form is not valid. \r
+ //\r
+ if (IfrVarStore == NULL) {\r
+ Status = EFI_INVALID_PARAMETER;\r
+ goto Done;\r
+ }\r
+\r
//\r
// Check whether this question is for the requested varstore.\r
//\r
// Check current string length is less than maxsize\r
//\r
\r
+ //\r
+ // CheckBox question is not in IFR Form. This IFR form is not valid. \r
+ //\r
+ if (IfrVarStore == NULL) {\r
+ Status = EFI_INVALID_PARAMETER;\r
+ goto Done;\r
+ }\r
+\r
//\r
// Check whether this question is for the requested varstore.\r
//\r
}\r
\r
/**\r
- This function shares the same logic to parse ConfigAltResp string \r
- for setting default value and validating current setting.\r
- \r
+ This function parses the input ConfigRequest string and its matched IFR code\r
+ string for setting default value and validating current setting.\r
+\r
1. For setting default action, Reset the default value specified by DefaultId \r
to the driver configuration got by Request string.\r
2. For validating current setting, Validate the current configuration \r