]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/BdsDxe/BootMaint/BootOption.c
Clean up BootMaint module in BdsDxe.
[mirror_edk2.git] / MdeModulePkg / Universal / BdsDxe / BootMaint / BootOption.c
index 89c8612d469a86689098a587d575074282848ce6..8baff7bb4cfe34fd63a33526e95ac866f818c743 100644 (file)
@@ -20,15 +20,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include "BBSsupport.h"\r
 \r
 /**\r
-  EDES_TODO: Add function description.\r
+  Create a menu entry give a Menu type.\r
 \r
-  @param MenuType        Use this parameter to identify current\r
-                         Menu type\r
+  @param MenuType        The Menu type to be created.\r
 \r
-           EDES_TODO: Incomplete Descriptions  NULL                Cannot allocate memory for current menu\r
-           EDES_TODO: Incomplete Descriptions  entry\r
-           EDES_TODO: Incomplete Descriptions  Others              A valid pointer pointing to the allocated\r
-           EDES_TODO: Incomplete Descriptions  memory pool for current menu entry\r
+\r
+  @retval NULL           If failed to create the menu.\r
+  @return                The menu.\r
 \r
 **/\r
 BM_MENU_ENTRY *\r
@@ -74,12 +72,12 @@ BOpt_CreateMenuEntry (
     return NULL;\r
   }\r
 \r
-  MenuEntry = EfiAllocateZeroPool (sizeof (BM_MENU_ENTRY));\r
+  MenuEntry = AllocateZeroPool (sizeof (BM_MENU_ENTRY));\r
   if (NULL == MenuEntry) {\r
     return MenuEntry;\r
   }\r
 \r
-  MenuEntry->VariableContext = EfiAllocateZeroPool (ContextSize);\r
+  MenuEntry->VariableContext = AllocateZeroPool (ContextSize);\r
   if (NULL == MenuEntry->VariableContext) {\r
     SafeFreePool (MenuEntry);\r
     MenuEntry = NULL;\r
@@ -92,11 +90,11 @@ BOpt_CreateMenuEntry (
 }\r
 \r
 /**\r
-  EDES_TODO: Add function description.\r
+  Free up all resource allocated for a BM_MENU_ENTRY.\r
 \r
-  @param MenuEntry       EDES_TODO: Add parameter description\r
+  @param MenuEntry   A pointer to BM_MENU_ENTRY.\r
 \r
-  @return EDES_TODO: Add description for return value\r
+  @retval VOID\r
 \r
 **/\r
 VOID\r
@@ -173,12 +171,15 @@ BOpt_DestroyMenuEntry (
 }\r
 \r
 /**\r
-  EDES_TODO: Add function description.\r
+  Get the Menu Entry from the list in Menu Entry List.\r
+\r
+  If MenuNumber is great or equal to the number of Menu\r
+  Entry in the list, then ASSERT.\r
 \r
-  @param MenuOption      EDES_TODO: Add parameter description\r
-  @param MenuNumber      EDES_TODO: Add parameter description\r
+  @param MenuOption      The Menu Entry List to read the menu entry.\r
+  @param MenuNumber      The index of Menu Entry.\r
 \r
-  @return EDES_TODO: Add description for return value\r
+  @return The Menu Entry.\r
 \r
 **/\r
 BM_MENU_ENTRY *\r
@@ -191,9 +192,7 @@ BOpt_GetMenuEntry (
   UINTN           Index;\r
   LIST_ENTRY      *List;\r
 \r
-  if (MenuNumber >= MenuOption->MenuNumber) {\r
-    return NULL;\r
-  }\r
+  ASSERT (MenuNumber < MenuOption->MenuNumber);\r
 \r
   List = MenuOption->Head.ForwardLink;\r
   for (Index = 0; Index < MenuNumber; Index++) {\r
@@ -206,7 +205,10 @@ BOpt_GetMenuEntry (
 }\r
 \r
 /**\r
-  EDES_TODO: Add function description.\r
+  This function build the FsOptionMenu list which records all\r
+  available file system in the system. They includes all instances\r
+  of EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, all instances of EFI_LOAD_FILE_SYSTEM\r
+  and all type of legacy boot device.\r
 \r
   @param CallbackData    BMM context data\r
 \r
@@ -273,7 +275,7 @@ BOpt_FindFileSystem (
       // Issue a dummy read to trigger reinstall of BlockIo protocol for removable media\r
       //\r
       if (BlkIo->Media->RemovableMedia) {\r
-        Buffer = EfiAllocateZeroPool (BlkIo->Media->BlockSize);\r
+        Buffer = AllocateZeroPool (BlkIo->Media->BlockSize);\r
         if (NULL == Buffer) {\r
           SafeFreePool (BlkIoHandle);\r
           return EFI_OUT_OF_RESOURCES;\r
@@ -372,7 +374,7 @@ BOpt_FindFileSystem (
       }\r
 \r
       TempStr                   = MenuEntry->HelpString;\r
-      MenuEntry->DisplayString  = EfiAllocateZeroPool (MAX_CHAR);\r
+      MenuEntry->DisplayString  = AllocateZeroPool (MAX_CHAR);\r
       ASSERT (MenuEntry->DisplayString != NULL);\r
       UnicodeSPrint (\r
         MenuEntry->DisplayString,\r
@@ -419,7 +421,7 @@ BOpt_FindFileSystem (
       MenuEntry->HelpString     = DevicePathToStr (FileContext->DevicePath);\r
 \r
       TempStr                   = MenuEntry->HelpString;\r
-      MenuEntry->DisplayString  = EfiAllocateZeroPool (MAX_CHAR);\r
+      MenuEntry->DisplayString  = AllocateZeroPool (MAX_CHAR);\r
       ASSERT (MenuEntry->DisplayString != NULL);\r
       UnicodeSPrint (\r
         MenuEntry->DisplayString,\r
@@ -478,7 +480,7 @@ BOpt_FindFileSystem (
       MenuEntry->HelpString     = DevicePathToStr (FileContext->DevicePath);\r
 \r
       TempStr                   = MenuEntry->HelpString;\r
-      MenuEntry->DisplayString  = EfiAllocateZeroPool (MAX_CHAR);\r
+      MenuEntry->DisplayString  = AllocateZeroPool (MAX_CHAR);\r
       ASSERT (MenuEntry->DisplayString != NULL);\r
       UnicodeSPrint (\r
         MenuEntry->DisplayString,\r
@@ -498,22 +500,18 @@ BOpt_FindFileSystem (
   return EFI_SUCCESS;\r
 }\r
 \r
-VOID\r
-BOpt_FreeMenu (\r
-  BM_MENU_OPTION        *FreeMenu\r
-  )\r
-/*++\r
-\r
-Routine Description\r
+/**\r
   Free resources allocated in Allocate Rountine\r
 \r
-Arguments:\r
-  FreeMenu        Menu to be freed\r
+  @param FreeMenu        Menu to be freed\r
 \r
-Returns:\r
-  VOID\r
+  @return VOID\r
 \r
---*/\r
+**/\r
+VOID\r
+BOpt_FreeMenu (\r
+  BM_MENU_OPTION        *FreeMenu\r
+  )\r
 {\r
   BM_MENU_ENTRY *MenuEntry;\r
   while (!IsListEmpty (&FreeMenu->Head)) {\r
@@ -528,26 +526,22 @@ Returns:
   }\r
 }\r
 \r
-EFI_STATUS\r
-BOpt_FindFiles (\r
-  IN BMM_CALLBACK_DATA          *CallbackData,\r
-  IN BM_MENU_ENTRY              *MenuEntry\r
-  )\r
-/*++\r
-\r
-Routine Description\r
+/**\r
   Find files under current directory\r
   All files and sub-directories in current directory\r
   will be stored in DirectoryMenu for future use.\r
 \r
-Arguments:\r
-  FileOption   -- Pointer for Dir to explore\r
+  @param FileOption  Pointer for Dir to explore.\r
 \r
-Returns:\r
-  TRUE         -- Get files from current dir successfully\r
-  FALSE        -- Can't get files from current dir\r
+  @retval TRUE         Get files from current dir successfully.\r
+  @retval FALSE        Can't get files from current dir.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+BOpt_FindFiles (\r
+  IN BMM_CALLBACK_DATA          *CallbackData,\r
+  IN BM_MENU_ENTRY              *MenuEntry\r
+  )\r
 {\r
   EFI_FILE_HANDLE NewDir;\r
   EFI_FILE_HANDLE Dir;\r
@@ -597,7 +591,7 @@ Returns:
                               );\r
 \r
   DirBufferSize = sizeof (EFI_FILE_INFO) + 1024;\r
-  DirInfo       = EfiAllocateZeroPool (DirBufferSize);\r
+  DirInfo       = AllocateZeroPool (DirBufferSize);\r
   if (DirInfo == NULL) {\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
@@ -659,7 +653,7 @@ Returns:
 \r
       if (NewFileContext->IsDir) {\r
         BufferSize                  = StrLen (DirInfo->FileName) * 2 + 6;\r
-        NewMenuEntry->DisplayString = EfiAllocateZeroPool (BufferSize);\r
+        NewMenuEntry->DisplayString = AllocateZeroPool (BufferSize);\r
 \r
         UnicodeSPrint (\r
           NewMenuEntry->DisplayString,\r
@@ -687,22 +681,19 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
-EFI_STATUS\r
-BOpt_GetLegacyOptions (\r
-  VOID\r
-  )\r
-/*++\r
-Routine Description:\r
-\r
+/**\r
   Build the LegacyFDMenu LegacyHDMenu LegacyCDMenu according to LegacyBios.GetBbsInfo().\r
 \r
-Arguments:\r
-  None\r
+  @param VOID\r
 \r
-Returns:\r
-  The device info of legacy device.\r
+  @retval EFI_SUCCESS The function complete successfully.\r
+  @retval EFI_OUT_OF_RESOURCES No enough memory to complete this function.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+BOpt_GetLegacyOptions (\r
+  VOID\r
+  )\r
 {\r
   BM_MENU_ENTRY             *NewMenuEntry;\r
   BM_LEGACY_DEVICE_CONTEXT  *NewLegacyDevContext;\r
@@ -780,7 +771,7 @@ Returns:
       sizeof (DescString),\r
       DescString\r
       );\r
-    NewLegacyDevContext->Description = EfiAllocateZeroPool (StrSize (DescString));\r
+    NewLegacyDevContext->Description = AllocateZeroPool (StrSize (DescString));\r
     if (NULL == NewLegacyDevContext->Description) {\r
       break;\r
     }\r
@@ -830,6 +821,14 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Free out resouce allocated from Legacy Boot Options.\r
+\r
+  @param VOID.\r
+\r
+  @return VOID.\r
+\r
+**/\r
 VOID\r
 BOpt_FreeLegacyOptions (\r
   VOID\r
@@ -842,24 +841,20 @@ BOpt_FreeLegacyOptions (
   BOpt_FreeMenu (&LegacyBEVMenu);\r
 }\r
 \r
-EFI_STATUS\r
-BOpt_GetBootOptions (\r
-  IN  BMM_CALLBACK_DATA         *CallbackData\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
 \r
   Build the BootOptionMenu according to BootOrder Variable.\r
-  This Routine will access the Boot#### to get EFI_LOAD_OPTION\r
+  This Routine will access the Boot#### to get EFI_LOAD_OPTION.\r
 \r
-Arguments:\r
-  None\r
+  @param None\r
 \r
-Returns:\r
-  The number of the Var Boot####\r
+  @return The number of the Var Boot####.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+BOpt_GetBootOptions (\r
+  IN  BMM_CALLBACK_DATA         *CallbackData\r
+  )\r
 {\r
   UINTN                     Index;\r
   UINT16                    BootString[10];\r
@@ -929,7 +924,7 @@ Returns:
       continue;\r
     }\r
 \r
-    LoadOption = EfiAllocateZeroPool (BootOptionSize);\r
+    LoadOption = AllocateZeroPool (BootOptionSize);\r
     if (LoadOption == NULL) {\r
       continue;\r
     }\r
@@ -1014,7 +1009,7 @@ Returns:
     LoadOptionPtr += sizeof (UINT16);\r
 \r
     StringSize                  = StrSize ((UINT16 *) LoadOptionPtr);\r
-    NewLoadContext->Description = EfiAllocateZeroPool (StringSize);\r
+    NewLoadContext->Description = AllocateZeroPool (StringSize);\r
     ASSERT (NewLoadContext->Description != NULL);\r
     CopyMem (\r
       NewLoadContext->Description,\r
@@ -1025,7 +1020,7 @@ Returns:
 \r
     LoadOptionPtr += StringSize;\r
 \r
-    NewLoadContext->FilePathList = EfiAllocateZeroPool (NewLoadContext->FilePathListLength);\r
+    NewLoadContext->FilePathList = AllocateZeroPool (NewLoadContext->FilePathListLength);\r
     ASSERT (NewLoadContext->FilePathList != NULL);\r
     CopyMem (\r
       NewLoadContext->FilePathList,\r
@@ -1051,7 +1046,7 @@ Returns:
         StringSize -\r
         NewLoadContext->FilePathListLength;\r
 \r
-      NewLoadContext->OptionalData = EfiAllocateZeroPool (OptionalDataSize);\r
+      NewLoadContext->OptionalData = AllocateZeroPool (OptionalDataSize);\r
       ASSERT (NewLoadContext->OptionalData != NULL);\r
       CopyMem (\r
         NewLoadContext->OptionalData,\r
@@ -1072,46 +1067,22 @@ Returns:
   return MenuCount;\r
 }\r
 \r
-CHAR16 *\r
-BdsStrCpy (\r
-  OUT     CHAR16                    *Destination,\r
-  IN      CONST CHAR16              *Source\r
-  )\r
-{\r
-  CHAR16                            *ReturnValue;\r
+/**\r
 \r
-  //\r
-  // Destination cannot be NULL\r
-  //\r
-  ASSERT (Destination != NULL);\r
+  Append file name to existing file name.\r
 \r
-  ReturnValue = Destination;\r
-  while (*Source != L'\0') {\r
-    *(Destination++) = *(Source++);\r
-  }\r
-  *Destination = 0;\r
-  return ReturnValue;\r
-}\r
+  @param Str1  The existing file name\r
+  @param Str2  The file name to be appended\r
 \r
+  @return Allocate a new string to hold the appended result.\r
+          Caller is responsible to free the returned string.\r
+\r
+**/\r
 CHAR16 *\r
 BOpt_AppendFileName (\r
   IN  CHAR16  *Str1,\r
   IN  CHAR16  *Str2\r
   )\r
-/*++\r
-\r
-Routine Description\r
-  Append file name to existing file name.\r
-\r
-Arguments:\r
-  Str1  -   existing file name\r
-  Str2  -   file name to be appended\r
-\r
-Returns:\r
-  Allocate a new string to hold the appended result.\r
-  Caller is responsible to free the returned string.\r
-\r
---*/\r
 {\r
   UINTN   Size1;\r
   UINTN   Size2;\r
@@ -1121,7 +1092,7 @@ Returns:
 \r
   Size1 = StrSize (Str1);\r
   Size2 = StrSize (Str2);\r
-  Str   = EfiAllocateZeroPool (Size1 + Size2 + sizeof (CHAR16));\r
+  Str   = AllocateZeroPool (Size1 + Size2 + sizeof (CHAR16));\r
   ASSERT (Str != NULL);\r
 \r
   StrCat (Str, Str1);\r
@@ -1140,13 +1111,13 @@ Returns:
       // DO NOT convert the .. if it is at the end of the string. This will\r
       // break the .. behavior in changing directories.\r
       //\r
-      BdsStrCpy (LastSlash, Ptr + 3);\r
+      StrCpy (LastSlash, Ptr + 3);\r
       Ptr = LastSlash;\r
     } else if (*Ptr == '\\' && *(Ptr + 1) == '.' && *(Ptr + 2) == '\\') {\r
       //\r
       // Convert a "\.\" to a "\"\r
       //\r
-      BdsStrCpy (Ptr, Ptr + 2);\r
+      StrCpy (Ptr, Ptr + 2);\r
       Ptr = LastSlash;\r
     } else if (*Ptr == '\\') {\r
       LastSlash = Ptr;\r
@@ -1158,24 +1129,21 @@ Returns:
   return Str;\r
 }\r
 \r
-BOOLEAN\r
-BOpt_IsEfiImageName (\r
-  IN UINT16  *FileName\r
-  )\r
-/*++\r
+/**\r
 \r
-Routine Description\r
   Check whether current FileName point to a valid\r
   Efi Image File.\r
 \r
-Arguments:\r
-  FileName  -   File need to be checked.\r
+  @param FileName  File need to be checked.\r
 \r
-Returns:\r
-  TRUE  -   Is Efi Image\r
-  FALSE -   Not a valid Efi Image\r
+  @retval TRUE  Is Efi Image\r
+  @retval FALSE Not a valid Efi Image\r
 \r
---*/\r
+**/\r
+BOOLEAN\r
+BOpt_IsEfiImageName (\r
+  IN UINT16  *FileName\r
+  )\r
 {\r
   //\r
   // Search for ".efi" extension\r
@@ -1203,25 +1171,22 @@ Returns:
   return FALSE;\r
 }\r
 \r
-BOOLEAN\r
-BOpt_IsEfiApp (\r
-  IN EFI_FILE_HANDLE Dir,\r
-  IN UINT16          *FileName\r
-  )\r
-/*++\r
+/**\r
 \r
-Routine Description:\r
   Check whether current FileName point to a valid Efi Application\r
 \r
-Arguments:\r
-  Dir       -   Pointer to current Directory\r
-  FileName  -   Pointer to current File name.\r
+  @param Dir       Pointer to current Directory\r
+  @param FileName  Pointer to current File name.\r
 \r
-Returns:\r
-  TRUE      -   Is a valid Efi Application\r
-  FALSE     -   not a valid Efi Application\r
+  @retval TRUE      Is a valid Efi Application\r
+  @retval FALSE     not a valid Efi Application\r
 \r
---*/\r
+**/\r
+BOOLEAN\r
+BOpt_IsEfiApp (\r
+  IN EFI_FILE_HANDLE Dir,\r
+  IN UINT16          *FileName\r
+  )\r
 {\r
   UINTN                       BufferSize;\r
   EFI_IMAGE_DOS_HEADER        DosHdr;\r
@@ -1270,26 +1235,23 @@ Returns:
   }\r
 }\r
 \r
-EFI_STATUS\r
-BOpt_FindDrivers (\r
-  VOID\r
-  )\r
-/*++\r
+/**\r
 \r
-Routine Description\r
   Find drivers that will be added as Driver#### variables from handles\r
   in current system environment\r
   All valid handles in the system except those consume SimpleFs, LoadFile\r
   are stored in DriverMenu for future use.\r
 \r
-Arguments:\r
-  None\r
+  @param VOID \r
 \r
-Returns:\r
-  EFI_SUCCESS\r
-  Others\r
+  @retval EFI_SUCCESS The function complets successfully.\r
+  @return Other value if failed to build the DriverMenu.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+BOpt_FindDrivers (\r
+  VOID\r
+  )\r
 {\r
   UINTN                           NoDevicePathHandles;\r
   EFI_HANDLE                      *DevicePathHandle;\r
@@ -1327,10 +1289,6 @@ Returns:
   for (Index = 0; Index < NoDevicePathHandles; Index++) {\r
     CurHandle = DevicePathHandle[Index];\r
 \r
-    //\r
-    //  Check whether this handle support\r
-    //  driver binding\r
-    //\r
     Status = gBS->HandleProtocol (\r
                     CurHandle,\r
                     &gEfiSimpleFileSystemProtocolGuid,\r
@@ -1371,21 +1329,19 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
-UINT16\r
-BOpt_GetBootOptionNumber (\r
-  VOID\r
-  )\r
-/*++\r
+/**\r
 \r
-Routine Description:\r
-  Get the Option Number that does not used\r
+  Get the Option Number that has not been allocated for use.\r
 \r
-Arguments:\r
+  @param VOID\r
 \r
-Returns:\r
-  The Option Number\r
+  @return The available Option Number.\r
 \r
---*/\r
+**/\r
+UINT16\r
+BOpt_GetBootOptionNumber (\r
+  VOID\r
+  )\r
 {\r
   BM_MENU_ENTRY *NewMenuEntry;\r
   UINT16        *BootOrderList;\r
@@ -1423,15 +1379,16 @@ Returns:
       }\r
 \r
       if (Found) {\r
-     UnicodeSPrint (StrTemp, 100, L"Boot%04x", Index);\r
-     DEBUG((DEBUG_ERROR,"INdex= %s\n", StrTemp));\r
-          OptionBuffer = BdsLibGetVariableAndSize (\r
-                    StrTemp,\r
-                    &gEfiGlobalVariableGuid,\r
-                    &OptionSize\r
-                    );\r
-         if (NULL == OptionBuffer)\r
-            break;\r
+        UnicodeSPrint (StrTemp, 100, L"Boot%04x", Index);\r
+        DEBUG((DEBUG_ERROR,"INdex= %s\n", StrTemp));\r
+        OptionBuffer = BdsLibGetVariableAndSize (\r
+                          StrTemp,\r
+                          &gEfiGlobalVariableGuid,\r
+                          &OptionSize\r
+                          );\r
+        if (NULL == OptionBuffer) {\r
+          break;\r
+        }\r
       }\r
     }\r
     //\r
@@ -1448,21 +1405,19 @@ Returns:
   return Number;\r
 }\r
 \r
-UINT16\r
-BOpt_GetDriverOptionNumber (\r
-  VOID\r
-  )\r
-/*++\r
+/**\r
 \r
-Routine Description:\r
-  Get the Option Number that does not used\r
+  Get the Option Number that is not in use.\r
 \r
-Arguments:\r
+  @param VOID\r
 \r
-Returns:\r
-  The Option Number\r
+  @return The unused Option Number.\r
 \r
---*/\r
+**/\r
+UINT16\r
+BOpt_GetDriverOptionNumber (\r
+  VOID\r
+  )\r
 {\r
   BM_MENU_ENTRY *NewMenuEntry;\r
   UINT16        *DriverOrderList;\r
@@ -1514,21 +1469,21 @@ Returns:
   return Number;\r
 }\r
 \r
-EFI_STATUS\r
-BOpt_GetDriverOptions (\r
-  IN  BMM_CALLBACK_DATA         *CallbackData\r
-  )\r
-/*++\r
+/**\r
 \r
-Routine Description:\r
   Build up all DriverOptionMenu\r
 \r
-Arguments:\r
+  @param CallbackData The BMM context data.\r
 \r
-Returns:\r
-  The Option Number\r
+  @return EFI_SUCESS The functin completes successfully.\r
+  @retval EFI_OUT_OF_RESOURCES Not enough memory to compete the operation.\r
+  \r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+BOpt_GetDriverOptions (\r
+  IN  BMM_CALLBACK_DATA         *CallbackData\r
+  )\r
 {\r
   UINTN           Index;\r
   UINT16          DriverString[12];\r
@@ -1579,7 +1534,7 @@ Returns:
       continue;\r
     }\r
 \r
-    LoadOption = EfiAllocateZeroPool (DriverOptionSize);\r
+    LoadOption = AllocateZeroPool (DriverOptionSize);\r
     if (LoadOption == NULL) {\r
       continue;\r
     }\r
@@ -1619,7 +1574,7 @@ Returns:
     LoadOptionPtr += sizeof (UINT16);\r
 \r
     StringSize                  = StrSize ((UINT16 *) LoadOptionPtr);\r
-    NewLoadContext->Description = EfiAllocateZeroPool (StringSize);\r
+    NewLoadContext->Description = AllocateZeroPool (StringSize);\r
     ASSERT (NewLoadContext->Description != NULL);\r
     CopyMem (\r
       NewLoadContext->Description,\r
@@ -1630,7 +1585,7 @@ Returns:
 \r
     LoadOptionPtr += StringSize;\r
 \r
-    NewLoadContext->FilePathList = EfiAllocateZeroPool (NewLoadContext->FilePathListLength);\r
+    NewLoadContext->FilePathList = AllocateZeroPool (NewLoadContext->FilePathListLength);\r
     ASSERT (NewLoadContext->FilePathList != NULL);\r
     CopyMem (\r
       NewLoadContext->FilePathList,\r
@@ -1656,7 +1611,7 @@ Returns:
         StringSize -\r
         NewLoadContext->FilePathListLength;\r
 \r
-      NewLoadContext->OptionalData = EfiAllocateZeroPool (OptionalDataSize);\r
+      NewLoadContext->OptionalData = AllocateZeroPool (OptionalDataSize);\r
       ASSERT (NewLoadContext->OptionalData != NULL);\r
       CopyMem (\r
         NewLoadContext->OptionalData,\r