From c4042207d6dc10b786506db0b1fa897e723123f1 Mon Sep 17 00:00:00 2001 From: ydong10 Date: Sun, 9 Oct 2011 10:52:54 +0000 Subject: When the CONFIG_ACCESS_PROTOCOL.CallBack function return error, the question should restore to old value Signed-off-by:ydong10 Reviewed-by:lgao4 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12518 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c index c573fdbe15..62ce070462 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c @@ -1290,11 +1290,21 @@ ProcessCallBackFunction ( if (Action == EFI_BROWSER_ACTION_CHANGING || Action == EFI_BROWSER_ACTION_RETRIEVE) { SetQuestionValue(Selection->FormSet, Selection->Form, Statement, TRUE); } - } else if (Status == EFI_UNSUPPORTED) { + } else { // - // If return EFI_UNSUPPORTED, also consider Hii driver suceess deal with it. + // According the spec, return fail from call back of "changing" and + // "retrieve", should restore the question's value. // - Status = EFI_SUCCESS; + if (Action == EFI_BROWSER_ACTION_CHANGING || Action == EFI_BROWSER_ACTION_RETRIEVE) { + GetQuestionValue(Selection->FormSet, Selection->Form, Statement, TRUE); + } + + if (Status == EFI_UNSUPPORTED) { + // + // If return EFI_UNSUPPORTED, also consider Hii driver suceess deal with it. + // + Status = EFI_SUCCESS; + } } } -- cgit v1.2.3