svn path=/trunk/; revision=6516
This commit is contained in:
Gunnar Dalsnes 2003-11-03 00:34:43 +00:00
parent bf68eefdd1
commit c215a03581
3 changed files with 79 additions and 0 deletions

View file

@ -0,0 +1,6 @@
*.o
*.d
*.exe
*.coff
*.sym
*.map

View 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;
}

View 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