- Put output from MSVC into the relevant output-i386 / obj-i386 files
[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 #if !defined(_M_CEE_PURE)
12 #define NTAPI_INLINE NTAPI
13 #else
14 #define NTAPI_INLINE
15 #endif
16
17 #define OBJ_INHERIT 0x00000002
18 #define OBJ_PERMANENT 0x00000010
19 #define OBJ_EXCLUSIVE 0x00000020
20 #define OBJ_CASE_INSENSITIVE 0x00000040
21 #define OBJ_OPENIF 0x00000080
22 #define OBJ_OPENLINK 0x00000100
23 #define OBJ_KERNEL_HANDLE 0x00000200
24 #define OBJ_VALID_ATTRIBUTES (OBJ_KERNEL_HANDLE | OBJ_OPENLINK | \
25 OBJ_OPENIF | OBJ_CASE_INSENSITIVE | OBJ_EXCLUSIVE | \
26 OBJ_PERMANENT | OBJ_INHERIT)
27 #define InitializeObjectAttributes(p,n,a,r,s) { \
28 (p)->Length = sizeof(OBJECT_ATTRIBUTES); \
29 (p)->RootDirectory = (r); \
30 (p)->Attributes = (a); \
31 (p)->ObjectName = (n); \
32 (p)->SecurityDescriptor = (s); \
33 (p)->SecurityQualityOfService = NULL; \
34 }
35 #ifndef NT_SUCCESS
36 #define NT_SUCCESS(x) ((x)>=0)
37 #endif
38 #define NT_WARNING(x) ((ULONG)(x)>>30==2)
39 #define NT_ERROR(x) ((ULONG)(x)>>30==3)
40 #if !defined(_NTSECAPI_H) && !defined(_SUBAUTH_H)
41 typedef LONG NTSTATUS, *PNTSTATUS;
42 typedef struct _UNICODE_STRING {
43 USHORT Length;
44 USHORT MaximumLength;
45 PWSTR Buffer;
46 } UNICODE_STRING, *PUNICODE_STRING;
47 typedef const UNICODE_STRING* PCUNICODE_STRING;
48 typedef struct _STRING {
49 USHORT Length;
50 USHORT MaximumLength;
51 PCHAR Buffer;
52 } STRING, *PSTRING;
53 #endif
54 typedef STRING ANSI_STRING;
55 typedef PSTRING PANSI_STRING;
56 typedef STRING OEM_STRING;
57 typedef PSTRING POEM_STRING;
58 typedef CONST STRING* PCOEM_STRING;
59 typedef STRING CANSI_STRING;
60 typedef PSTRING PCANSI_STRING;
61 typedef LARGE_INTEGER PHYSICAL_ADDRESS, *PPHYSICAL_ADDRESS;
62 typedef enum _SECTION_INHERIT {
63 ViewShare = 1,
64 ViewUnmap = 2
65 } SECTION_INHERIT;
66 typedef enum _NT_PRODUCT_TYPE {
67 NtProductWinNt = 1,
68 NtProductLanManNt,
69 NtProductServer
70 } NT_PRODUCT_TYPE, *PNT_PRODUCT_TYPE;
71 #if !defined(_NTSECAPI_H)
72 typedef struct _OBJECT_ATTRIBUTES {
73 ULONG Length;
74 HANDLE RootDirectory;
75 PUNICODE_STRING ObjectName;
76 ULONG Attributes;
77 PVOID SecurityDescriptor;
78 PVOID SecurityQualityOfService;
79 } OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES;
80 #endif
81 #define NOTHING
82 #define RTL_CONSTANT_STRING(s) { sizeof(s)-sizeof((s)[0]), sizeof(s), s }
83 #define TYPE_ALIGNMENT( t ) FIELD_OFFSET( struct { char x; t test; }, test )
84
85 #define MINCHAR 0x80
86 #define MAXCHAR 0x7f
87 #define MINSHORT 0x8000
88 #define MAXSHORT 0x7fff
89 #define MINLONG 0x80000000
90 #define MAXLONG 0x7fffffff
91 #define MAXUCHAR 0xff
92 #define MAXUSHORT 0xffff
93 #define MAXULONG 0xffffffff
94 #endif /* _NTDEF_H */