NtSetTimer - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTEXAPI_H
#if (PHNT_MODE != PHNT_MODE_KERNEL)

NTSYSCALLAPI
NTSTATUS
NTAPI
NtSetTimer(
    _In_ HANDLE TimerHandle,
    _In_ PLARGE_INTEGER DueTime,
    _In_opt_ PTIMER_APC_ROUTINE TimerApcRoutine,
    _In_opt_ PVOID TimerContext,
    _In_ BOOLEAN ResumeTimer,
    _In_opt_ LONG Period,
    _Out_opt_ PBOOLEAN PreviousState
    );

#endif
#endif

View code on GitHub
#ifndef _NTZWAPI_H

NTSYSCALLAPI
NTSTATUS
NTAPI
ZwSetTimer(
    _In_ HANDLE TimerHandle,
    _In_ PLARGE_INTEGER DueTime,
    _In_opt_ PTIMER_APC_ROUTINE TimerApcRoutine,
    _In_opt_ PVOID TimerContext,
    _In_ BOOLEAN ResumeTimer,
    _In_opt_ LONG Period,
    _Out_opt_ PBOOLEAN PreviousState
    );

#endif

View code on GitHub

TimerHandle

HANDLE to Timer Object opened with TIMER_MODIFY_STATE access.

DueTime

Time when timer should be set, in 100ns units. If it is negative value, it means relative time.

TimerApcRoutine

User's APC routine, defined as follows:

typedef void (*PTIMER_APC_ROUTINE)(
        IN PVOID TimerContext,
        IN ULONG TimerLowValue,
        IN LONG TimerHighValue
        );

TimerContext

Optional parameter to TimerApcRoutine.

ResumeTimer

If set, Power Management restores system to normal mode when timer is signaled.

Period

If zero, timer is set only once. Else will be set periodic in time intervals defined in Period value (in 100ms units).

PreviousState

Optional pointer to value receiving state of Timer Object before NtSetTimer call.

Documented by

See also