ReactOS  0.4.14-dev-390-g34947ad
timer.c File Reference
#include "wine/test.h"
#include "winbase.h"
Include dependency graph for timer.c:

Go to the source code of this file.

Macros

#define _WIN32_WINNT   0x0501
 

Functions

static void test_timer (void)
 
 START_TEST (timer)
 

Macro Definition Documentation

◆ _WIN32_WINNT

#define _WIN32_WINNT   0x0501

Definition at line 22 of file timer.c.

Function Documentation

◆ START_TEST()

START_TEST ( timer  )

Definition at line 73 of file timer.c.

74 {
75  test_timer();
76 }
static void test_timer(void)
Definition: timer.c:29

◆ test_timer()

static void test_timer ( void  )
static

Definition at line 29 of file timer.c.

30 {
31  HANDLE (WINAPI *pCreateWaitableTimerA)( SECURITY_ATTRIBUTES*, BOOL, LPSTR );
32  BOOL (WINAPI *pSetWaitableTimer)(HANDLE, LARGE_INTEGER*, LONG, PTIMERAPCROUTINE, LPVOID, BOOL);
33  HMODULE hker = GetModuleHandleA("kernel32.dll");
34  HANDLE handle;
35  BOOL r;
36  LARGE_INTEGER due;
37 
38  pCreateWaitableTimerA = (void*)GetProcAddress( hker, "CreateWaitableTimerA");
39  if( !pCreateWaitableTimerA )
40  {
41  win_skip("CreateWaitableTimerA is not available\n");
42  return;
43  }
44 
45  pSetWaitableTimer = (void*)GetProcAddress( hker, "SetWaitableTimer");
46  if( !pSetWaitableTimer )
47  {
48  win_skip("SetWaitableTimer is not available\n");
49  return;
50  }
51 
52  /* try once with a positive number */
53  handle = pCreateWaitableTimerA( NULL, 0, NULL );
54  ok( handle != NULL, "failed to create waitable timer with no name\n" );
55 
56  due.QuadPart = 10000;
57  r = pSetWaitableTimer( handle, &due, 0x1f4, NULL, NULL, FALSE );
58  ok( r, "failed to set timer\n");
59 
61 
62  /* try once with a negative number */
63  handle = pCreateWaitableTimerA( NULL, 0, NULL );
64  ok( handle != NULL, "failed to create waitable timer with no name\n" );
65 
66  due.QuadPart = -10000;
67  r = pSetWaitableTimer( handle, &due, 0x1f4, NULL, NULL, FALSE );
68  ok( r, "failed to set timer\n");
69 
71 }
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
#define CloseHandle
Definition: compat.h:406
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
char * LPSTR
Definition: xmlstorage.h:182
#define BOOL
Definition: nt_native.h:43
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
void(CALLBACK * PTIMERAPCROUTINE)(PVOID, DWORD, DWORD)
Definition: winbase.h:1415
#define WINAPI
Definition: msvc.h:8
PVOID HANDLE
Definition: typedefs.h:71
#define LPVOID
Definition: nt_native.h:45
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:821
#define ok(value,...)
Definition: atltest.h:57
#define GetProcAddress(x, y)
Definition: compat.h:418
#define win_skip
Definition: test.h:141
LONGLONG QuadPart
Definition: typedefs.h:112

Referenced by START_TEST().