git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8314
6f19259b-4bc3-4df7-8a09-
765794883524
- It has the many same logic to HiiValidateSetting API.\r
-\r
Reset the default value specified by DefaultId to the driver\r
configuration got by Request string. \r
Reset the default value specified by DefaultId to the driver\r
configuration got by Request string. \r
- NULL request string support depends on the ExtractConfig interface of\r
+\r
+ NULL request string support depends on the ExportConfig interface of\r
HiiConfigRouting protocol in UEFI specification.\r
\r
HiiConfigRouting protocol in UEFI specification.\r
\r
- @param EFI_STRING Request A null-terminated Unicode string in \r
- <MultiConfigRequest> format. It can be NULL.\r
- If it is NULL, all configuration for the\r
- entirety of the current HII database will be reset.\r
- @param UINT16 DefaultId Specifies the type of defaults to retrieve.\r
+ @param Request A null-terminated Unicode string in \r
+ <MultiConfigRequest> format. It can be NULL.\r
+ If it is NULL, all configuration for the\r
+ entirety of the current HII database will be reset.\r
+ @param DefaultId Specifies the type of defaults to retrieve.\r
\r
@retval TURE The default value is set successfully.\r
@retval FALSE The default value can't be found and set.\r
\r
@retval TURE The default value is set successfully.\r
@retval FALSE The default value can't be found and set.\r
\r
/**\r
Validate the current configuration by parsing HII form IFR opcode.\r
\r
/**\r
Validate the current configuration by parsing HII form IFR opcode.\r
- It can share the most logic with HiiSetToDefaults.\r
\r
NULL request string support depends on the ExtractConfig interface of\r
HiiConfigRouting protocol in UEFI specification.\r
\r
\r
NULL request string support depends on the ExtractConfig interface of\r
HiiConfigRouting protocol in UEFI specification.\r
\r
- @param EFI_STRING Request A null-terminated Unicode string in \r
- <MultiConfigRequest> format. It can be NULL.\r
- If it is NULL, all current configuration for the\r
- entirety of the current HII database will be validated.\r
+ @param Request A null-terminated Unicode string in \r
+ <MultiConfigRequest> format. It can be NULL.\r
+ If it is NULL, all current configuration for the\r
+ entirety of the current HII database will be validated.\r
\r
@retval TURE Current configuration is valid.\r
@retval FALSE Current configuration is invalid.\r
\r
@retval TURE Current configuration is valid.\r
@retval FALSE Current configuration is invalid.\r
}\r
Link = Link->ForwardLink; \r
}\r
}\r
Link = Link->ForwardLink; \r
}\r
+ \r
+ if (IsListEmpty (&CurrentBlockArray->Entry)) {\r
+ Status = EFI_SUCCESS;\r
+ goto Done;\r
+ }\r
\r
//\r
// 2. Check IFR value is in block data, then Validate Vaule\r
\r
//\r
// 2. Check IFR value is in block data, then Validate Vaule\r
// Check the matched VarStoreId is found.\r
//\r
if (IfrVarStore == NULL) {\r
// Check the matched VarStoreId is found.\r
//\r
if (IfrVarStore == NULL) {\r
- Status = EFI_NOT_FOUND;\r
+ Status = EFI_SUCCESS;\r
goto Done;\r
}\r
break;\r
goto Done;\r
}\r
break;\r
EFIAPI\r
InternalHiiIfrValueAction (\r
IN CONST EFI_STRING Request, OPTIONAL\r
EFIAPI\r
InternalHiiIfrValueAction (\r
IN CONST EFI_STRING Request, OPTIONAL\r
IN UINT8 ActionType\r
)\r
{\r
IN UINT8 ActionType\r
)\r
{\r
// Its default value and validating can't execute by parsing IFR data.\r
// Directly jump into the next ConfigAltResp string for another pair Guid, Name, and Path. \r
//\r
// Its default value and validating can't execute by parsing IFR data.\r
// Directly jump into the next ConfigAltResp string for another pair Guid, Name, and Path. \r
//\r
+ Status = EFI_SUCCESS;\r
goto NextConfigAltResp;\r
}\r
\r
goto NextConfigAltResp;\r
}\r
\r
// Not found the matched default string ID\r
//\r
if (EFI_ERROR (Status)) {\r
// Not found the matched default string ID\r
//\r
if (EFI_ERROR (Status)) {\r
+ Status = EFI_SUCCESS;\r
+ goto NextConfigAltResp;\r
);\r
\r
if (EFI_ERROR (Status)) {\r
);\r
\r
if (EFI_ERROR (Status)) {\r
+ Status = EFI_SUCCESS;\r
+ goto NextConfigAltResp;\r
//\r
// Free the allocated pacakge buffer and the got ConfigResp string.\r
//\r
//\r
// Free the allocated pacakge buffer and the got ConfigResp string.\r
//\r
FreePool (HiiPackageList);\r
HiiPackageList = NULL;\r
}\r
FreePool (HiiPackageList);\r
HiiPackageList = NULL;\r
}\r
+ \r
+ if (ConfigResp != NULL) {\r
+ FreePool (ConfigResp);\r
+ ConfigResp = NULL;\r
+ }\r
- FreePool (ConfigResp);\r
- ConfigResp = NULL;\r
-\r
-NextConfigAltResp:\r
//\r
// Free the allocated buffer.\r
//\r
//\r
// Free the allocated buffer.\r
//\r
\r
if (Request == NULL) {\r
FreePool (ConfigRequest);\r
\r
if (Request == NULL) {\r
FreePool (ConfigRequest);\r
\r
PackageOffset += PacakgeHeader.Length;\r
}\r
\r
PackageOffset += PacakgeHeader.Length;\r
}\r
+ \r
+ //\r
+ // No requested varstore in IFR data and directly return\r
+ //\r
+ if (VarStorageData->Size == 0) {\r
+ goto Done;\r
+ }\r
\r
//\r
// 3. Construct Request Element (Block Name) for 2.1 and 2.2 case.\r
\r
//\r
// 3. Construct Request Element (Block Name) for 2.1 and 2.2 case.\r
if (EFI_ERROR (Status)) {\r
goto Done;\r
}\r
if (EFI_ERROR (Status)) {\r
goto Done;\r
}\r
+ //\r
+ // Not any request block is found.\r
+ //\r
+ if (StrStr (ConfigRequest, L"&OFFSET=") == NULL) {\r
+ AccessResults = AllocateCopyPool (StrSize (ConfigRequest), ConfigRequest);\r
+ goto NextConfigString;\r
+ }\r
FreePool (DefaultResults);\r
DefaultResults = NULL;\r
}\r
FreePool (DefaultResults);\r
DefaultResults = NULL;\r
}\r
+\r
+NextConfigString: \r
if (!FirstElement) {\r
Status = AppendToMultiString (Results, L"&");\r
ASSERT_EFI_ERROR (Status);\r
if (!FirstElement) {\r
Status = AppendToMultiString (Results, L"&");\r
ASSERT_EFI_ERROR (Status);\r
Done:\r
if (EFI_ERROR (Status)) {\r
FreePool (*Results);\r
Done:\r
if (EFI_ERROR (Status)) {\r
FreePool (*Results);\r
}\r
\r
if (ConfigRequest != NULL) {\r
}\r
\r
if (ConfigRequest != NULL) {\r
StringPtr++;\r
}\r
if (*StringPtr == 0) {\r
StringPtr++;\r
}\r
if (*StringPtr == 0) {\r
- *Progress = StringPtr;\r
+ *Progress = StringPtr - 1;\r
Status = EFI_INVALID_PARAMETER;\r
goto Exit;\r
}\r
Status = EFI_INVALID_PARAMETER;\r
goto Exit;\r
}\r
StringPtr++;\r
}\r
if (*StringPtr == 0) {\r
StringPtr++;\r
}\r
if (*StringPtr == 0) {\r
- *Progress = StringPtr;\r
+ *Progress = StringPtr - 1;\r
Status = EFI_INVALID_PARAMETER;\r
goto Exit;\r
}\r
Status = EFI_INVALID_PARAMETER;\r
goto Exit;\r
}\r
return EFI_SUCCESS;\r
\r
Exit:\r
return EFI_SUCCESS;\r
\r
Exit:\r
+ if (*Config != NULL) {\r
+ FreePool (*Config);\r
+ *Config = NULL;\r
+ }\r
if (ValueStr != NULL) {\r
FreePool (ValueStr);\r
}\r
if (ValueStr != NULL) {\r
FreePool (ValueStr);\r
}\r
Status = EFI_NOT_FOUND;\r
\r
Exit:\r
Status = EFI_NOT_FOUND;\r
\r
Exit:\r
if (!EFI_ERROR (Status) && (Result != NULL)) {\r
//\r
// Copy the <ConfigHdr> and <ConfigBody>\r
if (!EFI_ERROR (Status) && (Result != NULL)) {\r
//\r
// Copy the <ConfigHdr> and <ConfigBody>\r