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