/* If Buffer was not allocated with an aligned page allocation function in the Memory Allocation Library, then ASSERT(). If Pages is zero, then ASSERT(). */
VOID EFIAPI FreeAlignedPages(IN VOID *Buffer, IN UINTN Pages)
/* If Buffer was not allocated with an aligned page allocation function in the Memory Allocation Library, then ASSERT(). If Pages is zero, then ASSERT(). */
VOID EFIAPI FreeAlignedPages(IN VOID *Buffer, IN UINTN Pages)
{
  PAGE_HEAD  *PageHeadPtr;
  PageHeadPtr = (VOID *)((UINTN)Buffer - sizeof (PAGE_HEAD));
  if (PageHeadPtr->Signature != PAGE_HEAD_PRIVATE_SIGNATURE) {
    return;
  }
  if (PageHeadPtr->AlignedPages != Pages) {
    return;
  }
  PageHeadPtr->Signature = 0;
  free (PageHeadPtr->AllocatedBufffer);
}