Fixed packing and layout of many system structures.
[wine/wine64.git] / include / ntdef.h
blob742f32a0f20943e007937d00602dc9bd7fb7e744
1 #ifndef __WINE_NTDEF_H
2 #define __WINE_NTDEF_H
4 #include "basetsd.h"
5 #include "windef.h"
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
11 #define NTAPI __stdcall
13 #ifndef IN
14 #define IN
15 #endif
17 #ifndef OUT
18 #define OUT
19 #endif
21 #ifndef OPTIONAL
22 #define OPTIONAL
23 #endif
25 #ifndef VOID
26 #define VOID void
27 #endif
29 typedef LONG NTSTATUS;
30 typedef NTSTATUS *PNTSTATUS;
32 typedef short CSHORT;
33 typedef CSHORT *PCSHORT;
36 /* NT lowlevel Strings (handled by Rtl* functions in NTDLL)
37 * If they are zero terminated, Length does not include the terminating 0.
40 typedef struct _STRING {
41 USHORT Length;
42 USHORT MaximumLength;
43 PSTR Buffer;
44 } STRING,*PSTRING,ANSI_STRING,*PANSI_STRING;
46 typedef struct _CSTRING {
47 USHORT Length;
48 USHORT MaximumLength;
49 PCSTR Buffer;
50 } CSTRING,*PCSTRING;
52 typedef struct _UNICODE_STRING {
53 USHORT Length; /* bytes */
54 USHORT MaximumLength; /* bytes */
55 PWSTR Buffer;
56 } UNICODE_STRING,*PUNICODE_STRING;
59 Objects
62 #define OBJ_INHERIT 0x00000002L
63 #define OBJ_PERMANENT 0x00000010L
64 #define OBJ_EXCLUSIVE 0x00000020L
65 #define OBJ_CASE_INSENSITIVE 0x00000040L
66 #define OBJ_OPENIF 0x00000080L
67 #define OBJ_OPENLINK 0x00000100L
68 #define OBJ_KERNEL_HANDLE 0x00000200L
69 #define OBJ_VALID_ATTRIBUTES 0x000003F2L
71 typedef struct _OBJECT_ATTRIBUTES
72 { ULONG Length;
73 HANDLE RootDirectory;
74 PUNICODE_STRING ObjectName;
75 ULONG Attributes;
76 PVOID SecurityDescriptor; /* type SECURITY_DESCRIPTOR */
77 PVOID SecurityQualityOfService; /* type SECURITY_QUALITY_OF_SERVICE */
78 } OBJECT_ATTRIBUTES;
80 typedef OBJECT_ATTRIBUTES *POBJECT_ATTRIBUTES;
82 #define InitializeObjectAttributes(p,n,a,r,s) \
83 { (p)->Length = sizeof(OBJECT_ATTRIBUTES); \
84 (p)->RootDirectory = r; \
85 (p)->Attributes = a; \
86 (p)->ObjectName = n; \
87 (p)->SecurityDescriptor = s; \
88 (p)->SecurityQualityOfService = NULL; \
92 #ifdef __cplusplus
94 #endif
96 #endif