Author: greatlrd
Date: Tue Jul 4 01:29:32 2006
New Revision: 22810
URL:
http://svn.reactos.org/svn/reactos?rev=22810&view=rev
Log:
test case for QueueUserWorkItem from bug 1609
by w3seek
Added:
trunk/reactos/regtests/queuetest/
trunk/reactos/regtests/queuetest/queuetest.c (with props)
trunk/reactos/regtests/queuetest/queuetest.rbuild (with props)
Modified:
trunk/reactos/regtests/directory.rbuild
Modified: trunk/reactos/regtests/directory.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/regtests/directory.rbuild?…
==============================================================================
--- trunk/reactos/regtests/directory.rbuild (original)
+++ trunk/reactos/regtests/directory.rbuild Tue Jul 4 01:29:32 2006
@@ -1,6 +1,9 @@
<group>
<directory name="kmtloader">
<xi:include href="kmtloader/kmtloader.rbuild" />
+</directory>
+<directory name="queuetest">
+ <xi:include href="queuetest/queuetest.rbuild" />
</directory>
<directory name="regtests">
<xi:include href="regtests/regtests.rbuild" />
Added: trunk/reactos/regtests/queuetest/queuetest.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/regtests/queuetest/queuete…
==============================================================================
--- trunk/reactos/regtests/queuetest/queuetest.c (added)
+++ trunk/reactos/regtests/queuetest/queuetest.c Tue Jul 4 01:29:32 2006
@@ -1,0 +1,35 @@
+/* Compile with gcc -o queuetest.exe queuetest.c */
+
+#include <windows.h>
+#include <stdio.h>
+
+#define WT_EXECUTEINPERSISTENTIOTHREAD 0x00000040
+BOOL WINAPI QueueUserWorkItem(LPTHREAD_START_ROUTINE,PVOID,ULONG);
+
+#define TestProc(n) \
+DWORD CALLBACK TestProc##n(void *ctx)\
+{\
+ printf("TestProc%d thread 0x%x context 0x%p\n", n, GetCurrentThreadId(),
ctx);\
+ return 0;\
+}
+
+TestProc(1)
+TestProc(2)
+TestProc(3)
+TestProc(4)
+TestProc(5)
+TestProc(6)
+
+int __cdecl
+main(int argc, char* argv[])
+{
+ PVOID x = (PVOID)0x12345;
+ QueueUserWorkItem(TestProc1, x, 0);
+ QueueUserWorkItem(TestProc2, x, WT_EXECUTELONGFUNCTION);
+ QueueUserWorkItem(TestProc3, x, WT_EXECUTEINIOTHREAD);
+ QueueUserWorkItem(TestProc4, x, WT_EXECUTEINIOTHREAD | WT_EXECUTELONGFUNCTION);
+ QueueUserWorkItem(TestProc5, x, WT_EXECUTEINPERSISTENTTHREAD);
+ QueueUserWorkItem(TestProc6, x, WT_EXECUTEINPERSISTENTIOTHREAD);
+ Sleep(INFINITE);
+ return 0;
+}
Propchange: trunk/reactos/regtests/queuetest/queuetest.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/regtests/queuetest/queuetest.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/regtests/queuetest/queuete…
==============================================================================
--- trunk/reactos/regtests/queuetest/queuetest.rbuild (added)
+++ trunk/reactos/regtests/queuetest/queuetest.rbuild Tue Jul 4 01:29:32 2006
@@ -1,0 +1,4 @@
+<module name="queuetest" type="win32cui"
installbase="system32" installname="queuetest.exe"
allowwarnings="true">
+ <define name="__USE_W32API" />
+ <file>queuetest.c</file>
+</module>
Propchange: trunk/reactos/regtests/queuetest/queuetest.rbuild
------------------------------------------------------------------------------
svn:eol-style = native