update for HEAD-2003050101
[reactos.git] / lib / msvcrt / process / threadx.c
1 /* $Id$
2  *
3  */
4 #include <windows.h>
5 #include <msvcrt/errno.h>
6 #include <msvcrt/process.h>
7
8
9 unsigned long _beginthreadex(
10     void* security,
11     unsigned stack_size,
12     unsigned (__stdcall *start_address)(void*),
13     void* arglist,
14     unsigned initflag,
15     unsigned* thrdaddr)
16 {
17   HANDLE NewThread;
18
19   /*
20    * Just call the API function. Any CRT specific processing is done in
21    * DllMain DLL_THREAD_ATTACH
22    */
23   NewThread = CreateThread(security, stack_size, start_address, arglist, initflag, thrdaddr);
24   if (NULL == NewThread)
25     {
26     /* FIXME map GetLastError() to errno */
27     errno = ENOSYS;
28     }
29
30   return (unsigned long) NewThread;
31 }
32
33
34 void _endthreadex(unsigned retval)
35 {
36   /*
37    * Just call the API function. Any CRT specific processing is done in
38    * DllMain DLL_THREAD_DETACH
39    */
40   ExitThread(retval);
41 }
42
43 /* EOF */