X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FSetupBrowserDxe%2FPresentation.c;h=0c5d1b40184980feaf9f3a68b720afbcdb675158;hb=0a18956d54cfe70b736b029c62ce53f29b903745;hp=7bf91df8573b5507143dec19938b91c18213d885;hpb=fb567b2f7400dc615ea8195efb33935e32a13f40;p=mirror_edk2.git diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c index 7bf91df857..0c5d1b4018 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c @@ -1,7 +1,7 @@ /** @file Utility functions for UI presentation. -Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.
(C) Copyright 2015 Hewlett Packard Enterprise Development LP
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -358,7 +358,7 @@ InitializeDisplayStatement ( // // Create the refresh event process function. // - if (!CompareGuid (&Statement->RefreshGuid, &gZeroGuid)) { + if (!IsZeroGuid (&Statement->RefreshGuid)) { CreateRefreshEventForStatement (Statement); } @@ -373,7 +373,7 @@ InitializeDisplayStatement ( // Create the refresh guid hook event. // If the statement in this form has refresh event or refresh interval, browser will create this event for display engine. // - if ((!CompareGuid (&Statement->RefreshGuid, &gZeroGuid)) || (Statement->RefreshInterval != 0)) { + if ((!IsZeroGuid (&Statement->RefreshGuid)) || (Statement->RefreshInterval != 0)) { gDisplayFormData.FormRefreshEvent = mValueChangedEvent; } @@ -628,7 +628,7 @@ AddStatementToDisplayForm ( // // Create the refresh event process function for Form. // - if (!CompareGuid (&gCurrentSelection->Form->RefreshGuid, &gZeroGuid)) { + if (!IsZeroGuid (&gCurrentSelection->Form->RefreshGuid)) { CreateRefreshEventForForm (gCurrentSelection->Form); if (gDisplayFormData.FormRefreshEvent == NULL) { gDisplayFormData.FormRefreshEvent = mValueChangedEvent; @@ -1410,7 +1410,7 @@ ProcessGotoOpCode ( CopyMem (&Selection->FormSetGuid,&Statement->HiiValue.Value.ref.FormSetGuid, sizeof (EFI_GUID)); Selection->FormId = Statement->HiiValue.Value.ref.FormId; Selection->QuestionId = Statement->HiiValue.Value.ref.QuestionId; - } else if (!CompareGuid (&Statement->HiiValue.Value.ref.FormSetGuid, &gZeroGuid)) { + } else if (!IsZeroGuid (&Statement->HiiValue.Value.ref.FormSetGuid)) { if (Selection->Form->ModalForm) { return Status; } @@ -1937,8 +1937,8 @@ ReconnectController ( @param Action The action request. @param SkipSaveOrDiscard Whether skip save or discard action. - @retval EFI_SUCCESS The call back function excutes successfully. - @return Other value if the call back function failed to excute. + @retval EFI_SUCCESS The call back function executes successfully. + @return Other value if the call back function failed to execute. **/ EFI_STATUS ProcessCallBackFunction ( @@ -2044,6 +2044,7 @@ ProcessCallBackFunction ( ASSERT (StrLen (NewString) * sizeof (CHAR16) <= Statement->StorageWidth); if (StrLen (NewString) * sizeof (CHAR16) <= Statement->StorageWidth) { + ZeroMem (Statement->BufferValue, Statement->StorageWidth); CopyMem (Statement->BufferValue, NewString, StrSize (NewString)); } else { CopyMem (Statement->BufferValue, NewString, Statement->StorageWidth); @@ -2246,8 +2247,8 @@ ProcessCallBackFunction ( @param Statement The Question which need to call. @param FormSet The formset this question belong to. - @retval EFI_SUCCESS The call back function excutes successfully. - @return Other value if the call back function failed to excute. + @retval EFI_SUCCESS The call back function executes successfully. + @return Other value if the call back function failed to execute. **/ EFI_STATUS ProcessRetrieveForQuestion ( @@ -2293,6 +2294,7 @@ ProcessRetrieveForQuestion ( ASSERT (StrLen (NewString) * sizeof (CHAR16) <= Statement->StorageWidth); if (StrLen (NewString) * sizeof (CHAR16) <= Statement->StorageWidth) { + ZeroMem (Statement->BufferValue, Statement->StorageWidth); CopyMem (Statement->BufferValue, NewString, StrSize (NewString)); } else { CopyMem (Statement->BufferValue, NewString, Statement->StorageWidth); @@ -2360,6 +2362,12 @@ SetupBrowser ( mCurFakeQestId = 0; do { + + // + // Reset Status to prevent the next break from returning incorrect error status. + // + Status = EFI_SUCCESS; + // // IFR is updated, force to reparse the IFR binary // This check is shared by EFI_BROWSER_ACTION_FORM_CLOSE and