- NDK fix: don't undef a million status codes, instead, have apps define WIN32_NO_STATUS.
[reactos.git] / reactos / include / ndk / umtypes.h
1 /*
2 * PROJECT: ReactOS Native Headers
3 * FILE: include/ndk/umtypes.h
4 * PURPOSE: Definitions needed for Native Headers if target is not Kernel-Mode.
5 * PROGRAMMER: Alex Ionescu (alex@relsoft.net)
6 * UPDATE HISTORY:
7 * Created 06/10/04
8 */
9
10 #if !defined(_NTDEF_) && !defined(_NTDEF_H)
11 #define _NTDEF_
12 #define _NTDEF_H
13
14 /* DEPENDENCIES **************************************************************/
15 #include <winioctl.h>
16 #include <ntnls.h>
17 #undef WIN32_NO_STATUS
18 #include <ntstatus.h>
19
20 /* CONSTANTS *****************************************************************/
21
22 /* NTAPI/NTOSAPI Define */
23 #define DECLSPEC_ADDRSAFE
24 #define NTAPI __stdcall
25 #define FASTCALL __fastcall
26 #if !defined(_NTSYSTEM_)
27 #define NTSYSAPI DECLSPEC_IMPORT
28 #define NTSYSCALLAPI DECLSPEC_IMPORT
29 #else
30 #define NTSYSAPI
31 #if defined(_NTDLLBUILD_)
32 #define NTSYSCALLAPI
33 #else
34 #define NTSYSCALLAPI DECLSPEC_ADDRSAFE
35 #endif
36 #endif
37 #if !defined(_M_CEE_PURE)
38 #define NTAPI_INLINE NTAPI
39 #else
40 #define NTAPI_INLINE
41 #endif
42
43 /* Native API Return Value Macros */
44 #define NT_SUCCESS(x) ((x)>=0)
45 #define NT_WARNING(x) ((ULONG)(x)>>30==2)
46 #define NT_ERROR(x) ((ULONG)(x)>>30==3)
47
48 /* Limits */
49 #define MINCHAR 0x80
50 #define MAXCHAR 0x7f
51 #define MINSHORT 0x8000
52 #define MAXSHORT 0x7fff
53 #define MINLONG 0x80000000
54 #define MAXLONG 0x7fffffff
55 #define MAXUCHAR 0xff
56 #define MAXUSHORT 0xffff
57 #define MAXULONG 0xffffffff
58
59 /* TYPES *********************************************************************/
60
61 /* Basic Types that aren't defined in User-Mode Headers */
62 typedef CONST int CINT;
63 typedef CONST char *PCSZ;
64 typedef ULONG CLONG;
65 typedef short CSHORT;
66 typedef CSHORT *PCSHORT;
67 typedef LARGE_INTEGER PHYSICAL_ADDRESS, *PPHYSICAL_ADDRESS;
68 typedef LONG KPRIORITY;
69 typedef LONG NTSTATUS, *PNTSTATUS;
70 #define STATIC static
71
72 /* Basic NT Types */
73 #if !defined(_NTSECAPI_H) && !defined(_SUBAUTH_H)
74 typedef struct _UNICODE_STRING
75 {
76 USHORT Length;
77 USHORT MaximumLength;
78 PWSTR Buffer;
79 } UNICODE_STRING, *PUNICODE_STRING;
80 typedef const UNICODE_STRING* PCUNICODE_STRING;
81
82 typedef struct _STRING
83 {
84 USHORT Length;
85 USHORT MaximumLength;
86 PCHAR Buffer;
87 } STRING, *PSTRING;
88
89 typedef struct _OBJECT_ATTRIBUTES
90 {
91 ULONG Length;
92 HANDLE RootDirectory;
93 PUNICODE_STRING ObjectName;
94 ULONG Attributes;
95 PVOID SecurityDescriptor;
96 PVOID SecurityQualityOfService;
97 } OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES;
98 #endif
99
100 typedef STRING ANSI_STRING;
101 typedef PSTRING PANSI_STRING;
102 typedef STRING OEM_STRING;
103 typedef PSTRING POEM_STRING;
104 typedef CONST STRING* PCOEM_STRING;
105 typedef STRING CANSI_STRING;
106 typedef PSTRING PCANSI_STRING;
107
108 #endif