ReactOS  0.4.15-dev-1177-g6cb3b62
queuetest.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Tests
3  * LICENSE: GPL - See COPYING in the top level directory
4  * FILE: queuetest.c
5  * PURPOSE: Usermode QueueUserWorkItem() testing
6  * PROGRAMMERS: Thomas Weidenmueller (w3seek@reactos.org)
7  */
8 
9 #include <windows.h>
10 #include <stdio.h>
11 
12 #define WT_EXECUTEINPERSISTENTIOTHREAD 0x00000040
14 
15 #define TestProc(n) \
16 DWORD CALLBACK TestProc##n(void *ctx)\
17 {\
18  printf("TestProc%d thread 0x%lx context 0x%p\n", n, GetCurrentThreadId(), ctx);\
19  return 0;\
20 }
21 
23 TestProc(2)
24 TestProc(3)
25 TestProc(4)
26 TestProc(5)
27 TestProc(6)
28 
29 int __cdecl
30 main(int argc, char* argv[])
31 {
32  PVOID x = (PVOID)0x12345;
33  QueueUserWorkItem(TestProc1, x, 0);
39  Sleep(INFINITE);
40  return 0;
41 }
static int argc
Definition: ServiceArgs.c:12
DWORD(WINAPI * LPTHREAD_START_ROUTINE)(LPVOID)
Definition: winbase.h:707
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
#define __cdecl
Definition: accygwin.h:79
int main(int argc, char *argv[])
Definition: atactl.cpp:1685
#define WT_EXECUTEINIOTHREAD
Definition: winnt_old.h:1072
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define argv
Definition: mplay32.c:18
#define WT_EXECUTEINPERSISTENTTHREAD
Definition: winnt_old.h:1079
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI QueueUserWorkItem(LPTHREAD_START_ROUTINE, PVOID, ULONG)
void * PVOID
Definition: retypes.h:9
#define WT_EXECUTELONGFUNCTION
Definition: winnt_old.h:1076
#define TestProc(n)
Definition: queuetest.c:15
#define WT_EXECUTEINPERSISTENTIOTHREAD
Definition: queuetest.c:12
#define WINAPI
Definition: msvc.h:6
unsigned int ULONG
Definition: retypes.h:1
#define INFINITE
Definition: serial.h:102