update for HEAD-2003091401
[reactos.git] / lib / crtdll / process / thread.c
1 /* $Id$
2  *
3  */
4 #include <windows.h>
5 #include <msvcrt/errno.h>
6 #include <msvcrt/process.h>
7 #include <msvcrt/internal/file.h>
8
9
10 /*
11  * @implemented
12  */
13 unsigned long _beginthread(
14     void (*pfuncStart)(void*),
15         unsigned unStackSize,
16     void* pArgList)
17 {
18         DWORD  ThreadId;
19         HANDLE hThread;
20         if (  pfuncStart == NULL )
21                 __set_errno(EINVAL);
22
23         hThread = CreateThread( NULL,unStackSize,(LPTHREAD_START_ROUTINE)pfuncStart,pArgList,0, &ThreadId);
24         if (hThread == NULL ) {
25                 __set_errno(EAGAIN);
26                 return -1;
27         }
28         return (unsigned long)hThread;
29 }
30
31 /*
32  * @unimplemented
33  */
34 void    _endthread(void)
35 {
36         //fixme ExitThread
37         //ExitThread(0);
38         for(;;);
39 }