/* Internal worker function that returns a free entry for a new periodic SMI handler. If no free entries are available, then additional entries are allocated. */
PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT* FindFreePeriodicSmiLibraryHandler(VOID)
/* Internal worker function that returns a free entry for a new periodic SMI handler. If no free entries are available, then additional entries are allocated. */
PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT* FindFreePeriodicSmiLibraryHandler(VOID)
{
  PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT  *PeriodicSmiLibraryHandler;
  if (IsListEmpty (&gFreePeriodicSmiLibraryHandlers)) {
    if (!EnlargeFreePeriodicSmiLibraryHandlerList ()) {
      return NULL;
    }
  }
  PeriodicSmiLibraryHandler = PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT_FROM_LINK (
                                GetFirstNode (&gFreePeriodicSmiLibraryHandlers)
                                );
  RemoveEntryList (&PeriodicSmiLibraryHandler->Link);
  InsertTailList (&gPeriodicSmiLibraryHandlers, &PeriodicSmiLibraryHandler->Link);
  return PeriodicSmiLibraryHandler;
}