59f8de1b31193bc45423408f1ef2531738711ba5
[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 /* TYPES *********************************************************************/
94
95 /* Basic Types that aren't defined in User-Mode Headers */
96 typedef CONST int CINT;
97 typedef CONST char *PCSZ;
98 typedef ULONG CLONG;
99 typedef short CSHORT;
100 typedef CSHORT *PCSHORT;
101 typedef LARGE_INTEGER PHYSICAL_ADDRESS, *PPHYSICAL_ADDRESS;
102 typedef LONG NTSTATUS, *PNTSTATUS;
103 #define STATIC static
104
105 /* Basic NT Types */
106 #if !defined(_NTSECAPI_H) && !defined(_SUBAUTH_H)
107 typedef struct _UNICODE_STRING
108 {
109 USHORT Length;
110 USHORT MaximumLength;
111 PWSTR Buffer;
112 } UNICODE_STRING, *PUNICODE_STRING;
113 typedef const UNICODE_STRING* PCUNICODE_STRING;
114
115 typedef struct _STRING
116 {
117 USHORT Length;
118 USHORT MaximumLength;
119 PCHAR Buffer;
120 } STRING, *PSTRING;
121
122 typedef struct _OBJECT_ATTRIBUTES
123 {
124 ULONG Length;
125 HANDLE RootDirectory;
126 PUNICODE_STRING ObjectName;
127 ULONG Attributes;
128 PVOID SecurityDescriptor;
129 PVOID SecurityQualityOfService;
130 } OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES;
131 #endif
132
133 typedef STRING ANSI_STRING;
134 typedef PSTRING PANSI_STRING;
135 typedef STRING OEM_STRING;
136 typedef PSTRING POEM_STRING;
137 typedef CONST STRING* PCOEM_STRING;
138 typedef STRING CANSI_STRING;
139 typedef PSTRING PCANSI_STRING;
140
141 #endif