\r
#include "BootMaint.h"\r
\r
-/**\r
- Wrap original AllocatePool gBS call\r
- and ZeroMem gBS call into a single\r
- function in order to decrease code length\r
-\r
-\r
- @param Size The size to allocate\r
-\r
- @return Valid pointer to the allocated buffer\r
- @retval Null for failure\r
-\r
-**/\r
-VOID *\r
-EfiAllocateZeroPool (\r
- IN UINTN Size\r
- )\r
-{\r
- EFI_STATUS Status;\r
- VOID *Ptr;\r
- Status = gBS->AllocatePool (EfiBootServicesData, Size, &Ptr);\r
- if (EFI_ERROR (Status)) {\r
- Ptr = NULL;\r
- return Ptr;\r
- }\r
-\r
- ZeroMem (Ptr, Size);\r
- return Ptr;\r
-}\r
-\r
/**\r
\r
Find the first instance of this Protocol\r
in the system and return it's interface\r
\r
\r
- @param ProtocolGuid - Provides the protocol to search for\r
- @param Interface - On return, a pointer to the first interface\r
+ @param ProtocolGuid Provides the protocol to search for\r
+ @param Interface On return, a pointer to the first interface\r
that matches ProtocolGuid\r
\r
@retval EFI_SUCCESS A protocol instance matching ProtocolGuid was found\r
\r
@retval TRUE if the buffer was reallocated and the caller\r
should try the API again.\r
+ @retval FALSE The caller should not call this function again.\r
\r
**/\r
BOOLEAN\r
\r
SafeFreePool (*Buffer);\r
\r
- *Buffer = EfiAllocateZeroPool (BufferSize);\r
+ *Buffer = AllocateZeroPool (BufferSize);\r
\r
if (*Buffer != NULL) {\r
TryAgain = TRUE;\r
Function returns the value of the specified variable.\r
\r
\r
- @param Name - A Null-terminated Unicode string that is\r
+ @param Name A Null-terminated Unicode string that is\r
the name of the vendor's variable.\r
- @param VendorGuid - A unique identifier for the vendor.\r
+ @param VendorGuid A unique identifier for the vendor.\r
\r
@return The payload of the variable.\r
+ @retval NULL If the variable can't be read.\r
\r
**/\r
VOID *\r
\r
@param FHand The file handle.\r
\r
- @return A pointer to a buffer with file information or NULL is returned\r
+ @return A pointer to a buffer with file information.\r
+ @retval NULL is returned if failed to get Vaolume Label Info.\r
\r
**/\r
EFI_FILE_SYSTEM_VOLUME_LABEL_INFO *\r
@param Src The source.\r
\r
@return A new string which is duplicated copy of the source.\r
- @retval NULL If there is not enought memory.\r
+ @retval NULL If there is not enough memory.\r
\r
**/\r
CHAR16 *\r
UINTN Size;\r
\r
Size = StrSize (Src);\r
- Dest = EfiAllocateZeroPool (Size);\r
+ Dest = AllocateZeroPool (Size);\r
ASSERT (Dest != NULL);\r
if (Dest != NULL) {\r
CopyMem (Dest, Src, Size);\r
that exist in a device path.\r
\r
\r
- @param DevicePath - A pointer to a device path data structure.\r
+ @param DevicePath A pointer to a device path data structure.\r
\r
@return This function counts and returns the number of device path instances\r
in DevicePath.\r
@param OldSize - The size of the current buffer.\r
@param NewSize - The size of the new buffer.\r
\r
- @retval EFI_SUCEESS The requested number of bytes were allocated.\r
- @retval EFI_OUT_OF_RESOURCES The pool requested could not be allocated.\r
- @retval EFI_INVALID_PARAMETER The buffer was invalid.\r
+ @return The newly allocated buffer.\r
+ @retval NULL Allocation failed.\r
\r
**/\r
VOID *\r
\r
NewPool = NULL;\r
if (NewSize != 0) {\r
- NewPool = EfiAllocateZeroPool (NewSize);\r
+ NewPool = AllocateZeroPool (NewSize);\r
}\r
\r
if (OldPool != NULL) {\r
\r
@return A string located from the Data Hub records based on\r
the device path.\r
+ @retval NULL If failed to get the String from Data Hub.\r
\r
**/\r
UINT16 *\r