uLib  User mode C/C++ extended API library for Win32 programmers.
NtTypes.h
Go to the documentation of this file.
1 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 // Project: uLib - User mode utility library.
3 // Module: Windows native data types. Public domain, from ReactOS NDK.
4 // Authors: (NDK) Copyright (c) Alex Ionescu, Timo Kreuzer, et al.
5 // Credits: Wen Jia Liu (wj32)
6 // License: The NDK License (for the most part) (may be treated as GPL/LGPL).
7 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8 
9 #ifndef __NtTypes_h_incl__
10 #define __NtTypes_h_incl__
11 
12 #ifndef NO_NDK_FILES
13 //#define NO_WINTERNAL 1 // Don't go into the Common.h WINTERNAL clause.
16 #include <uLib/Common.h> // Windows.h etc...
17 
18 #include <stdio.h> // C Standard Header
19 #include <excpt.h> // C Standard Header
20 #include <stdarg.h> // C Standard Header
21 
24 
25 // MEMO...
26 // OBJECT_ATTRIBUTES -> umtypes.h
27 // OBJ_INHERIT etc -> obtypes.h
28 // RTL_CONSTANT_OBJECT_ATTRIBUTES -> rtltypes.h
29 
31 #define NTOS_MODE_USER 1
32 #define PEVENT_TRACE_HEADER_DEFINED // Tell exfuncs.h we have it... below.
33 
35 #include <ndk/umtypes.h> // General Definitions
36 #include <ndk/cctypes.h> // Cache Manager Types
37 #include <ndk/cmtypes.h> // Configuration Manager Types
38 #include <ndk/dbgktypes.h> // User-Mode Kernel Debugging Types
39 #include <ndk/extypes.h> // Executive Types
40 #include <ndk/kdtypes.h> // Kernel Debugger Types
41 #include <ndk/ketypes.h> // Kernel Types
42 #include <ndk/haltypes.h> // Hardware Abstraction Layer Types
43 #include <ndk/ifssupp.h> // IFS Support Header
44 #include <ndk/iotypes.h> // Input/Output Manager Types
45 #include <ndk/ldrtypes.h> // Loader Types
46 #include <ndk/lpctypes.h> // Local Procedure Call Types
47 #include <ndk/mmtypes.h> // Memory Manager Types
48 #include <ndk/obtypes.h> // Object Manager Types
49 #include <ndk/potypes.h> // Power Manager Types
50 #include <ndk/pstypes.h> // Process Manager Types
51 #include <ndk/rtltypes.h> // Runtime Library Types
52 #include <ndk/setypes.h> // Security Subsystem Types
53 #include <ndk/vftypes.h> // Verifier Types
54 
56 #if 0 // Memorandum only: included in <ndk/pstypes.h>
57  #include <ndk/peb_teb.h>
58 #endif
59 #if 0 // Kernel mode only
60  #include <ndk/ifssupp.h> // Installable File System support
61 #endif
62 #if 0 // Other unmentioned headers
63  #include <ndk/kbd.h>
64  #include <ndk/muptypes.h>
65 #endif
66 
68 //== Supplements ==------------------------------------------------------------
69 
71 
72 // MEMO: It seems the module lists are circular (aka. headless), at least on Win7.
73 // That is, the three list heads in PEB_LDR_DATA do point to the first/last entries,
74 // but the LDR_MODULE entries never point to the list heads, only to each other.
75 // (That is reason enough to use different field names, yes?)
76 
77 typedef struct _LDR_MODULE // aka LDR_DATA_TABLE_ENTRY
78 {
79  #if 0 // Comply with WINE's naming
80  LIST_ENTRY InLoadOrderModuleList;
81  LIST_ENTRY InMemoryOrderModuleList;
82  LIST_ENTRY InInitializationOrderModuleList;
83  #else // Comply with LDR_DATA_TABLE_ENTRY naming
87  #endif
88  PVOID BaseAddress; // was 'DllBase' - I prefer the WINE id 'BaseAddress'
89  PVOID EntryPoint;
90  ULONG SizeOfImage;
91  UNICODE_STRING FullDllName;
92  UNICODE_STRING BaseDllName;
93  ULONG Flags;
94  SHORT LoadCount;
95  SHORT TlsIndex;
96  HANDLE SectionHandle;
97  ULONG CheckSum;
100 }
101 LDR_MODULE;
103 
104 //== Supplements from Platform SDK v7.0 ==-------------------------------------
105 
106 #ifndef _EVNTRACE_
107 // Exclude (cond) from doxygen since it makes a mess of EVENT_TRACE_HEADER :/
109 #define _EVNTRACE_ // Let NDK know we have it.
110 #ifndef DUMMYUNIONNAME
111  #if defined (NONAMELESSUNION)
112  #define DUMMYUNIONNAME u
113  #define DUMMYUNIONNAME2 u2
114  #define DUMMYUNIONNAME3 u3
115  #define DUMMYUNIONNAME4 u4
116  #define DUMMYUNIONNAME5 u5
117  #define DUMMYUNIONNAME6 u6
118  #define DUMMYUNIONNAME7 u7
119  #define DUMMYUNIONNAME8 u8
120  #define DUMMYUNIONNAME9 u9
121  #else
122  #define DUMMYUNIONNAME
123  #define DUMMYUNIONNAME2
124  #define DUMMYUNIONNAME3
125  #define DUMMYUNIONNAME4
126  #define DUMMYUNIONNAME5
127  #define DUMMYUNIONNAME6
128  #define DUMMYUNIONNAME7
129  #define DUMMYUNIONNAME8
130  #define DUMMYUNIONNAME9
131  #endif
132 #endif
133 #ifndef DUMMYSTRUCTNAME
134  #if defined (NONAMELESSUNION)
135  #define DUMMYSTRUCTNAME s
136  #define DUMMYSTRUCTNAME2 s2
137  #define DUMMYSTRUCTNAME3 s3
138  #define DUMMYSTRUCTNAME4 s4
139  #define DUMMYSTRUCTNAME5 s5
140  #else
141  #define DUMMYSTRUCTNAME
142  #define DUMMYSTRUCTNAME2
143  #define DUMMYSTRUCTNAME3
144  #define DUMMYSTRUCTNAME4
145  #define DUMMYSTRUCTNAME5
146  #endif
147 #endif
148 
154 
155 typedef struct _EVENT_TRACE_HEADER
156 {
157  USHORT Size;
158  union {
159  USHORT FieldTypeFlags;
160  struct {
161  UCHAR HeaderType;
162  UCHAR MarkerFlags;
163  } DUMMYSTRUCTNAME;
164  } DUMMYUNIONNAME;
165  union {
166  ULONG Version;
167  struct {
168  UCHAR Type;
169  UCHAR Level;
170  USHORT Version;
171  } Class;
172  } DUMMYUNIONNAME2;
173  ULONG ThreadId;
174  ULONG ProcessId;
175  LARGE_INTEGER TimeStamp;
176  union {
177  GUID Guid;
178  ULONGLONG GuidPtr;
179  } DUMMYUNIONNAME3;
180  union {
181  struct {
182  ULONG KernelTime;
183  ULONG UserTime;
184  } DUMMYSTRUCTNAME;
185  ULONG64 ProcessorTime;
186  struct {
187  ULONG ClientContext;
188  ULONG Flags;
189  } DUMMYSTRUCTNAME2;
190  } DUMMYUNIONNAME4;
191 }
192 EVENT_TRACE_HEADER;
194 typedef EVENT_TRACE_HEADER* PEVENT_TRACE_HEADER;
195 #endif //ndef _EVNTRACE_
196 
197 //== Supplements from phnt_ntdef.h ==------------------------------------------
198 
199 typedef const OBJECT_ATTRIBUTES* PCOBJECT_ATTRIBUTES;
200 
201 // Explicit x86/x64 for cross-bitness situations.
202 
203 typedef struct _OBJECT_ATTRIBUTES64
204 {
205  ULONG Length;
206  ULONG64 RootDirectory;
207  ULONG64 ObjectName;
208  ULONG Attributes;
211 }
215 
216 typedef struct _OBJECT_ATTRIBUTES32
217 {
218  ULONG Length;
220  ULONG ObjectName;
221  ULONG Attributes;
224 }
228 
230 //==---------------------------------------------------------------------------
231 #endif // ndef NO_NDK_FILES
232 #endif // ndef __NtTypes_h_incl__
233 // EOF
UNICODE_STRING FullDllName
Definition: NtTypes.h:91
PVOID BaseAddress
Definition: NtTypes.h:88
OBJECT_ATTRIBUTES64 * POBJECT_ATTRIBUTES64
Definition: NtTypes.h:213
ULONG64 SecurityQualityOfService
PSECURITY_QUALITY_OF_SERVICE.
Definition: NtTypes.h:210
SHORT TlsIndex
Definition: NtTypes.h:95
HANDLE ActivationContext
Definition: NtTypes.h:99
ULONG64 ObjectName
PUNICODE_STRING.
Definition: NtTypes.h:207
ULONG CheckSum
Definition: NtTypes.h:97
LIST_ENTRY InInitializationOrderLinks
Definition: NtTypes.h:86
SHORT LoadCount
Definition: NtTypes.h:94
ULONG SecurityDescriptor
PSECURITY_DESCRIPTOR.
Definition: NtTypes.h:222
ULONG64 RootDirectory
HANDLE.
Definition: NtTypes.h:206
UNICODE_STRING BaseDllName
Definition: NtTypes.h:92
ULONG SizeOfImage
Definition: NtTypes.h:90
EVENT_TRACE_HEADER * PEVENT_TRACE_HEADER
Definition: NtTypes.h:194
LDR_MODULE * PLDR_MODULE
Definition: NtTypes.h:102
ULONG RootDirectory
HANDLE.
Definition: NtTypes.h:219
const OBJECT_ATTRIBUTES * PCOBJECT_ATTRIBUTES
Definition: NtTypes.h:199
ULONG Flags
Definition: NtTypes.h:93
OBJECT_ATTRIBUTES32 * POBJECT_ATTRIBUTES32
Definition: NtTypes.h:226
LIST_ENTRY InMemoryOrderLinks
Definition: NtTypes.h:85
ULONG ObjectName
PUNICODE_STRING.
Definition: NtTypes.h:220
HANDLE SectionHandle
Definition: NtTypes.h:96
Common include; Added types, small "ubiquitous" utilities, et c.
ULONG SecurityQualityOfService
PSECURITY_QUALITY_OF_SERVICE.
Definition: NtTypes.h:223
const OBJECT_ATTRIBUTES64 * PCOBJECT_ATTRIBUTES64
Definition: NtTypes.h:214
const OBJECT_ATTRIBUTES32 * PCOBJECT_ATTRIBUTES32
Definition: NtTypes.h:227
PVOID EntryPoint
Definition: NtTypes.h:89
ULONG64 SecurityDescriptor
PSECURITY_DESCRIPTOR.
Definition: NtTypes.h:209
ULONG TimeDateStamp
Definition: NtTypes.h:98
LIST_ENTRY InLoadOrderLinks
Definition: NtTypes.h:84