KiSetTimerEx

VOID __stdcall KiSetTimerEx(_KTIMER *Timer, _LARGE_INTEGER DueTime, INT64 Period, UINT8 ControlFlags, _KDPC *Dpc){
  _KDPC *v7; 
  unsigned int v8; 
  _KDPC *v10; 
  struct _KPRCB *CurrentPrcb; 
  _EPROCESS *Process; 
  char v13; 
  unsigned __int16 v14; 
  UINT8 *Late; 
  UINT64 v16; 
  UINT64 Hand; 

  v7 = Dpc;
  v8 = Period;
  LODWORD(Hand) = 0;
  v10 = (_KDPC *)(KiWaitNever ^ __ROR8__(
                                  (unsigned __int64)Timer ^ _byteswap_uint64((unsigned __int64)Dpc ^ KiWaitAlways),
                                  KiWaitNever));
  Dpc = (_KDPC *)KeGetCurrentIrql();
  __writecr8(2ui64);
  CurrentPrcb = KeGetCurrentPrcb();
  KiCancelTimer(Timer, 0);
  v14 = 0;
  if( (KiVelocityFlags & 0x2000) != 0 )
  {
    if( CurrentPrcb->NestingLevel
      || ((Process = KeGetCurrentThread()->ApcState.Process, (Process->Flags & 0x1000) == 0)
       || (Process->Flags3 & 0x4000000) != 0 ? (v13 = 0) : (v13 = 1),
          !v13) )
    {
      v14 = 1;
    }
  }
  Timer->TimerType = v14;
  Timer->Dpc = v10;
  Timer->Period = v8;
  if( (unsigned int)KiComputeDueTime(Timer, DueTime, ControlFlags, &Hand)
    && (v16 = (unsigned int)Hand,
        *(_DWORD *)&Timer->gap0[4] = (_DWORD)Late,
        KiInsertTimerTable(CurrentPrcb, Timer, v7, v16, Late)) )
  {
    _InterlockedAnd((volatile signed __int32 *)Timer, 0xFFFFFF7F);
  }
  else
  {
    KiTimerWaitTest(CurrentPrcb, Timer, 0i64);
  }
  KiExitDispatcher(CurrentPrcb, 0i64, AdjustUnwait, 0i64, (UINT8)Dpc);
}

Referenced by:

CcScheduleLazyWriteScan
CmFreezeRegistry
CmSetLazyFlushState
CmpCmdInit
CmpLazyCommitWorker
CmpQueueLazyCommitWorker
DbgkpWerDeferredWriteRoutine
ExpRefreshTimeZoneInformation
HalpCmcStartPolling
HalpInitGenericErrorSourcePollingRoutine
HalpTimerSchedulePeriodicQueries
IopDeviceRemovalForResetComplete
KdpTimeSlipWork
KeSetCoalescableTimer
KiInvokeInterruptServiceRoutine
MiInsertUnusedSegment
MiProcessDeleteOnClose
PfSnBeginBootPhase
PfSnInitializePrefetcher
PfSnPowerBoost
PfSnQueueEnablePrefetcherTimer
PfSnStartTraceTimer
PfSnTraceTimerRoutine
PfpServiceMainThreadBoost
PfpStartLoggingHardFaultEvents
PiDrvDbUnloadNode
PoUserShutdownInitiated
PopBatteryWorker
PopBuildDeviceNotifyList
PopCoalescingSetTimer
PopEnableIrpWatchdog
PopHandleWakeSources
PopQueueBatteryStatusTimeout
PopSetExecutionRequiredTimer
PopSetPowerActionWatchdogState
PopSetSystemAwayMode
PopSetWatchdog
PopUserPresentSetWorker
PpmEndHighPerfRequest
PpmWmiDispatch
TtmpResetEvaluationTimer
VfWdCheckForSettingsChange
ViPendingDelayCompletion
ViShutdownScheduleWatchdog
ViWdIrpTimerDpcRoutine
VslpSkFlushBufferCallback
VslpSkStartProfiling