OSDN Git Service

Correct mistyped __MINGW_NOTHROW macro.
[mingw/mingw-org-wsl.git] / include / ntdef.h
1 /**
2  * @file ntdef.h
3  * Copyright 2012, 2013 MinGW.org project
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  * 
12  * The above copyright notice and this permission notice (including the next
13  * paragraph) shall be included in all copies or substantial portions of the
14  * Software.
15  * 
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  * DEALINGS IN THE SOFTWARE.
23  */
24 #ifndef _NTDEF_H
25 #define _NTDEF_H
26 #pragma GCC system_header
27 #include <_mingw.h>
28
29 #define NTAPI __stdcall
30 #define OBJ_INHERIT 2L
31 #define OBJ_PERMANENT 16L
32 #define OBJ_EXCLUSIVE 32L
33 #define OBJ_CASE_INSENSITIVE 64L
34 #define OBJ_OPENIF 128L
35 #define OBJ_OPENLINK 256L
36 #define OBJ_VALID_ATTRIBUTES 498L
37 #define InitializeObjectAttributes(p,n,a,r,s) { \
38   (p)->Length = sizeof(OBJECT_ATTRIBUTES); \
39   (p)->RootDirectory = (r); \
40   (p)->Attributes = (a); \
41   (p)->ObjectName = (n); \
42   (p)->SecurityDescriptor = (s); \
43   (p)->SecurityQualityOfService = NULL; \
44 }
45
46 #ifndef NT_SUCCESS
47 #define NT_SUCCESS(x) ((x)>=0)
48 #define STATUS_SUCCESS ((NTSTATUS)0)
49 #endif
50
51 #if !defined(_NTSECAPI_H) && !defined(_SUBAUTH_H)
52 typedef LONG NTSTATUS, *PNTSTATUS;
53 typedef struct _UNICODE_STRING {
54   USHORT Length;
55   USHORT MaximumLength;
56   PWSTR  Buffer;
57 } UNICODE_STRING, *PUNICODE_STRING;
58 typedef const UNICODE_STRING* PCUNICODE_STRING;
59 typedef struct _STRING {
60   USHORT Length;
61   USHORT MaximumLength;
62   PCHAR  Buffer;
63 } STRING, *PSTRING;
64 #endif
65
66 typedef STRING ANSI_STRING;
67 typedef PSTRING PANSI_STRING;
68 typedef STRING OEM_STRING;
69 typedef PSTRING POEM_STRING;
70 typedef LARGE_INTEGER PHYSICAL_ADDRESS, *PPHYSICAL_ADDRESS;
71 typedef enum _SECTION_INHERIT {
72   ViewShare = 1,
73   ViewUnmap = 2
74 } SECTION_INHERIT;
75
76 #if !defined(_NTSECAPI_H)
77 typedef struct _OBJECT_ATTRIBUTES {
78   ULONG Length;
79   HANDLE RootDirectory;
80   PUNICODE_STRING ObjectName;
81   ULONG Attributes;                      
82   PVOID SecurityDescriptor;              
83   PVOID SecurityQualityOfService;
84 } OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES;
85 #endif
86
87 #endif /* _NTDEF_H */