a4c5281210a8415ab44ad2635466b516cb7fdc0c
[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 /*
10  * @unimplemented
11  */
12 unsigned long _beginthreadex(
13     void* security,
14     unsigned stack_size,
15     unsigned (__stdcall *start_address)(void*),
16     void* arglist,
17     unsigned initflag,
18     unsigned* thrdaddr)
19 {
20   HANDLE NewThread;
21
22   /*
23    * Just call the API function. Any CRT specific processing is done in
24    * DllMain DLL_THREAD_ATTACH
25    */
26   NewThread = CreateThread ( security, stack_size,
27     (LPTHREAD_START_ROUTINE)start_address,
28     arglist, initflag, (PULONG)thrdaddr );
29   if (NULL == NewThread)
30     {
31     /* FIXME map GetLastError() to errno */
32     __set_errno ( ENOSYS );
33     }
34
35   return (unsigned long) NewThread;
36 }
37
38
39 /*
40  * @implemented
41  */
42 void _endthreadex(unsigned retval)
43 {
44   /*
45    * Just call the API function. Any CRT specific processing is done in
46    * DllMain DLL_THREAD_DETACH
47    */
48   ExitThread(retval);
49 }
50
51 /* EOF */