ReactOS 0.4.16-dev-303-g11d5cb8
umtypes.h
Go to the documentation of this file.
1/*++ NDK Version: 0095
2
3Copyright (c) Alex Ionescu. All rights reserved.
4
5Header Name:
6
7 umtypes.h
8
9Abstract:
10
11 Type definitions for the basic native types.
12
13Author:
14
15 Alex Ionescu (alex.ionescu@reactos.com) 06-Oct-2004
16
17--*/
18
19#if !defined(_NTDEF_) && !defined(_NTDEF_H)
20#define _NTDEF_
21#define _NTDEF_H
22
23//
24// Use dummy macros, if SAL 2 is not available
25//
26#include <sal.h>
27#if (_SAL_VERSION < 20)
28#include <no_sal2.h>
29#endif
30
31//
32// Don't use the SDK status values
33//
34#ifndef WIN32_NO_STATUS
35#define WIN32_NO_STATUS
36#endif
37
38//
39// Let the NDK know we're in Application Mode
40//
41#define NTOS_MODE_USER
42
43//
44// Dependencies
45//
46#include <windef.h>
47#undef WIN32_NO_STATUS
48#include <ntstatus.h>
49#include <winioctl.h>
50#include <ntnls.h>
51
52//
53// Compiler Definitions
54//
55#ifndef _MANAGED
56#if defined(_M_IX86)
57#ifndef FASTCALL
58#define FASTCALL __fastcall
59#endif
60#else
61#define FASTCALL
62#endif
63#else
64#define FASTCALL NTAPI
65#endif
66
67#if !defined(_M_CEE_PURE)
68#define NTAPI_INLINE NTAPI
69#else
70#define NTAPI_INLINE
71#endif
72
73//
74// Alignment Macros
75//
76#define ALIGN_DOWN_BY(size, align) \
77 ((ULONG_PTR)(size) & ~((ULONG_PTR)(align) - 1))
78
79#define ALIGN_UP_BY(size, align) \
80 (ALIGN_DOWN_BY(((ULONG_PTR)(size) + align - 1), align))
81
82#define ALIGN_DOWN_POINTER_BY(ptr, align) \
83 ((PVOID)ALIGN_DOWN_BY(ptr, align))
84
85#define ALIGN_UP_POINTER_BY(ptr, align) \
86 ((PVOID)ALIGN_UP_BY(ptr, align))
87
88#define ALIGN_DOWN(size, type) \
89 ALIGN_DOWN_BY(size, sizeof(type))
90
91#define ALIGN_UP(size, type) \
92 ALIGN_UP_BY(size, sizeof(type))
93
94#define ALIGN_DOWN_POINTER(ptr, type) \
95 ALIGN_DOWN_POINTER_BY(ptr, sizeof(type))
96
97#define ALIGN_UP_POINTER(ptr, type) \
98 ALIGN_UP_POINTER_BY(ptr, sizeof(type))
99
100//
101// Native API Return Value Macros
102//
103#define NT_SUCCESS(Status) (((NTSTATUS)(Status)) >= 0)
104#define NT_INFORMATION(Status) ((((ULONG)(Status)) >> 30) == 1)
105#define NT_WARNING(Status) ((((ULONG)(Status)) >> 30) == 2)
106#define NT_ERROR(Status) ((((ULONG)(Status)) >> 30) == 3)
107
108//
109// Limits
110//
111#define MINCHAR 0x80
112#define MAXCHAR 0x7f
113#define MINSHORT 0x8000
114#define MAXSHORT 0x7fff
115#define MINLONG 0x80000000
116#define MAXLONG 0x7fffffff
117#define MAXUCHAR 0xff
118#define MAXUSHORT 0xffff
119#define MAXULONG 0xffffffff
120
121//
122// Basic Types that aren't defined in User-Mode Headers
123//
124typedef CONST int CINT;
125typedef CONST char *PCSZ;
126typedef ULONG CLONG;
127typedef short CSHORT;
131
132//
133// Basic NT Types
134//
135#if !defined(_NTSECAPI_H) && !defined(_SUBAUTH_H) && !defined(_NTSECAPI_)
136
137#if !defined(__BCRYPT_H__) && !defined(__WINE_BCRYPT_H)
139#endif
140
141typedef struct _UNICODE_STRING
142{
147
148typedef struct _STRING
149{
154
155typedef struct _CSTRING
156{
161
162#endif
163
164typedef struct _STRING32 {
171
172typedef struct _STRING64 {
179
180
181typedef struct _OBJECT_ATTRIBUTES
182{
190
191//
192// ClientID Structure
193//
194typedef struct _CLIENT_ID
195{
199
208
209#endif
LONG NTSTATUS
Definition: precomp.h:26
unsigned long
Definition: typeof.h:102
std::wstring STRING
Definition: fontsub.cpp:33
* PNTSTATUS
Definition: strlen.c:14
#define _Return_type_success_(c)
Definition: no_sal2.h:86
#define CONST
#define CONST
Definition: pedump.c:81
long LONG
Definition: pedump.c:60
unsigned short USHORT
Definition: pedump.c:61
HANDLE UniqueThread
Definition: compat.h:826
HANDLE UniqueProcess
Definition: compat.h:825
USHORT MaximumLength
Definition: umtypes.h:158
CONST CHAR * Buffer
Definition: umtypes.h:159
USHORT Length
Definition: umtypes.h:157
HANDLE RootDirectory
Definition: umtypes.h:184
PVOID SecurityQualityOfService
Definition: umtypes.h:188
PUNICODE_STRING ObjectName
Definition: umtypes.h:185
PVOID SecurityDescriptor
Definition: umtypes.h:187
USHORT MaximumLength
Definition: umtypes.h:166
ULONG Buffer
Definition: umtypes.h:167
USHORT Length
Definition: umtypes.h:165
ULONGLONG Buffer
Definition: umtypes.h:175
USHORT MaximumLength
Definition: umtypes.h:174
USHORT Length
Definition: umtypes.h:173
USHORT Length
Definition: umtypes.h:150
USHORT MaximumLength
Definition: umtypes.h:151
PCHAR Buffer
Definition: umtypes.h:152
USHORT MaximumLength
Definition: env_spec_w32.h:370
uint16_t * PWSTR
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
uint64_t ULONGLONG
Definition: typedefs.h:67
char * PCHAR
Definition: typedefs.h:51
struct _OBJECT_ATTRIBUTES * POBJECT_ATTRIBUTES
Definition: file.c:85
CONST int CINT
Definition: umtypes.h:124
struct _STRING * PSTRING
LARGE_INTEGER PHYSICAL_ADDRESS
Definition: umtypes.h:129
ULONG CLONG
Definition: umtypes.h:126
struct _STRING64 * PANSI_STRING64
PSTRING PCANSI_STRING
Definition: umtypes.h:207
struct _STRING64 * PUNICODE_STRING64
struct _CLIENT_ID CLIENT_ID
struct _CSTRING CSTRING
struct _STRING64 ANSI_STRING64
struct _STRING32 STRING32
struct _CSTRING * PCSTRING
CONST STRING * PCOEM_STRING
Definition: umtypes.h:205
struct _STRING32 ANSI_STRING32
STRING OEM_STRING
Definition: umtypes.h:203
struct _STRING32 * PUNICODE_STRING32
struct _STRING32 UNICODE_STRING32
struct _UNICODE_STRING * PUNICODE_STRING
CONST char * PCSZ
Definition: umtypes.h:125
struct _STRING64 UNICODE_STRING64
struct _STRING64 * PSTRING64
struct _STRING32 * PANSI_STRING32
short CSHORT
Definition: umtypes.h:127
PSTRING POEM_STRING
Definition: umtypes.h:204
struct _UNICODE_STRING UNICODE_STRING
struct _OBJECT_ATTRIBUTES OBJECT_ATTRIBUTES
struct _STRING STRING
STRING ANSI_STRING
Definition: umtypes.h:201
LARGE_INTEGER * PPHYSICAL_ADDRESS
Definition: umtypes.h:129
LONG KPRIORITY
Definition: umtypes.h:130
CSHORT * PCSHORT
Definition: umtypes.h:128
STRING CANSI_STRING
Definition: umtypes.h:206
struct _STRING64 STRING64
struct _CLIENT_ID * PCLIENT_ID
PSTRING PANSI_STRING
Definition: umtypes.h:202
struct _STRING32 * PSTRING32
const UNICODE_STRING * PCUNICODE_STRING
Definition: umtypes.h:200
char CHAR
Definition: xmlstorage.h:175