ReactOS  0.4.15-dev-3316-g067ca88
tmrqueue.c File Reference
#include <windows.h>
#include <stdio.h>
#include <tchar.h>
Include dependency graph for tmrqueue.c:

Go to the source code of this file.

Classes

struct  _TEST
 
struct  _TESTINFO
 

Macros

#define N_TIMEOUT   3
 

Typedefs

typedef struct _TESTPTEST
 
typedef VOID(* PFNTEST) (PTEST Test, HANDLE hEvent)
 
typedef struct _TEST TEST
 
typedef struct _TESTINFO TESTINFO
 
typedef struct _TESTINFOPTESTINFO
 

Functions

VOID RunTests (VOID)
 
VOID PrintTestResults (VOID)
 
VOID CALLBACK TimerCallback1 (PVOID Param, BOOLEAN Fired)
 
VOID Test1 (PTEST Test, HANDLE hEvent)
 
VOID CALLBACK TimerCallback2 (PVOID Param, BOOLEAN Fired)
 
VOID Test2 (PTEST Test, HANDLE hEvent)
 
VOID CALLBACK TimerCallback3 (PVOID Param, BOOLEAN Fired)
 
VOID Test3 (PTEST Test, HANDLE hEvent)
 
VOID InitTests (VOID)
 
int main (int argc, char *argv[])
 

Variables

static TEST Tests [3]
 

Macro Definition Documentation

◆ N_TIMEOUT

#define N_TIMEOUT   3

Definition at line 5 of file tmrqueue.c.

Typedef Documentation

◆ PFNTEST

typedef VOID(* PFNTEST) (PTEST Test, HANDLE hEvent)

Definition at line 11 of file tmrqueue.c.

◆ PTEST

typedef struct _TEST* PTEST

Definition at line 9 of file tmrqueue.c.

◆ PTESTINFO

◆ TEST

typedef struct _TEST TEST

◆ TESTINFO

Function Documentation

◆ InitTests()

VOID InitTests ( VOID  )

Definition at line 338 of file tmrqueue.c.

339 {
340  ZeroMemory(Tests, sizeof(Tests));
341 
342  Tests[0].description = _T("non-blocking DeleteTimerQueueTimer() call from callback");
343  Tests[0].Routine = Test1;
344 
345  Tests[1].description = _T("blocking DeleteTimerQueueTimer() call");
346  Tests[1].Routine = Test2;
347 
348  Tests[2].description = _T("blocking DeleteTimerQueueTimer() call with specified event");
349  Tests[2].Routine = Test3;
350 }
#define ZeroMemory
Definition: winbase.h:1664
static TEST Tests[3]
Definition: tmrqueue.c:21
VOID Test3(PTEST Test, HANDLE hEvent)
Definition: tmrqueue.c:266
VOID Test1(PTEST Test, HANDLE hEvent)
Definition: tmrqueue.c:155
#define _T(x)
Definition: vfdio.h:22
VOID Test2(PTEST Test, HANDLE hEvent)
Definition: tmrqueue.c:192

Referenced by main().

◆ main()

int main ( int argc  ,
char argv[] 
)

hosttype.c Copyright (C) 2002 by Brian Palmer brian.nosp@m.p@sg.nosp@m.inet..nosp@m.com

Definition at line 352 of file tmrqueue.c.

353 {
354  _tprintf(_T("+++ TimerQueue test running +++\n\n"));
355 
356  InitTests();
357 
358  RunTests();
359 
360  _tprintf(_T("\n+++ RESULTS +++\n"));
361 
363 
364  return 0;
365 }
VOID RunTests(VOID)
Definition: tmrqueue.c:23
#define _tprintf
Definition: tchar.h:506
VOID InitTests(VOID)
Definition: tmrqueue.c:338
#define _T(x)
Definition: vfdio.h:22
VOID PrintTestResults(VOID)
Definition: tmrqueue.c:58

◆ PrintTestResults()

VOID PrintTestResults ( VOID  )

Definition at line 58 of file tmrqueue.c.

59 {
60  int i, nTests, nsuccess = 0, nfailed = 0;
61  TCHAR *status;
62 
63  nTests = sizeof(Tests) / sizeof(TEST);
64 
65  for(i = 0; i < nTests; i++)
66  {
67  if(Tests[i].Routine == NULL)
68  {
69  status = _T("SKIPPED");
70  }
71  else if(Tests[i].Result == TRUE)
72  {
73  status = _T("SUCCESS");
74  nsuccess++;
75  }
76  else
77  {
78  status = _T("FAILED ");
79  nfailed++;
80  }
81 
82  _tprintf(_T("Test %d: %s %s\n"), i, status, Tests[i].description);
83  }
84 
85  _tprintf(_T("\nTests succeeded: %d, failed: %d\n"), nsuccess, nfailed);
86  if(nfailed == 0)
87  {
88  _tprintf(_T(" ALL TESTS SUCCESSFUL!\n"));
89  }
90 }
#define _tprintf
Definition: tchar.h:506
#define TRUE
Definition: types.h:120
const char * description
Definition: directx.c:2497
static TEST Tests[3]
Definition: tmrqueue.c:21
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
char TCHAR
Definition: xmlstorage.h:189
#define _T(x)
Definition: vfdio.h:22
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
Definition: comm.c:64
#define NULL
Definition: types.h:112
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

Referenced by main().

◆ RunTests()

VOID RunTests ( VOID  )

Definition at line 23 of file tmrqueue.c.

24 {
25  int i, nTests;
26  static HANDLE hEvent;
27 
29  if(hEvent == NULL)
30  {
31  _tprintf(_T("Unable to create event!"));
32  return;
33  }
34 
35  nTests = sizeof(Tests) / sizeof(TEST);
36 
37  for(i = 0; i < nTests; i++)
38  {
39  Tests[i].id = i + 1;
40 
41  if(Tests[i].Routine == NULL)
42  {
43  continue;
44  }
45 
46  _tprintf(_T("+++ TEST %d: %s\n"), Tests[i].id, Tests[i].description);
47 
48  Tests[i].Routine(&Tests[i], hEvent);
49 
51 
52  _tprintf(_T("\n\n"));
53  }
54 
56 }
#define CreateEvent
Definition: winbase.h:3604
#define _tprintf
Definition: tchar.h:506
#define CloseHandle
Definition: compat.h:598
const char * description
Definition: directx.c:2497
static HANDLE hEvent
Definition: comm.c:54
static TEST Tests[3]
Definition: tmrqueue.c:21
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define FALSE
Definition: types.h:117
#define _T(x)
Definition: vfdio.h:22
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
Definition: comm.c:64
#define NULL
Definition: types.h:112
#define INFINITE
Definition: serial.h:102

Referenced by main().

◆ Test1()

VOID Test1 ( PTEST  Test,
HANDLE  hEvent 
)

Definition at line 155 of file tmrqueue.c.

156 {
157  static TESTINFO Info;
158 
159  Info.Test = Test;
160  Info.hEvent = hEvent;
161  Info.secsleft = N_TIMEOUT;
162 
163  if(!CreateTimerQueueTimer(&Info.hTimer, NULL, TimerCallback1, &Info, 1000, 1000, 0))
164  {
165  _tprintf(_T("[%d]CreateTimerQueueTimer() failed, LastError: %d!"), (int)Info.Test->id, (int)GetLastError());
166  /* we failed, set the event to continue tests */
167  SetEvent(hEvent);
168  return;
169  }
170 
171  _tprintf(_T("[%d]CreateTimerQueueTimer() created timer 0x%x, countdown (%d sec)...\n"), (int)Info.Test->id, (int)Info.hTimer, (int)Info.secsleft);
172 }
#define N_TIMEOUT
Definition: tmrqueue.c:5
#define _tprintf
Definition: tchar.h:506
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
static HANDLE hEvent
Definition: comm.c:54
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
VOID CALLBACK TimerCallback1(PVOID Param, BOOLEAN Fired)
Definition: tmrqueue.c:119
#define _T(x)
Definition: vfdio.h:22
#define NULL
Definition: types.h:112
BOOL WINAPI CreateTimerQueueTimer(OUT PHANDLE phNewTimer, IN HANDLE TimerQueue, IN WAITORTIMERCALLBACK Callback, IN PVOID Parameter, IN DWORD DueTime, IN DWORD Period, IN ULONG Flags)
Definition: timerqueue.c:138
int Test
Definition: ehthrow.cxx:21

Referenced by InitTests(), and SymlinkCreateTests().

◆ Test2()

VOID Test2 ( PTEST  Test,
HANDLE  hEvent 
)

Definition at line 192 of file tmrqueue.c.

193 {
194  static TESTINFO Info;
195  BOOL stat;
196 
197  Info.Test = Test;
198  Info.hEvent = hEvent;
199  Info.secsleft = N_TIMEOUT;
200 
201  Info.Test2.hWaitEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
202  if(Info.Test2.hWaitEvent == NULL)
203  {
204  _tprintf(_T("[%d]Unable to create event!\n"), (int)Info.Test->id);
205  return;
206  }
207 
208  if(!CreateTimerQueueTimer(&Info.hTimer, NULL, TimerCallback2, &Info, 1000, 1000, 0))
209  {
210  _tprintf(_T("[%d]CreateTimerQueueTimer() failed, LastError: %d!"), (int)Info.Test->id, (int)GetLastError());
211 
212  CloseHandle(Info.Test2.hWaitEvent);
213  /* we failed, set the event to continue tests */
214  SetEvent(hEvent);
215  return;
216  }
217 
218  _tprintf(_T("[%d]CreateTimerQueueTimer() created timer 0x%x, countdown (%d sec)...\n"), (int)Test->id, (int)Info.hTimer, (int)Info.secsleft);
219 
220  WaitForSingleObject(Info.Test2.hWaitEvent, INFINITE);
221 
222  _tprintf(_T("[%d]Timout finished, delete timer queue..."), (int)Test->id);
224  if(stat)
225  {
226  _tprintf(_T("OK\n"));
227  /* this test is only successful in this case */
228  Test->Result = TRUE;
229  }
230  else
231  {
232  int error = GetLastError();
233 
234  switch(error)
235  {
236  case ERROR_IO_PENDING:
237  _tprintf(_T("FAILED, Overlapped I/O operation in progress\n"));
238  break;
239  default:
240  _tprintf(_T("Failed, LastError: %d\n"), (int)GetLastError());
241  break;
242  }
243  }
244 
245  SetEvent(Info.hEvent);
246 }
#define CreateEvent
Definition: winbase.h:3604
#define N_TIMEOUT
Definition: tmrqueue.c:5
#define _tprintf
Definition: tchar.h:506
#define CloseHandle
Definition: compat.h:598
#define error(str)
Definition: mkdosfs.c:1605
#define TRUE
Definition: types.h:120
#define INVALID_HANDLE_VALUE
Definition: compat.h:590
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
#define ERROR_IO_PENDING
Definition: dderror.h:15
static HANDLE hEvent
Definition: comm.c:54
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define _T(x)
Definition: vfdio.h:22
VOID CALLBACK TimerCallback2(PVOID Param, BOOLEAN Fired)
Definition: tmrqueue.c:176
Definition: stat.h:55
_CRTIMP int __cdecl stat(const char *_Filename, struct stat *_Stat)
Definition: stat.h:345
BOOL WINAPI DeleteTimerQueueTimer(IN HANDLE TimerQueue, IN HANDLE Timer, IN HANDLE CompletionEvent)
Definition: timerqueue.c:240
#define NULL
Definition: types.h:112
BOOL WINAPI CreateTimerQueueTimer(OUT PHANDLE phNewTimer, IN HANDLE TimerQueue, IN WAITORTIMERCALLBACK Callback, IN PVOID Parameter, IN DWORD DueTime, IN DWORD Period, IN ULONG Flags)
Definition: timerqueue.c:138
#define INFINITE
Definition: serial.h:102
int Test
Definition: ehthrow.cxx:21

Referenced by InitTests().

◆ Test3()

VOID Test3 ( PTEST  Test,
HANDLE  hEvent 
)

Definition at line 266 of file tmrqueue.c.

267 {
268  static TESTINFO Info;
269  BOOL stat;
270 
271  Info.Test = Test;
272  Info.hEvent = hEvent;
273  Info.secsleft = N_TIMEOUT;
274 
275  Info.Test3.hWaitEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
276  if(Info.Test3.hWaitEvent == NULL)
277  {
278  _tprintf(_T("[%d]Unable to create event!\n"), (int)Info.Test->id);
279  return;
280  }
281 
282  Info.Test3.hNotification = CreateEvent(NULL, FALSE, FALSE, NULL);
283  if(Info.Test3.hNotification == NULL)
284  {
285  _tprintf(_T("[%d]Unable to create notification event!\n"), (int)Info.Test->id);
286  return;
287  }
288 
289  if(!CreateTimerQueueTimer(&Info.hTimer, NULL, TimerCallback3, &Info, 1000, 1000, 0))
290  {
291  _tprintf(_T("[%d]CreateTimerQueueTimer() failed, LastError: %d!"), (int)Info.Test->id, (int)GetLastError());
292 
293  CloseHandle(Info.Test3.hWaitEvent);
294  CloseHandle(Info.Test3.hNotification);
295  /* we failed, set the event to continue tests */
296  SetEvent(hEvent);
297  return;
298  }
299 
300  _tprintf(_T("[%d]CreateTimerQueueTimer() created timer 0x%x, countdown (%d sec)...\n"), (int)Test->id, (int)Info.hTimer, (int)Info.secsleft);
301 
302  WaitForSingleObject(Info.Test3.hWaitEvent, INFINITE);
303 
304  _tprintf(_T("[%d]Timout finished, delete timer queue..."), (int)Test->id);
305  stat = DeleteTimerQueueTimer(NULL, Info.hTimer, Info.Test3.hNotification);
306  if(stat)
307  {
308  _tprintf(_T("returned OK -> test FAILED!\n"));
309  }
310  else
311  {
312  int error = GetLastError();
313 
314  switch(error)
315  {
316  case ERROR_IO_PENDING:
317  _tprintf(_T("OK, Overlapped I/O operation in progress\n"));
318  /* this test is only successful in this case */
319  Test->Result = TRUE;
320  break;
321  default:
322  _tprintf(_T("Failed, LastError: %d\n"), (int)GetLastError());
323  break;
324  }
325  }
326 
327  WaitForSingleObject(Info.Test3.hNotification, INFINITE);
328 
329  CloseHandle(Info.Test3.hWaitEvent);
330  CloseHandle(Info.Test3.hNotification);
331 
332  SetEvent(Info.hEvent);
333 }
#define CreateEvent
Definition: winbase.h:3604
#define N_TIMEOUT
Definition: tmrqueue.c:5
#define _tprintf
Definition: tchar.h:506
#define CloseHandle
Definition: compat.h:598
#define error(str)
Definition: mkdosfs.c:1605
#define TRUE
Definition: types.h:120
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
#define ERROR_IO_PENDING
Definition: dderror.h:15
static HANDLE hEvent
Definition: comm.c:54
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
VOID CALLBACK TimerCallback3(PVOID Param, BOOLEAN Fired)
Definition: tmrqueue.c:250
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define _T(x)
Definition: vfdio.h:22
Definition: stat.h:55
_CRTIMP int __cdecl stat(const char *_Filename, struct stat *_Stat)
Definition: stat.h:345
BOOL WINAPI DeleteTimerQueueTimer(IN HANDLE TimerQueue, IN HANDLE Timer, IN HANDLE CompletionEvent)
Definition: timerqueue.c:240
#define NULL
Definition: types.h:112
BOOL WINAPI CreateTimerQueueTimer(OUT PHANDLE phNewTimer, IN HANDLE TimerQueue, IN WAITORTIMERCALLBACK Callback, IN PVOID Parameter, IN DWORD DueTime, IN DWORD Period, IN ULONG Flags)
Definition: timerqueue.c:138
#define INFINITE
Definition: serial.h:102
int Test
Definition: ehthrow.cxx:21

Referenced by InitTests(), MainWndProc(), and SymlinkCreateTests().

◆ TimerCallback1()

VOID CALLBACK TimerCallback1 ( PVOID  Param,
BOOLEAN  Fired 
)

Definition at line 119 of file tmrqueue.c.

120 {
121  PTESTINFO Info = (PTESTINFO)Param;
122 
123  _tprintf(_T("[%d]TimerCallback(0x%x, %d) called (%d)\n"), (int)Info->Test->id, (int)Info->hTimer, (int)Fired, --Info->secsleft);
124 
125  if(Info->secsleft == 0)
126  {
127  BOOL stat;
128 
129  _tprintf(_T("[%d]Timout finished, delete timer queue..."), (int)Info->Test->id);
130  stat = DeleteTimerQueueTimer(NULL, Info->hTimer, NULL);
131  if(stat)
132  _tprintf(_T("returned OK -> test FAILED!\n"));
133  else
134  {
135  int error = GetLastError();
136 
137  switch(error)
138  {
139  case ERROR_IO_PENDING:
140  _tprintf(_T("OK, Overlapped I/O operation in progress\n"));
141  /* this test is only successful in this case */
142  Info->Test->Result = TRUE;
143  break;
144  default:
145  _tprintf(_T("Failed, LastError: %d\n"), (int)GetLastError());
146  break;
147  }
148  }
149 
150  /* set the event to continue tests */
151  SetEvent(Info->hEvent);
152  }
153 }
#define _tprintf
Definition: tchar.h:506
#define error(str)
Definition: mkdosfs.c:1605
#define TRUE
Definition: types.h:120
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
#define ERROR_IO_PENDING
Definition: dderror.h:15
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
unsigned int BOOL
Definition: ntddk_ex.h:94
struct _TESTINFO * PTESTINFO
#define _T(x)
Definition: vfdio.h:22
Definition: stat.h:55
_CRTIMP int __cdecl stat(const char *_Filename, struct stat *_Stat)
Definition: stat.h:345
BOOL WINAPI DeleteTimerQueueTimer(IN HANDLE TimerQueue, IN HANDLE Timer, IN HANDLE CompletionEvent)
Definition: timerqueue.c:240
#define NULL
Definition: types.h:112

Referenced by Test1().

◆ TimerCallback2()

VOID CALLBACK TimerCallback2 ( PVOID  Param,
BOOLEAN  Fired 
)

Definition at line 176 of file tmrqueue.c.

177 {
178  PTESTINFO Info = (PTESTINFO)Param;
179 
180  _tprintf(_T("[%d]TimerCallback(0x%x, %d) called (%d)\n"), (int)Info->Test->id, (int)Info->hTimer, (int)Fired, --Info->secsleft);
181 
182  if(Info->secsleft == 0)
183  {
184  /* set the event to continue tests */
185  SetEvent(Info->Test2.hWaitEvent);
186 
187  /* sleep a bit */
188  Sleep(1500);
189  }
190 }
#define _tprintf
Definition: tchar.h:506
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
struct _TESTINFO * PTESTINFO
#define _T(x)
Definition: vfdio.h:22

Referenced by Test2().

◆ TimerCallback3()

VOID CALLBACK TimerCallback3 ( PVOID  Param,
BOOLEAN  Fired 
)

Definition at line 250 of file tmrqueue.c.

251 {
252  PTESTINFO Info = (PTESTINFO)Param;
253 
254  _tprintf(_T("[%d]TimerCallback(0x%x, %d) called (%d)\n"), (int)Info->Test->id, (int)Info->hTimer, (int)Fired, --Info->secsleft);
255 
256  if(Info->secsleft == 0)
257  {
258  /* set the event to continue tests */
259  SetEvent(Info->Test3.hWaitEvent);
260 
261  /* sleep a bit */
262  Sleep(1500);
263  }
264 }
#define _tprintf
Definition: tchar.h:506
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
struct _TESTINFO * PTESTINFO
#define _T(x)
Definition: vfdio.h:22

Referenced by Test3().

Variable Documentation

◆ Tests

TEST Tests[3]
static

Definition at line 21 of file tmrqueue.c.

Referenced by InitTests(), PrintTestResults(), and RunTests().