mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 17:34:57 +00:00
apc test
svn path=/trunk/; revision=6516
This commit is contained in:
parent
bf68eefdd1
commit
c215a03581
3 changed files with 79 additions and 0 deletions
6
reactos/apps/tests/apc2/.cvsignore
Normal file
6
reactos/apps/tests/apc2/.cvsignore
Normal file
|
@ -0,0 +1,6 @@
|
|||
*.o
|
||||
*.d
|
||||
*.exe
|
||||
*.coff
|
||||
*.sym
|
||||
*.map
|
52
reactos/apps/tests/apc2/apc2.c
Normal file
52
reactos/apps/tests/apc2/apc2.c
Normal file
|
@ -0,0 +1,52 @@
|
|||
|
||||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
|
||||
VOID CALLBACK TimerApcProc(
|
||||
LPVOID lpArg,
|
||||
DWORD dwTimerLowValue,
|
||||
DWORD dwTimerHighValue )
|
||||
{
|
||||
printf("APC Callback %i\n", *(PDWORD)lpArg);
|
||||
}
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
HANDLE hTimer;
|
||||
BOOL bSuccess;
|
||||
LARGE_INTEGER DueTime;
|
||||
DWORD value = 1;
|
||||
|
||||
hTimer = CreateWaitableTimer(NULL, FALSE, NULL );
|
||||
|
||||
if (!hTimer)
|
||||
{
|
||||
printf("CreateWaitableTimer failed!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
DueTime.QuadPart = -(LONGLONG)(5 * 10000000);
|
||||
|
||||
bSuccess = SetWaitableTimer(
|
||||
hTimer,
|
||||
&DueTime,
|
||||
2000 /*interval*/,
|
||||
TimerApcProc,
|
||||
&value /*callback argument*/,
|
||||
FALSE );
|
||||
|
||||
if (!bSuccess)
|
||||
{
|
||||
printf("SetWaitableTimer failed!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (;value <= 10; value++ )
|
||||
{
|
||||
SleepEx(INFINITE, TRUE /*alertable*/ );
|
||||
}
|
||||
|
||||
CloseHandle( hTimer );
|
||||
return 0;
|
||||
}
|
21
reactos/apps/tests/apc2/makefile
Normal file
21
reactos/apps/tests/apc2/makefile
Normal file
|
@ -0,0 +1,21 @@
|
|||
|
||||
|
||||
PATH_TO_TOP = ../../..
|
||||
|
||||
TARGET_NORC = yes
|
||||
|
||||
TARGET_TYPE = program
|
||||
|
||||
TARGET_APPTYPE = console
|
||||
|
||||
TARGET_NAME = apc2
|
||||
|
||||
TARGET_SDKLIBS = ntdll.a kernel32.a
|
||||
|
||||
TARGET_OBJECTS = $(TARGET_NAME).o
|
||||
|
||||
include $(PATH_TO_TOP)/rules.mak
|
||||
|
||||
include $(TOOLS_PATH)/helper.mk
|
||||
|
||||
# EOF
|
Loading…
Reference in a new issue