Add some DDK limits that were missing
[reactos.git] / reactos / w32api / include / ntdef.h
1 #ifndef _NTDEF_H
2 #define _NTDEF_H
3 #if __GNUC__ >=3
4 #pragma GCC system_header
5 #endif
6
7 /* TODO: some compilers support this */
8 #define RESTRICTED_POINTER
9
10 #define NTAPI __stdcall
11 #define OBJ_INHERIT 0x00000002
12 #define OBJ_PERMANENT 0x00000010
13 #define OBJ_EXCLUSIVE 0x00000020
14 #define OBJ_CASE_INSENSITIVE 0x00000040
15 #define OBJ_OPENIF 0x00000080
16 #define OBJ_OPENLINK 0x00000100
17 #define OBJ_KERNEL_HANDLE 0x00000200
18 #define OBJ_VALID_ATTRIBUTES (OBJ_KERNEL_HANDLE | OBJ_OPENLINK | \
19 OBJ_OPENIF | OBJ_CASE_INSENSITIVE | OBJ_EXCLUSIVE | \
20 OBJ_PERMANENT | OBJ_INHERIT)
21 #define InitializeObjectAttributes(p,n,a,r,s) { \
22 (p)->Length = sizeof(OBJECT_ATTRIBUTES); \
23 (p)->RootDirectory = (r); \
24 (p)->Attributes = (a); \
25 (p)->ObjectName = (n); \
26 (p)->SecurityDescriptor = (s); \
27 (p)->SecurityQualityOfService = NULL; \
28 }
29 #ifndef NT_SUCCESS
30 #define NT_SUCCESS(x) ((x)>=0)
31 #define STATUS_SUCCESS ((NTSTATUS)0)
32 #endif
33 #define NT_WARNING(x) ((ULONG)(x)>>30==2)
34 #define NT_ERROR(x) ((ULONG)(x)>>30==3)
35 #if !defined(_NTSECAPI_H) && !defined(_SUBAUTH_H)
36 typedef LONG NTSTATUS, *PNTSTATUS;
37 typedef struct _UNICODE_STRING {
38 USHORT Length;
39 USHORT MaximumLength;
40 PWSTR Buffer;
41 } UNICODE_STRING, *PUNICODE_STRING;
42 typedef const UNICODE_STRING* PCUNICODE_STRING;
43 typedef struct _STRING {
44 USHORT Length;
45 USHORT MaximumLength;
46 PCHAR Buffer;
47 } STRING, *PSTRING;
48 #endif
49 typedef STRING ANSI_STRING;
50 typedef PSTRING PANSI_STRING;
51 typedef STRING OEM_STRING;
52 typedef PSTRING POEM_STRING;
53 typedef LARGE_INTEGER PHYSICAL_ADDRESS, *PPHYSICAL_ADDRESS;
54 typedef enum _SECTION_INHERIT {
55 ViewShare = 1,
56 ViewUnmap = 2
57 } SECTION_INHERIT;
58 typedef enum _NT_PRODUCT_TYPE {
59 NtProductWinNt = 1,
60 NtProductLanManNt,
61 NtProductServer
62 } NT_PRODUCT_TYPE, *PNT_PRODUCT_TYPE;
63 #if !defined(_NTSECAPI_H)
64 typedef struct _OBJECT_ATTRIBUTES {
65 ULONG Length;
66 HANDLE RootDirectory;
67 PUNICODE_STRING ObjectName;
68 ULONG Attributes;
69 PVOID SecurityDescriptor;
70 PVOID SecurityQualityOfService;
71 } OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES;
72 #endif
73 #define NOTHING
74 #define RTL_CONSTANT_STRING(s) { sizeof(s)-sizeof((s)[0]), sizeof(s), s }
75 #define TYPE_ALIGNMENT( t ) FIELD_OFFSET( struct { char x; t test; }, test )
76
77 #define MINCHAR 0x80
78 #define MAXCHAR 0x7f
79 #define MINSHORT 0x8000
80 #define MAXSHORT 0x7fff
81 #define MINLONG 0x80000000
82 #define MAXLONG 0x7fffffff
83 #define MAXUCHAR 0xff
84 #define MAXUSHORT 0xffff
85 #define MAXULONG 0xffffffff
86 #endif /* _NTDEF_H */