MdeModulePkg: Restore question base on the fail info when submit fail

When RouteConfig function fail in SubmitForForm or SubmitForFormSet
function, we should restore the question value base on the failure
information, should not restore all the question.
This patch to fix this issue.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Dandan Bi
2016-04-22 13:51:04 +08:00
committed by Star Zeng
parent 314e2fb175
commit 8066b27e86
2 changed files with 151 additions and 7 deletions

View File

@@ -1,7 +1,7 @@
/** @file
Private MACRO, structure and function definitions for Setup Browser module.
Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -178,6 +178,8 @@ typedef struct {
BOOLEAN HasCallAltCfg; // Flag to show whether browser has call ExtractConfig to get Altcfg string.
UINTN ElementCount; // Number of <RequestElement> in the <ConfigRequest>
UINTN SpareStrLen; // Spare length of ConfigRequest string buffer
CHAR16 *RestoreConfigRequest; // When submit formset fail, the element need to be restored
CHAR16 *SyncConfigRequest; // When submit formset fail, the element need to be synced
} FORMSET_STORAGE;
#define FORMSET_STORAGE_FROM_LINK(a) CR (a, FORMSET_STORAGE, Link, FORMSET_STORAGE_SIGNATURE)
@@ -387,6 +389,8 @@ typedef struct {
CHAR16 *ConfigAltResp; // Alt config response string for this ConfigRequest.
UINTN ElementCount; // Number of <RequestElement> in the <ConfigRequest>
UINTN SpareStrLen;
CHAR16 *RestoreConfigRequest; // When submit form fail, the element need to be restored
CHAR16 *SyncConfigRequest; // When submit form fail, the element need to be synced
BROWSER_STORAGE *Storage;
} FORM_BROWSER_CONFIG_REQUEST;