/* Internal worker function that returns a pointer to the  */
PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT* LookupPeriodicSmiLibraryHandler(IN EFI_HANDLE DispatchHandle OPTIONAL)
/* Internal worker function that returns a pointer to the  */
PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT* LookupPeriodicSmiLibraryHandler(IN EFI_HANDLE DispatchHandle OPTIONAL)
{
  LIST_ENTRY                            *Link;
  PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT  *PeriodicSmiLibraryHandler;
  if (DispatchHandle == NULL) {
    return GetActivePeriodicSmiLibraryHandler ();
  }
  for ( Link = GetFirstNode (&gPeriodicSmiLibraryHandlers)
        ; !IsNull (&gPeriodicSmiLibraryHandlers, Link)
        ; Link = GetNextNode (&gPeriodicSmiLibraryHandlers, Link)
        )
  {
    PeriodicSmiLibraryHandler = PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT_FROM_LINK (Link);
    if (PeriodicSmiLibraryHandler->DispatchHandle == DispatchHandle) {
      return PeriodicSmiLibraryHandler;
    }
  }
  return NULL;
}