Many fixes to NDK
[reactos.git] / reactos / include / ndk / pstypes.h
1 /*
2 * PROJECT: ReactOS Native Headers
3 * FILE: include/ndk/pstypes.h
4 * PURPOSE: Defintions for Process Manager Types not documented in DDK/IFS.
5 * PROGRAMMER: Alex Ionescu (alex@relsoft.net)
6 * UPDATE HISTORY:
7 * Created 06/10/04
8 */
9 #ifndef _PSTYPES_H
10 #define _PSTYPES_H
11
12 /* DEPENDENCIES **************************************************************/
13 #include "ldrtypes.h"
14 #include "rtltypes.h"
15
16 /* EXPORTED DATA *************************************************************/
17
18 extern NTOSAPI struct _EPROCESS* PsInitialSystemProcess;
19 extern NTOSAPI POBJECT_TYPE PsProcessType;
20 extern NTOSAPI POBJECT_TYPE PsThreadType;
21
22 /* CONSTANTS *****************************************************************/
23
24 /* These are not exposed to drivers normally */
25 #ifndef _NTOS_MODE_USER
26 #define JOB_OBJECT_ASSIGN_PROCESS (1)
27 #define JOB_OBJECT_SET_ATTRIBUTES (2)
28 #define JOB_OBJECT_QUERY (4)
29 #define JOB_OBJECT_TERMINATE (8)
30 #define JOB_OBJECT_SET_SECURITY_ATTRIBUTES (16)
31 #define JOB_OBJECT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|31)
32 #endif
33
34 /* FIXME: This was changed in XP... Ask ThomasW about it */
35 #define PROCESS_SET_PORT 0x800
36
37 #define THREAD_ALERT 0x4
38
39 #define USER_SHARED_DATA (0x7FFE0000)
40
41 /* ENUMERATIONS **************************************************************/
42
43 /* FUNCTION TYPES **********************************************/
44 typedef DWORD (*STDCALL PTHREAD_START_ROUTINE) (LPVOID);
45
46 /* TYPES *********************************************************************/
47
48 struct _ETHREAD;
49
50 typedef struct _CURDIR
51 {
52 UNICODE_STRING DosPath;
53 PVOID Handle;
54 } CURDIR, *PCURDIR;
55
56 typedef struct _PEB_FREE_BLOCK
57 {
58 struct _PEB_FREE_BLOCK* Next;
59 ULONG Size;
60 } PEB_FREE_BLOCK, *PPEB_FREE_BLOCK;
61
62 typedef struct _PEB
63 {
64 UCHAR InheritedAddressSpace; /* 00h */
65 UCHAR ReadImageFileExecOptions; /* 01h */
66 UCHAR BeingDebugged; /* 02h */
67 UCHAR Spare; /* 03h */
68 PVOID Mutant; /* 04h */
69 PVOID ImageBaseAddress; /* 08h */
70 PPEB_LDR_DATA Ldr; /* 0Ch */
71 PRTL_USER_PROCESS_PARAMETERS ProcessParameters; /* 10h */
72 PVOID SubSystemData; /* 14h */
73 PVOID ProcessHeap; /* 18h */
74 PVOID FastPebLock; /* 1Ch */
75 PPEBLOCKROUTINE FastPebLockRoutine; /* 20h */
76 PPEBLOCKROUTINE FastPebUnlockRoutine; /* 24h */
77 ULONG EnvironmentUpdateCount; /* 28h */
78 PVOID* KernelCallbackTable; /* 2Ch */
79 PVOID EventLogSection; /* 30h */
80 PVOID EventLog; /* 34h */
81 PPEB_FREE_BLOCK FreeList; /* 38h */
82 ULONG TlsExpansionCounter; /* 3Ch */
83 PVOID TlsBitmap; /* 40h */
84 ULONG TlsBitmapBits[0x2]; /* 44h */
85 PVOID ReadOnlySharedMemoryBase; /* 4Ch */
86 PVOID ReadOnlySharedMemoryHeap; /* 50h */
87 PVOID* ReadOnlyStaticServerData; /* 54h */
88 PVOID AnsiCodePageData; /* 58h */
89 PVOID OemCodePageData; /* 5Ch */
90 PVOID UnicodeCaseTableData; /* 60h */
91 ULONG NumberOfProcessors; /* 64h */
92 ULONG NtGlobalFlag; /* 68h */
93 UCHAR Spare2[0x4]; /* 6Ch */
94 LARGE_INTEGER CriticalSectionTimeout; /* 70h */
95 ULONG HeapSegmentReserve; /* 78h */
96 ULONG HeapSegmentCommit; /* 7Ch */
97 ULONG HeapDeCommitTotalFreeThreshold; /* 80h */
98 ULONG HeapDeCommitFreeBlockThreshold; /* 84h */
99 ULONG NumberOfHeaps; /* 88h */
100 ULONG MaximumNumberOfHeaps; /* 8Ch */
101 PVOID** ProcessHeaps; /* 90h */
102 PVOID GdiSharedHandleTable; /* 94h */
103 PVOID ProcessStarterHelper; /* 98h */
104 PVOID GdiDCAttributeList; /* 9Ch */
105 PVOID LoaderLock; /* A0h */
106 ULONG OSMajorVersion; /* A4h */
107 ULONG OSMinorVersion; /* A8h */
108 USHORT OSBuildNumber; /* ACh */
109 UCHAR SPMajorVersion; /* AEh */
110 UCHAR SPMinorVersion; /* AFh */
111 ULONG OSPlatformId; /* B0h */
112 ULONG ImageSubSystem; /* B4h */
113 ULONG ImageSubSystemMajorVersion; /* B8h */
114 ULONG ImageSubSystemMinorVersion; /* C0h */
115 ULONG GdiHandleBuffer[0x22]; /* C4h */
116 } PEB;
117
118 typedef struct _GDI_TEB_BATCH
119 {
120 ULONG Offset;
121 ULONG HDC;
122 ULONG Buffer[0x136];
123 } GDI_TEB_BATCH, *PGDI_TEB_BATCH;
124
125 typedef struct _INITIAL_TEB
126 {
127 PVOID StackBase;
128 PVOID StackLimit;
129 PVOID StackCommit;
130 PVOID StackCommitMax;
131 PVOID StackReserved;
132 } INITIAL_TEB, *PINITIAL_TEB;
133
134 typedef struct _TEB
135 {
136 NT_TIB Tib; /* 00h */
137 PVOID EnvironmentPointer; /* 1Ch */
138 CLIENT_ID Cid; /* 20h */
139 PVOID ActiveRpcInfo; /* 28h */
140 PVOID ThreadLocalStoragePointer; /* 2Ch */
141 struct _PEB *Peb; /* 30h */
142 ULONG LastErrorValue; /* 34h */
143 ULONG CountOfOwnedCriticalSections; /* 38h */
144 PVOID CsrClientThread; /* 3Ch */
145 struct _W32THREAD* Win32ThreadInfo; /* 40h */
146 ULONG Win32ClientInfo[0x1F]; /* 44h */
147 PVOID WOW32Reserved; /* C0h */
148 LCID CurrentLocale; /* C4h */
149 ULONG FpSoftwareStatusRegister; /* C8h */
150 PVOID SystemReserved1[0x36]; /* CCh */
151 PVOID Spare1; /* 1A4h */
152 LONG ExceptionCode; /* 1A8h */
153 UCHAR SpareBytes1[0x28]; /* 1ACh */
154 PVOID SystemReserved2[0xA]; /* 1D4h */
155 GDI_TEB_BATCH GdiTebBatch; /* 1FCh */
156 ULONG gdiRgn; /* 6DCh */
157 ULONG gdiPen; /* 6E0h */
158 ULONG gdiBrush; /* 6E4h */
159 CLIENT_ID RealClientId; /* 6E8h */
160 PVOID GdiCachedProcessHandle; /* 6F0h */
161 ULONG GdiClientPID; /* 6F4h */
162 ULONG GdiClientTID; /* 6F8h */
163 PVOID GdiThreadLocaleInfo; /* 6FCh */
164 PVOID UserReserved[5]; /* 700h */
165 PVOID glDispatchTable[0x118]; /* 714h */
166 ULONG glReserved1[0x1A]; /* B74h */
167 PVOID glReserved2; /* BDCh */
168 PVOID glSectionInfo; /* BE0h */
169 PVOID glSection; /* BE4h */
170 PVOID glTable; /* BE8h */
171 PVOID glCurrentRC; /* BECh */
172 PVOID glContext; /* BF0h */
173 NTSTATUS LastStatusValue; /* BF4h */
174 UNICODE_STRING StaticUnicodeString; /* BF8h */
175 WCHAR StaticUnicodeBuffer[0x105]; /* C00h */
176 PVOID DeallocationStack; /* E0Ch */
177 PVOID TlsSlots[0x40]; /* E10h */
178 LIST_ENTRY TlsLinks; /* F10h */
179 PVOID Vdm; /* F18h */
180 PVOID ReservedForNtRpc; /* F1Ch */
181 PVOID DbgSsReserved[0x2]; /* F20h */
182 ULONG HardErrorDisabled; /* F28h */
183 PVOID Instrumentation[0x10]; /* F2Ch */
184 PVOID WinSockData; /* F6Ch */
185 ULONG GdiBatchCount; /* F70h */
186 USHORT _Spare2; /* F74h */
187 BOOLEAN IsFiber; /* F76h */
188 UCHAR Spare3; /* F77h */
189 ULONG _Spare4; /* F78h */
190 ULONG _Spare5; /* F7Ch */
191 PVOID ReservedForOle; /* F80h */
192 ULONG WaitingOnLoaderLock; /* F84h */
193 ULONG _Unknown[11]; /* F88h */
194 PVOID FlsSlots; /* FB4h */
195 PVOID WineDebugInfo; /* Needed for WINE DLL's */
196 } TEB, *PTEB;
197
198 #endif