4 #pragma GCC system_header
7 /* TODO: some compilers support this */
8 #define RESTRICTED_POINTER
10 #define NTAPI __stdcall
12 #define OBJ_INHERIT 0x00000002
13 #define OBJ_PERMANENT 0x00000010
14 #define OBJ_EXCLUSIVE 0x00000020
15 #define OBJ_CASE_INSENSITIVE 0x00000040
16 #define OBJ_OPENIF 0x00000080
17 #define OBJ_OPENLINK 0x00000100
18 #define OBJ_KERNEL_HANDLE 0x00000200
19 #define OBJ_VALID_ATTRIBUTES (OBJ_KERNEL_HANDLE | OBJ_OPENLINK | \
20 OBJ_OPENIF | OBJ_CASE_INSENSITIVE | OBJ_EXCLUSIVE | \
21 OBJ_PERMANENT | OBJ_INHERIT)
22 #define InitializeObjectAttributes(p,n,a,r,s) { \
23 (p)->Length = sizeof(OBJECT_ATTRIBUTES); \
24 (p)->RootDirectory = (r); \
25 (p)->Attributes = (a); \
26 (p)->ObjectName = (n); \
27 (p)->SecurityDescriptor = (s); \
28 (p)->SecurityQualityOfService = NULL; \
31 #define NT_SUCCESS(x) ((x)>=0)
32 #define STATUS_SUCCESS ((NTSTATUS)0)
34 #define NT_WARNING(x) ((ULONG)(x)>>30==2)
35 #define NT_ERROR(x) ((ULONG)(x)>>30==3)
36 #if !defined(_NTSECAPI_H) && !defined(_SUBAUTH_H)
37 typedef LONG NTSTATUS
, *PNTSTATUS
;
38 typedef struct _UNICODE_STRING
{
42 } UNICODE_STRING
, *PUNICODE_STRING
;
43 typedef const UNICODE_STRING
* PCUNICODE_STRING
;
44 typedef struct _STRING
{
50 typedef STRING ANSI_STRING
;
51 typedef PSTRING PANSI_STRING
;
52 typedef STRING OEM_STRING
;
53 typedef PSTRING POEM_STRING
;
54 typedef CONST STRING
* PCOEM_STRING
;
55 typedef STRING CANSI_STRING
;
56 typedef PSTRING PCANSI_STRING
;
57 typedef LARGE_INTEGER PHYSICAL_ADDRESS
, *PPHYSICAL_ADDRESS
;
58 typedef enum _SECTION_INHERIT
{
62 typedef enum _NT_PRODUCT_TYPE
{
66 } NT_PRODUCT_TYPE
, *PNT_PRODUCT_TYPE
;
67 #if !defined(_NTSECAPI_H)
68 typedef struct _OBJECT_ATTRIBUTES
{
71 PUNICODE_STRING ObjectName
;
73 PVOID SecurityDescriptor
;
74 PVOID SecurityQualityOfService
;
75 } OBJECT_ATTRIBUTES
, *POBJECT_ATTRIBUTES
;
78 #define RTL_CONSTANT_STRING(s) { sizeof(s)-sizeof((s)[0]), sizeof(s), s }
79 #define TYPE_ALIGNMENT( t ) FIELD_OFFSET( struct { char x; t test; }, test )
83 #define MINSHORT 0x8000
84 #define MAXSHORT 0x7fff
85 #define MINLONG 0x80000000
86 #define MAXLONG 0x7fffffff
88 #define MAXUSHORT 0xffff
89 #define MAXULONG 0xffffffff