/* Frees all of the nodes in a linked list. */
VOID EFIAPI FreeList(IN LIST_ENTRY *ListHead)
/* Frees all of the nodes in a linked list. */
VOID EFIAPI FreeList(IN LIST_ENTRY *ListHead)
{
  LIST_ENTRY                      *Link;
  LIST_ENTRY                      *NextLink;
  PRM_HANDLER_CONTEXT_LIST_ENTRY  *ListEntry;
  if (ListHead == NULL) {
    return;
  }
  Link = GetFirstNode (&mPrmHandlerList);
  while (!IsNull (&mPrmHandlerList, Link)) {
    ListEntry = CR (Link, PRM_HANDLER_CONTEXT_LIST_ENTRY, Link, PRM_HANDLER_CONTEXT_LIST_ENTRY_SIGNATURE);
    NextLink  = GetNextNode (&mPrmHandlerList, Link);
    RemoveEntryList (Link);
    FreePool (ListEntry);
    Link = NextLink;
  }
}