Further reduced differences and include all identical msvcrt targets in crtdll makefile.
[reactos.git] / reactos / lib / crtdll / process / thread.c
1 /* $Id: thread.c,v 1.6 2002/11/29 15:59:01 robd Exp $
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 unsigned long _beginthread(
11 void (*pfuncStart)(void*),
12 unsigned unStackSize,
13 void* pArgList)
14 {
15 DWORD ThreadId;
16 HANDLE hThread;
17 if ( pfuncStart == NULL )
18 __set_errno(EINVAL);
19
20 hThread = CreateThread( NULL,unStackSize,(LPTHREAD_START_ROUTINE)pfuncStart,pArgList,0, &ThreadId);
21 if (hThread == NULL ) {
22 __set_errno(EAGAIN);
23 return -1;
24 }
25 return (unsigned long)hThread;
26 }
27
28 void _endthread(void)
29 {
30 //fixme ExitThread
31 //ExitThread(0);
32 for(;;);
33 }