summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MdeModulePkg/Include/Library/HiiLib.h24
-rw-r--r--MdeModulePkg/Library/UefiHiiLib/HiiLib.c26
-rw-r--r--MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c1
-rw-r--r--MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c29
4 files changed, 54 insertions, 26 deletions
diff --git a/MdeModulePkg/Include/Library/HiiLib.h b/MdeModulePkg/Include/Library/HiiLib.h
index 3054a9b..81fdaab 100644
--- a/MdeModulePkg/Include/Library/HiiLib.h
+++ b/MdeModulePkg/Include/Library/HiiLib.h
@@ -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.
diff --git a/MdeModulePkg/Library/UefiHiiLib/HiiLib.c b/MdeModulePkg/Library/UefiHiiLib/HiiLib.c
index de7cb3f..b932370 100644
--- a/MdeModulePkg/Library/UefiHiiLib/HiiLib.c
+++ b/MdeModulePkg/Library/UefiHiiLib/HiiLib.c
@@ -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.
//
diff --git a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
index 87ffac8..254f7f9 100644
--- a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
+++ b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
@@ -418,6 +418,7 @@ ExtractConfig (
if (Request == NULL) {
FreePool (ConfigRequest);
+ *Progress = NULL;
}
return Status;
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
index 6b278af..2761be1 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
@@ -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>