ReactOS 0.4.15-dev-7924-g5949c20
apc2.c File Reference
#include <windows.h>
#include <stdio.h>
Include dependency graph for apc2.c:

Go to the source code of this file.

Functions

VOID CALLBACK TimerApcProc (LPVOID lpArg, DWORD dwTimerLowValue, DWORD dwTimerHighValue)
 
int main ()
 

Function Documentation

◆ main()

int main ( void  )

Definition at line 14 of file apc2.c.

15{
16 HANDLE hTimer;
19 DWORD value = 1;
20
22
23 if (!hTimer)
24 {
25 printf("CreateWaitableTimer failed!\n");
26 return 0;
27 }
28
29 DueTime.QuadPart = -(LONGLONG)(5 * 10000000);
30
32 hTimer,
33 &DueTime,
34 2001 /*interval (using an odd number to be able to find it easy in kmode) */,
36 &value /*callback argument*/,
37 FALSE );
38
39 if (!bSuccess)
40 {
41 printf("SetWaitableTimer failed!\n");
42 return 0;
43 }
44
45 for (;value <= 10; value++ )
46 {
47 SleepEx(INFINITE, TRUE /*alertable*/ );
48 }
49
50 CloseHandle( hTimer );
51 return 0;
52}
VOID CALLBACK TimerApcProc(LPVOID lpArg, DWORD dwTimerLowValue, DWORD dwTimerHighValue)
Definition: apc2.c:5
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define CloseHandle
Definition: compat.h:739
static BOOLEAN bSuccess
Definition: drive.cpp:433
#define INFINITE
Definition: serial.h:102
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
#define printf
Definition: freeldr.h:93
DWORD WINAPI SleepEx(IN DWORD dwMilliseconds, IN BOOL bAlertable)
Definition: synch.c:802
BOOL WINAPI SetWaitableTimer(IN HANDLE hTimer, IN const LARGE_INTEGER *pDueTime, IN LONG lPeriod, IN PTIMERAPCROUTINE pfnCompletionRoutine OPTIONAL, IN OPTIONAL LPVOID lpArgToCompletionRoutine, IN BOOL fResume)
Definition: synch.c:382
int64_t LONGLONG
Definition: typedefs.h:68
Definition: pdh_main.c:94
_In_ WDFTIMER _In_ LONGLONG DueTime
Definition: wdftimer.h:190
#define CreateWaitableTimer
Definition: winbase.h:3761

◆ TimerApcProc()

VOID CALLBACK TimerApcProc ( LPVOID  lpArg,
DWORD  dwTimerLowValue,
DWORD  dwTimerHighValue 
)

Definition at line 5 of file apc2.c.

9{
10 printf("APC Callback %lu\n", *(PDWORD)lpArg);
11}
DWORD * PDWORD
Definition: pedump.c:68

Referenced by main().