#include <windows.h>
#include <stdio.h>
#include <tchar.h>
Go to the source code of this file.
◆ N_TIMEOUT
◆ PFNTEST
◆ PTEST
◆ PTESTINFO
◆ TEST
◆ TESTINFO
◆ InitTests()
Definition at line 338 of file tmrqueue.c.
339{
341
342 Tests[0].description =
_T(
"non-blocking DeleteTimerQueueTimer() call from callback");
344
345 Tests[1].description =
_T(
"blocking DeleteTimerQueueTimer() call");
347
348 Tests[2].description =
_T(
"blocking DeleteTimerQueueTimer() call with specified event");
350}
VOID Test3(PTEST Test, HANDLE hEvent)
Referenced by main().
◆ main()
Definition at line 352 of file tmrqueue.c.
353{
354 _tprintf(
_T(
"+++ TimerQueue test running +++\n\n"));
355
357
359
361
363
364 return 0;
365}
VOID PrintTestResults(VOID)
◆ PrintTestResults()
Definition at line 58 of file tmrqueue.c.
59{
60 int i, nTests, nsuccess = 0, nfailed = 0;
62
64
65 for(
i = 0;
i < nTests;
i++)
66 {
68 {
70 }
72 {
74 nsuccess++;
75 }
76 else
77 {
79 nfailed++;
80 }
81
83 }
84
85 _tprintf(
_T(
"\nTests succeeded: %d, failed: %d\n"), nsuccess, nfailed);
86 if(nfailed == 0)
87 {
89 }
90}
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
_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
Referenced by main().
◆ RunTests()
Definition at line 23 of file tmrqueue.c.
24{
27
30 {
32 return;
33 }
34
36
37 for(
i = 0;
i < nTests;
i++)
38 {
40
42 {
43 continue;
44 }
45
47
49
51
53 }
54
56}
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
◆ Test1()
Definition at line 155 of file tmrqueue.c.
156{
158
162
164 {
166
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}
BOOL WINAPI CreateTimerQueueTimer(OUT PHANDLE phNewTimer, IN HANDLE TimerQueue, IN WAITORTIMERCALLBACK Callback, IN PVOID Parameter, IN DWORD DueTime, IN DWORD Period, IN ULONG Flags)
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
VOID CALLBACK TimerCallback1(PVOID Param, BOOLEAN Fired)
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
DWORD WINAPI GetLastError(void)
◆ Test2()
Definition at line 192 of file tmrqueue.c.
193{
196
200
203 {
204 _tprintf(
_T(
"[%d]Unable to create event!\n"), (
int)
Info.Test->id);
205 return;
206 }
207
209 {
211
213
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
221
222 _tprintf(
_T(
"[%d]Timout finished, delete timer queue..."), (
int)
Test->id);
225 {
227
229 }
230 else
231 {
233
235 {
237 _tprintf(
_T(
"FAILED, Overlapped I/O operation in progress\n"));
238 break;
239 default:
241 break;
242 }
243 }
244
246}
#define INVALID_HANDLE_VALUE
BOOL WINAPI DeleteTimerQueueTimer(IN HANDLE TimerQueue, IN HANDLE Timer, IN HANDLE CompletionEvent)
VOID CALLBACK TimerCallback2(PVOID Param, BOOLEAN Fired)
◆ Test3()
Definition at line 266 of file tmrqueue.c.
267{
270
274
277 {
278 _tprintf(
_T(
"[%d]Unable to create event!\n"), (
int)
Info.Test->id);
279 return;
280 }
281
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
290 {
292
295
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
303
304 _tprintf(
_T(
"[%d]Timout finished, delete timer queue..."), (
int)
Test->id);
307 {
308 _tprintf(
_T(
"returned OK -> test FAILED!\n"));
309 }
310 else
311 {
313
315 {
317 _tprintf(
_T(
"OK, Overlapped I/O operation in progress\n"));
318
320 break;
321 default:
323 break;
324 }
325 }
326
328
331
333}
VOID CALLBACK TimerCallback3(PVOID Param, BOOLEAN Fired)
Referenced by InitTests(), MainWndProc(), and SymlinkCreateTests().
◆ TimerCallback1()
Definition at line 119 of file tmrqueue.c.
120{
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 {
128
129 _tprintf(
_T(
"[%d]Timout finished, delete timer queue..."), (
int)
Info->Test->id);
132 _tprintf(
_T(
"returned OK -> test FAILED!\n"));
133 else
134 {
136
138 {
140 _tprintf(
_T(
"OK, Overlapped I/O operation in progress\n"));
141
143 break;
144 default:
146 break;
147 }
148 }
149
150
152 }
153}
struct _TESTINFO * PTESTINFO
Referenced by Test1().
◆ TimerCallback2()
Definition at line 176 of file tmrqueue.c.
177{
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
186
187
189 }
190}
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Referenced by Test2().
◆ TimerCallback3()
Definition at line 250 of file tmrqueue.c.
251{
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
260
261
263 }
264}
Referenced by Test3().
◆ Tests