KeSetTimerEx

UINT8 __stdcall KeSetTimerEx(_KTIMER *Timer, _LARGE_INTEGER DueTime, INT64 Period, _KDPC *Dpc){
  int v6; 
  __int64 v8; 
  UINT8 CurrentIrql; 
  struct _KPRCB *CurrentPrcb; 
  UINT8 v11; 
  __int16 v12; 
  __int16 v13; 
  UINT8 *Late; 
  UINT64 v15; 
  UINT64 Hand; 
  LODWORD(Hand) = 0;
  v6 = Period;
  v8 = KiWaitNever ^ __ROR8__(
                       (unsigned __int64)Timer ^ _byteswap_uint64((unsigned __int64)Dpc ^ KiWaitAlways),
                       KiWaitNever);
  CurrentIrql = KeGetCurrentIrql();
  __writecr8(2ui64);
  CurrentPrcb = KeGetCurrentPrcb();
  v11 = KiCancelTimer(Timer, 0);
  v12 = 1;
  if( (KiVelocityFlags & 0x2000) != 0
    && (*((_BYTE *)CurrentPrcb + 32) || !PsTimerResolutionActive(*((_QWORD *)KeGetCurrentThread() + 23))) )
  {
    v13 = v12;
  }
  else
  {
    v13 = 0;
  }
  *((_WORD *)Timer + 29) = v13;
  *((_QWORD *)Timer + 6) = v8;
  *((_DWORD *)Timer + 15) = v6;
  if( (unsigned int)KiComputeDueTime(Timer, DueTime, 0, &Hand)
    && (v15 = (unsigned int)Hand,
        *((_DWORD *)Timer + 1) = (_DWORD)Late,
        KiInsertTimerTable(CurrentPrcb, Timer, Dpc, v15, Late)) )
  {
    _InterlockedAnd((volatile signed __int32 *)Timer, 0xFFFFFF7F);
  }
  else
  {
    KiTimerWaitTest(CurrentPrcb, Timer, 0i64);
  }
  KiExitDispatcher(CurrentPrcb, 0i64, AdjustUnwait, 0i64, CurrentIrql);
  return v11;
}

Referenced by:

No references.