3 Copyright (c) Alex Ionescu. All rights reserved.
11 Type definitions for the basic native types.
15 Alex Ionescu (alex.ionescu@reactos.com) 06-Oct-2004
19 #if !defined(_NTDEF_) && !defined(_NTDEF_H)
22 #undef WIN32_NO_STATUS
23 #define NTOS_MODE_USER
33 // Compiler Definitions
37 #define FASTCALL _fastcall
42 #define FASTCALL NTAPI
45 #if !defined(_M_CEE_PURE)
46 #define NTAPI_INLINE NTAPI
54 #define ALIGN_DOWN(s, t) \
55 ((ULONG)(s) & ~(sizeof(t) - 1))
57 #define ALIGN_UP(s, t) \
58 (ALIGN_DOWN(((ULONG)(s) + sizeof(t) - 1), t))
60 #define ALIGN_DOWN_POINTER(p, t) \
61 ((PVOID)((ULONG_PTR)(p) & ~((ULONG_PTR)sizeof(t) - 1)))
63 #define ALIGN_UP_POINTER(p, t) \
64 (ALIGN_DOWN_POINTER(((ULONG_PTR)(p) + sizeof(t) - 1), t))
67 // Native API Return Value Macros
69 #define NT_SUCCESS(Status) (((NTSTATUS)(Status)) >= 0)
70 #define NT_INFORMATION(Status) ((((ULONG)(Status)) >> 30) == 1)
71 #define NT_WARNING(Status) ((((ULONG)(Status)) >> 30) == 2)
72 #define NT_ERROR(Status) ((((ULONG)(Status)) >> 30) == 3)
79 #define MINSHORT 0x8000
80 #define MAXSHORT 0x7fff
81 #define MINLONG 0x80000000
82 #define MAXLONG 0x7fffffff
84 #define MAXUSHORT 0xffff
85 #define MAXULONG 0xffffffff
88 // Basic Types that aren't defined in User-Mode Headers
90 typedef CONST
int CINT
;
91 typedef CONST
char *PCSZ
;
94 typedef CSHORT
*PCSHORT
;
95 typedef LARGE_INTEGER PHYSICAL_ADDRESS
, *PPHYSICAL_ADDRESS
;
96 typedef LONG KPRIORITY
;
97 typedef LONG NTSTATUS
, *PNTSTATUS
;
102 #if !defined(_NTSECAPI_H) && !defined(_SUBAUTH_H)
104 typedef struct _UNICODE_STRING
107 USHORT MaximumLength
;
109 } UNICODE_STRING
, *PUNICODE_STRING
;
110 typedef const UNICODE_STRING
* PCUNICODE_STRING
;
112 typedef struct _STRING
115 USHORT MaximumLength
;
119 typedef struct _OBJECT_ATTRIBUTES
122 HANDLE RootDirectory
;
123 PUNICODE_STRING ObjectName
;
125 PVOID SecurityDescriptor
;
126 PVOID SecurityQualityOfService
;
127 } OBJECT_ATTRIBUTES
, *POBJECT_ATTRIBUTES
;
130 typedef STRING ANSI_STRING
;
131 typedef PSTRING PANSI_STRING
;
132 typedef STRING OEM_STRING
;
133 typedef PSTRING POEM_STRING
;
134 typedef CONST STRING
* PCOEM_STRING
;
135 typedef STRING CANSI_STRING
;
136 typedef PSTRING PCANSI_STRING
;