/* Allocate page and record the information in PagesRecord */
VOID* EFIAPI RecordAllocatePages(IN ALLOCATE_PAGE_RECORDS *PagesRecord, IN UINTN Pages)
/* Allocate page and record the information in PagesRecord */
VOID* EFIAPI RecordAllocatePages(IN ALLOCATE_PAGE_RECORDS *PagesRecord, IN UINTN Pages)
{
  VOID  *Buffer;
  Buffer = NULL;
  if (PagesRecord->Count < PagesRecord->MaxCount) {
    Buffer                                          = AllocatePages (Pages);
    PagesRecord->Records[PagesRecord->Count].Buffer = Buffer;
    PagesRecord->Records[PagesRecord->Count].Pages  = Pages;
    PagesRecord->Count++;
  }
  ASSERT (Buffer != NULL);
  return Buffer;
}