4 #pragma GCC system_header
7 /* TODO: some compilers support this */
8 #define RESTRICTED_POINTER
10 #define NTAPI __stdcall
11 #if !defined(_M_CEE_PURE)
12 #define NTAPI_INLINE NTAPI
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; \
36 #define NT_SUCCESS(x) ((x)>=0)
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
{
46 } UNICODE_STRING
, *PUNICODE_STRING
;
47 typedef const UNICODE_STRING
* PCUNICODE_STRING
;
48 typedef struct _STRING
{
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
{
66 typedef enum _NT_PRODUCT_TYPE
{
70 } NT_PRODUCT_TYPE
, *PNT_PRODUCT_TYPE
;
71 #if !defined(_NTSECAPI_H)
72 typedef struct _OBJECT_ATTRIBUTES
{
75 PUNICODE_STRING ObjectName
;
77 PVOID SecurityDescriptor
;
78 PVOID SecurityQualityOfService
;
79 } OBJECT_ATTRIBUTES
, *POBJECT_ATTRIBUTES
;
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 )
87 #define MINSHORT 0x8000
88 #define MAXSHORT 0x7fff
89 #define MINLONG 0x80000000
90 #define MAXLONG 0x7fffffff
92 #define MAXUSHORT 0xffff
93 #define MAXULONG 0xffffffff