- Add RtlSetProcessCritical
[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
18 /* Undef the following to avoid conflects including ntstatus.h with winnt.h */
19 #undef STATUS_WAIT_0
20 #undef STATUS_ABANDONED_WAIT_0
21 #undef STATUS_USER_APC
22 #undef STATUS_TIMEOUT
23 #undef STATUS_PENDING
24 #undef DBG_EXCEPTION_HANDLED
25 #undef DBG_CONTINUE
26 #undef STATUS_SEGMENT_NOTIFICATION
27 #undef DBG_TERMINATE_THREAD
28 #undef DBG_TERMINATE_PROCESS
29 #undef DBG_CONTROL_C
30 #undef DBG_CONTROL_BREAK
31 #undef DBG_COMMAND_EXCEPTION
32 #undef STATUS_GUARD_PAGE_VIOLATION
33 #undef STATUS_DATATYPE_MISALIGNMENT
34 #undef STATUS_BREAKPOINT
35 #undef STATUS_SINGLE_STEP
36 #undef DBG_EXCEPTION_NOT_HANDLED
37 #undef STATUS_ACCESS_VIOLATION
38 #undef STATUS_IN_PAGE_ERROR
39 #undef STATUS_INVALID_HANDLE
40 #undef STATUS_NO_MEMORY
41 #undef STATUS_ILLEGAL_INSTRUCTION
42 #undef STATUS_NONCONTINUABLE_EXCEPTION
43 #undef STATUS_INVALID_DISPOSITION
44 #undef STATUS_ARRAY_BOUNDS_EXCEEDED
45 #undef STATUS_FLOAT_DENORMAL_OPERAND
46 #undef STATUS_FLOAT_DIVIDE_BY_ZERO
47 #undef STATUS_FLOAT_INEXACT_RESULT
48 #undef STATUS_FLOAT_INVALID_OPERATION
49 #undef STATUS_FLOAT_OVERFLOW
50 #undef STATUS_FLOAT_STACK_CHECK
51 #undef STATUS_FLOAT_UNDERFLOW
52 #undef STATUS_INTEGER_DIVIDE_BY_ZERO
53 #undef STATUS_INTEGER_OVERFLOW
54 #undef STATUS_PRIVILEGED_INSTRUCTION
55 #undef STATUS_STACK_OVERFLOW
56 #undef STATUS_CONTROL_C_EXIT
57 #undef STATUS_FLOAT_MULTIPLE_FAULTS
58 #undef STATUS_FLOAT_MULTIPLE_TRAPS
59 #undef STATUS_REG_NAT_CONSUMPTION
60 #undef STATUS_SXS_EARLY_DEACTIVATION
61 #undef STATUS_SXS_INVALID_DEACTIVATION
62
63 #include <ntstatus.h>
64
65 /* CONSTANTS *****************************************************************/
66
67 /* NTAPI/NTOSAPI Define */
68 #define DECLSPEC_ADDRSAFE
69 #define NTAPI __stdcall
70 #define FASTCALL __fastcall
71 #if !defined(_NTSYSTEM_)
72 #define NTSYSAPI DECLSPEC_IMPORT
73 #define NTSYSCALLAPI DECLSPEC_IMPORT
74 #else
75 #define NTSYSAPI
76 #if defined(_NTDLLBUILD_)
77 #define NTSYSCALLAPI
78 #else
79 #define NTSYSCALLAPI DECLSPEC_ADDRSAFE
80 #endif
81 #endif
82 #if !defined(_M_CEE_PURE)
83 #define NTAPI_INLINE NTAPI
84 #else
85 #define NTAPI_INLINE
86 #endif
87
88 /* Native API Return Value Macros */
89 #define NT_SUCCESS(x) ((x)>=0)
90 #define NT_WARNING(x) ((ULONG)(x)>>30==2)
91 #define NT_ERROR(x) ((ULONG)(x)>>30==3)
92
93 /* Limits */
94 #define MINCHAR 0x80
95 #define MAXCHAR 0x7f
96 #define MINSHORT 0x8000
97 #define MAXSHORT 0x7fff
98 #define MINLONG 0x80000000
99 #define MAXLONG 0x7fffffff
100 #define MAXUCHAR 0xff
101 #define MAXUSHORT 0xffff
102 #define MAXULONG 0xffffffff
103
104 /* TYPES *********************************************************************/
105
106 /* Basic Types that aren't defined in User-Mode Headers */
107 typedef CONST int CINT;
108 typedef CONST char *PCSZ;
109 typedef ULONG CLONG;
110 typedef short CSHORT;
111 typedef CSHORT *PCSHORT;
112 typedef LARGE_INTEGER PHYSICAL_ADDRESS, *PPHYSICAL_ADDRESS;
113 typedef LONG KPRIORITY;
114 typedef LONG NTSTATUS, *PNTSTATUS;
115 #define STATIC static
116
117 /* Basic NT Types */
118 #if !defined(_NTSECAPI_H) && !defined(_SUBAUTH_H)
119 typedef struct _UNICODE_STRING
120 {
121 USHORT Length;
122 USHORT MaximumLength;
123 PWSTR Buffer;
124 } UNICODE_STRING, *PUNICODE_STRING;
125 typedef const UNICODE_STRING* PCUNICODE_STRING;
126
127 typedef struct _STRING
128 {
129 USHORT Length;
130 USHORT MaximumLength;
131 PCHAR Buffer;
132 } STRING, *PSTRING;
133
134 typedef struct _OBJECT_ATTRIBUTES
135 {
136 ULONG Length;
137 HANDLE RootDirectory;
138 PUNICODE_STRING ObjectName;
139 ULONG Attributes;
140 PVOID SecurityDescriptor;
141 PVOID SecurityQualityOfService;
142 } OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES;
143 #endif
144
145 typedef STRING ANSI_STRING;
146 typedef PSTRING PANSI_STRING;
147 typedef STRING OEM_STRING;
148 typedef PSTRING POEM_STRING;
149 typedef CONST STRING* PCOEM_STRING;
150 typedef STRING CANSI_STRING;
151 typedef PSTRING PCANSI_STRING;
152
153 #endif