[MSIMTF]
[reactos.git] / rossubsys / os2 / include / ros2.h
1 /* $ $
2 */
3 /*
4 *
5 * COPYRIGHT: See COPYING in the top level directory
6 * PROJECT: ReactOS OS/2 sub system
7 * FILE: dll/doscalls.c
8 * PURPOSE: supportheader for Kernelservices.
9 * Use this file if your dll or application
10 * is going to use both, the os2 base services
11 * as well as the native API of NTDLL.DLL
12 * PROGRAMMER: Robert K. nonvolatil@yahoo.de
13 * REVISION HISTORY:
14 * 1-08-2002 Created
15 */
16
17 /* How to use:
18 History got us another time. If you want to write a module
19 that uses either native-api or os2-services...no problem.
20 But if you want to use both of them you run into type conflicts.
21 BOOL is not very surprising. But there are many other types
22 whose names are equal. This results from the fact that NT
23 should originally become OS/2 3.0.
24 So your solution lies in including this file instead of os2.h
25 and ntddk.h. What this file here does is, it puts the os2-types+
26 functions into the namespace OS2 while the nt-types+functions are
27 put into the namespace NT. The still conflicting #defines are handled
28 like this: If ntddk.h defintes a symbol FOO and os2.h does the same,
29 this file here undefines the ntddk.h-one and renames it to NT_FOO.
30 This is only done for conflicting symbols. Of course, this list is a
31 source for errors. But is there a better solution than renaming
32 all of the symbols?
33 */
34
35 #ifndef __ROS2_H__
36 #define __ROS2_H__
37
38 #ifdef __cplusplus
39 extern "C" {
40 #endif /* __cplusplus */
41
42
43 namespace NT
44 {
45 #include <ddk/ntddk.h>
46 #include <napi/types.h>
47 }
48
49
50 /* rename all the symbols */
51 #define NT_FILE_CREATE FILE_CREATE
52 #undef FILE_CREATE
53 #define NT_CREATE_SUSPENDED CREATE_SUSPENDED
54 #undef CREATE_SUSPENDED
55
56 namespace OS2
57 {
58 #include "os2.h"
59 }
60
61 using namespace OS2;
62
63 APIRET STDCALL Dos32Open(PSZ pszFileName, PHFILE pHf,
64 PULONG pulAction, ULONG cbFile,
65 ULONG ulAttribute, ULONG fsOpenFlags,
66 ULONG fsOpenMode, PVOID reserved ); //ULONGPEAOP2 peaop2)
67 APIRET STDCALL Dos32Close(HFILE hFile);
68 APIRET STDCALL Dos32Read(HFILE hFile, PVOID pBuffer,
69 ULONG cbRead, PULONG pcbActual);
70 APIRET STDCALL Dos32Write(HFILE hFile, PVOID pBuffer,
71 ULONG cbWrite, PULONG pcbActual);
72 ULONG STDCALL DosSleep (ULONG ulInterval);
73 ULONG STDCALL DosBeep (ULONG ulFrequency, ULONG ulDuration);
74 VOID STDCALL DosExit (ULONG ulAction, ULONG ulResult);
75
76 //ULONG STDCALL DosDevIOCtl (HFILE hDevice, ULONG ulCategory, ULONG ulFunction,
77 // PVOID pParams, ULONG ulParamsLengthMax, PULONG pulParamsLength,
78 // PVOID pData, ULONG ulDataLengthMax, PULONG pulDataLength);
79
80 typedef ULONG foo_TID;
81 typedef foo_TID* foo_PTID;
82 typedef void (*foo_PFNTHREAD)(ULONG ulThreadArg);
83
84 ULONG STDCALL DosCreateThread (foo_PTID ptidThreadID, foo_PFNTHREAD pfnThreadAddr,
85 ULONG ulThreadArg, ULONG ulFlags, ULONG ulStackSize);
86
87 #ifdef __cplusplus
88 }
89 #endif /* __cplusplus */
90
91 #endif /* __ROS2_H__ */