/* This function disables a periodic SMI handler that has been previously enabled with  */
BOOLEAN EFIAPI PeriodicSmiDisable(IN EFI_HANDLE DispatchHandle OPTIONAL)
/* This function disables a periodic SMI handler that has been previously enabled with  */
BOOLEAN EFIAPI PeriodicSmiDisable(IN EFI_HANDLE DispatchHandle OPTIONAL)
{
  PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT  *PeriodicSmiLibraryHandler;
  EFI_STATUS                            Status;
  PeriodicSmiLibraryHandler = LookupPeriodicSmiLibraryHandler (DispatchHandle);
  if (PeriodicSmiLibraryHandler == NULL) {
    return FALSE;
  }
  Status = gSmmPeriodicTimerDispatch2->UnRegister (
                                         gSmmPeriodicTimerDispatch2,
                                         PeriodicSmiLibraryHandler->DispatchHandle
                                         );
  if (EFI_ERROR (Status)) {
    return FALSE;
  }
  PeriodicSmiLibraryHandler->DispatchHandle = NULL;
  if (PeriodicSmiLibraryHandler != GetActivePeriodicSmiLibraryHandler ()) {
    ReclaimPeriodicSmiLibraryHandler (PeriodicSmiLibraryHandler);
  }
  return TRUE;
}