4805c108c646338889462e805272f28490c3c1de
[reactos.git] / os2 / lib / doscalls / run / process.cpp
1 /* $Id: process.cpp,v 1.5 2002/09/04 22:19:47 robertk Exp $
2 */
3 /*
4 *
5 * COPYRIGHT: See COPYING in the top level directory
6 * PROJECT: ReactOS OS/2 sub system
7 * PART: doscalls.dll
8 * FILE: process.cpp
9 * CONTAINS: process and thread related CP-functions.
10 * PURPOSE: Kernelservices for OS/2 apps
11 * PROGRAMMER: Robert K. nonvolatil@yahoo.de
12 * REVISION HISTORY:
13 * 13-03-2002 Created
14 * 25-07-2002 Work to make it compile
15 */
16
17
18 #define INCL_DOSPROCESS
19 #define INCL_DOSERRORS
20 #include "ros2.h"
21
22
23 APIRET STDCALL DosSleep(ULONG msec)
24 {
25 NT::NTSTATUS stat;
26 NT::TIME Interv;
27 Interv.QuadPart= -(10000 * msec);
28 stat = NT::NtDelayExecution( TRUE, &Interv );
29 return 0;
30 }
31
32
33 /* $Id: process.cpp,v 1.5 2002/09/04 22:19:47 robertk Exp $ */
34 /* Terminates the current thread or the current Process.
35 Decission is made by action
36 FIXME: move this code to OS2.EXE */
37 VOID APIENTRY DosExit(ULONG action, ULONG result)
38 {
39 // decide what to do
40 if( action == EXIT_THREAD)
41 {
42 NT::NtTerminateThread( NULL, result );
43 }
44 else // EXIT_PROCESS
45 {
46 NT::NtTerminateProcess( NULL, result );
47 }
48 }
49
50
51 APIRET STDCALL DosCreateThread(PTID ptid, PFNTHREAD pfn,
52 ULONG param, ULONG flag, ULONG cbStack)
53 {
54 return ERROR_CALL_NOT_IMPLEMENTED;
55 }
56
57 /* EOF */