e174146604118bb6af3a6f214b5f169029a05f13
[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 "mmtypes.h"
15 #include "obtypes.h"
16 #include "extypes.h"
17 #ifndef NTOS_MODE_USER
18 #include "setypes.h"
19 #endif
20
21 /* EXPORTED DATA *************************************************************/
22
23 #ifndef NTOS_MODE_USER
24 extern NTSYSAPI struct _EPROCESS* PsInitialSystemProcess;
25 extern NTSYSAPI POBJECT_TYPE PsProcessType;
26 #endif
27
28 /* CONSTANTS *****************************************************************/
29
30 /* These are not exposed to drivers normally */
31 #ifndef NTOS_MODE_USER
32 #define JOB_OBJECT_ASSIGN_PROCESS 1
33 #define JOB_OBJECT_SET_ATTRIBUTES 2
34 #define JOB_OBJECT_QUERY 4
35 #define JOB_OBJECT_TERMINATE 8
36 #define JOB_OBJECT_SET_SECURITY_ATTRIBUTES 16
37 #define JOB_OBJECT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|31)
38 #endif
39
40 #define USER_SHARED_DATA (0x7FFE0000)
41
42 #ifdef NTOS_MODE_USER
43 /* Macros for current Process/Thread built-in 'special' ID */
44 #define NtCurrentProcess() ((HANDLE)(LONG_PTR)-1)
45 #define ZwCurrentProcess() NtCurrentProcess()
46 #define NtCurrentThread() ((HANDLE)(LONG_PTR)-2)
47 #define ZwCurrentThread() NtCurrentThread()
48 #endif
49
50 /* Process priority classes */
51 #define PROCESS_PRIORITY_CLASS_INVALID 0
52 #define PROCESS_PRIORITY_CLASS_IDLE 1
53 #define PROCESS_PRIORITY_CLASS_NORMAL 2
54 #define PROCESS_PRIORITY_CLASS_HIGH 3
55 #define PROCESS_PRIORITY_CLASS_REALTIME 4
56 #define PROCESS_PRIORITY_CLASS_BELOW_NORMAL 5
57 #define PROCESS_PRIORITY_CLASS_ABOVE_NORMAL 6
58
59 /* Global Flags */
60 #define FLG_STOP_ON_EXCEPTION 0x00000001
61 #define FLG_SHOW_LDR_SNAPS 0x00000002
62 #define FLG_DEBUG_INITIAL_COMMAND 0x00000004
63 #define FLG_STOP_ON_HUNG_GUI 0x00000008
64 #define FLG_HEAP_ENABLE_TAIL_CHECK 0x00000010
65 #define FLG_HEAP_ENABLE_FREE_CHECK 0x00000020
66 #define FLG_HEAP_VALIDATE_PARAMETERS 0x00000040
67 #define FLG_HEAP_VALIDATE_ALL 0x00000080
68 #define FLG_POOL_ENABLE_TAIL_CHECK 0x00000100
69 #define FLG_POOL_ENABLE_FREE_CHECK 0x00000200
70 #define FLG_POOL_ENABLE_TAGGING 0x00000400
71 #define FLG_HEAP_ENABLE_TAGGING 0x00000800
72 #define FLG_USER_STACK_TRACE_DB 0x00001000
73 #define FLG_KERNEL_STACK_TRACE_DB 0x00002000
74 #define FLG_MAINTAIN_OBJECT_TYPELIST 0x00004000
75 #define FLG_HEAP_ENABLE_TAG_BY_DLL 0x00008000
76 #define FLG_IGNORE_DEBUG_PRIV 0x00010000
77 #define FLG_ENABLE_CSRDEBUG 0x00020000
78 #define FLG_ENABLE_KDEBUG_SYMBOL_LOAD 0x00040000
79 #define FLG_DISABLE_PAGE_KERNEL_STACKS 0x00080000
80 #define FLG_HEAP_ENABLE_CALL_TRACING 0x00100000
81 #define FLG_HEAP_DISABLE_COALESCING 0x00200000
82 #define FLG_ENABLE_CLOSE_EXCEPTIONS 0x00400000
83 #define FLG_ENABLE_EXCEPTION_LOGGING 0x00800000
84 #define FLG_ENABLE_HANDLE_TYPE_TAGGING 0x01000000
85 #define FLG_HEAP_PAGE_ALLOCS 0x02000000
86 #define FLG_DEBUG_INITIAL_COMMAND_EX 0x04000000
87
88 /* ENUMERATIONS **************************************************************/
89
90 #ifdef NTOS_MODE_USER
91 typedef enum _PROCESSINFOCLASS
92 {
93 ProcessBasicInformation,
94 ProcessQuotaLimits,
95 ProcessIoCounters,
96 ProcessVmCounters,
97 ProcessTimes,
98 ProcessBasePriority,
99 ProcessRaisePriority,
100 ProcessDebugPort,
101 ProcessExceptionPort,
102 ProcessAccessToken,
103 ProcessLdtInformation,
104 ProcessLdtSize,
105 ProcessDefaultHardErrorMode,
106 ProcessIoPortHandlers,
107 ProcessPooledUsageAndLimits,
108 ProcessWorkingSetWatch,
109 ProcessUserModeIOPL,
110 ProcessEnableAlignmentFaultFixup,
111 ProcessPriorityClass,
112 ProcessWx86Information,
113 ProcessHandleCount,
114 ProcessAffinityMask,
115 ProcessPriorityBoost,
116 ProcessDeviceMap,
117 ProcessSessionInformation,
118 ProcessForegroundInformation,
119 ProcessWow64Information,
120 ProcessImageFileName,
121 ProcessLUIDDeviceMapsEnabled,
122 ProcessBreakOnTermination,
123 ProcessDebugObjectHandle,
124 ProcessDebugFlags,
125 ProcessHandleTracing,
126 ProcessIoPriority,
127 ProcessExecuteFlags,
128 ProcessTlsInformation,
129 ProcessCookie,
130 ProcessImageInformation,
131 ProcessCycleTime,
132 ProcessPagePriority,
133 ProcessInstrumentationCallback,
134 MaxProcessInfoClass
135 } PROCESSINFOCLASS;
136
137 typedef enum _THREADINFOCLASS
138 {
139 ThreadBasicInformation,
140 ThreadTimes,
141 ThreadPriority,
142 ThreadBasePriority,
143 ThreadAffinityMask,
144 ThreadImpersonationToken,
145 ThreadDescriptorTableEntry,
146 ThreadEnableAlignmentFaultFixup,
147 ThreadEventPair_Reusable,
148 ThreadQuerySetWin32StartAddress,
149 ThreadZeroTlsCell,
150 ThreadPerformanceCount,
151 ThreadAmILastThread,
152 ThreadIdealProcessor,
153 ThreadPriorityBoost,
154 ThreadSetTlsArrayAddress,
155 ThreadIsIoPending,
156 ThreadHideFromDebugger,
157 ThreadBreakOnTermination,
158 ThreadSwitchLegacyState,
159 ThreadIsTerminated,
160 ThreadLastSystemCall,
161 ThreadIoPriority,
162 ThreadCycleTime,
163 ThreadPagePriority,
164 ThreadActualBasePriority,
165 MaxThreadInfoClass
166 } THREADINFOCLASS;
167 #endif
168
169 #ifndef NTOS_MODE_USER
170 typedef enum _JOBOBJECTINFOCLASS
171 {
172 JobObjectBasicAccountingInformation = 1,
173 JobObjectBasicLimitInformation,
174 JobObjectBasicProcessIdList,
175 JobObjectBasicUIRestrictions,
176 JobObjectSecurityLimitInformation,
177 JobObjectEndOfJobTimeInformation,
178 JobObjectAssociateCompletionPortInformation,
179 JobObjectBasicAndIoAccountingInformation,
180 JobObjectExtendedLimitInformation,
181 JobObjectJobSetInformation,
182 MaxJobObjectInfoClass
183 } JOBOBJECTINFOCLASS;
184 #endif
185
186 /* FUNCTION TYPES ************************************************************/
187 typedef VOID (NTAPI *PPEBLOCKROUTINE)(PVOID);
188
189 #ifndef NTOS_MODE_USER
190 typedef NTSTATUS
191 (NTAPI *PW32_PROCESS_CALLBACK)(
192 struct _EPROCESS *Process,
193 BOOLEAN Create
194 );
195
196 typedef NTSTATUS
197 (NTAPI *PW32_THREAD_CALLBACK)(
198 struct _ETHREAD *Thread,
199 BOOLEAN Create
200 );
201 #endif
202
203 /* TYPES *********************************************************************/
204
205 #ifdef NTOS_MODE_USER
206 typedef struct _CLIENT_ID
207 {
208 HANDLE UniqueProcess;
209 HANDLE UniqueThread;
210 } CLIENT_ID, *PCLIENT_ID;
211 #endif
212
213 struct _W32THREAD;
214 struct _W32PROCESS;
215
216 struct _ETHREAD;
217
218 typedef struct _DESCRIPTOR_TABLE_ENTRY
219 {
220 ULONG Selector;
221 LDT_ENTRY Descriptor;
222 } DESCRIPTOR_TABLE_ENTRY, *PDESCRIPTOR_TABLE_ENTRY;
223
224 typedef struct _PEB_FREE_BLOCK
225 {
226 struct _PEB_FREE_BLOCK* Next;
227 ULONG Size;
228 } PEB_FREE_BLOCK, *PPEB_FREE_BLOCK;
229
230 typedef struct _PEB
231 {
232 UCHAR InheritedAddressSpace; /* 00h */
233 UCHAR ReadImageFileExecOptions; /* 01h */
234 UCHAR BeingDebugged; /* 02h */
235 BOOLEAN SpareBool; /* 03h */
236 HANDLE Mutant; /* 04h */
237 PVOID ImageBaseAddress; /* 08h */
238 PPEB_LDR_DATA Ldr; /* 0Ch */
239 struct _RTL_USER_PROCESS_PARAMETERS *ProcessParameters; /* 10h */
240 PVOID SubSystemData; /* 14h */
241 PVOID ProcessHeap; /* 18h */
242 PVOID FastPebLock; /* 1Ch */
243 PPEBLOCKROUTINE FastPebLockRoutine; /* 20h */
244 PPEBLOCKROUTINE FastPebUnlockRoutine; /* 24h */
245 ULONG EnvironmentUpdateCount; /* 28h */
246 PVOID* KernelCallbackTable; /* 2Ch */
247 PVOID EventLogSection; /* 30h */
248 PVOID EventLog; /* 34h */
249 PPEB_FREE_BLOCK FreeList; /* 38h */
250 ULONG TlsExpansionCounter; /* 3Ch */
251 PVOID TlsBitmap; /* 40h */
252 ULONG TlsBitmapBits[0x2]; /* 44h */
253 PVOID ReadOnlySharedMemoryBase; /* 4Ch */
254 PVOID ReadOnlySharedMemoryHeap; /* 50h */
255 PVOID* ReadOnlyStaticServerData; /* 54h */
256 PVOID AnsiCodePageData; /* 58h */
257 PVOID OemCodePageData; /* 5Ch */
258 PVOID UnicodeCaseTableData; /* 60h */
259 ULONG NumberOfProcessors; /* 64h */
260 ULONG NtGlobalFlag; /* 68h */
261 LARGE_INTEGER CriticalSectionTimeout; /* 70h */
262 ULONG HeapSegmentReserve; /* 78h */
263 ULONG HeapSegmentCommit; /* 7Ch */
264 ULONG HeapDeCommitTotalFreeThreshold; /* 80h */
265 ULONG HeapDeCommitFreeBlockThreshold; /* 84h */
266 ULONG NumberOfHeaps; /* 88h */
267 ULONG MaximumNumberOfHeaps; /* 8Ch */
268 PVOID* ProcessHeaps; /* 90h */
269 PVOID GdiSharedHandleTable; /* 94h */
270 PVOID ProcessStarterHelper; /* 98h */
271 PVOID GdiDCAttributeList; /* 9Ch */
272 PVOID LoaderLock; /* A0h */
273 ULONG OSMajorVersion; /* A4h */
274 ULONG OSMinorVersion; /* A8h */
275 USHORT OSBuildNumber; /* ACh */
276 USHORT OSCSDVersion; /* AEh */
277 ULONG OSPlatformId; /* B0h */
278 ULONG ImageSubSystem; /* B4h */
279 ULONG ImageSubSystemMajorVersion; /* B8h */
280 ULONG ImageSubSystemMinorVersion; /* BCh */
281 ULONG ImageProcessAffinityMask; /* C0h */
282 ULONG GdiHandleBuffer[0x22]; /* C4h */
283 PVOID PostProcessInitRoutine; /* 14Ch */
284 struct _RTL_BITMAP *TlsExpansionBitmap; /* 150h */
285 ULONG TlsExpansionBitmapBits[0x20]; /* 154h */
286 ULONG SessionId; /* 1D4h */
287 PVOID AppCompatInfo; /* 1D8h */
288 UNICODE_STRING CSDVersion; /* 1DCh */
289 } PEB, *PPEB;
290
291 typedef struct _GDI_TEB_BATCH
292 {
293 ULONG Offset;
294 ULONG HDC;
295 ULONG Buffer[0x136];
296 } GDI_TEB_BATCH, *PGDI_TEB_BATCH;
297
298 typedef struct _INITIAL_TEB
299 {
300 PVOID PreviousStackBase;
301 PVOID PreviousStackLimit;
302 PVOID StackBase;
303 PVOID StackLimit;
304 PVOID AllocatedStackBase;
305 } INITIAL_TEB, *PINITIAL_TEB;
306
307 typedef struct _TEB_ACTIVE_FRAME_CONTEXT
308 {
309 ULONG Flags;
310 LPSTR FrameName;
311 } TEB_ACTIVE_FRAME_CONTEXT, *PTEB_ACTIVE_FRAME_CONTEXT;
312
313 typedef struct _TEB_ACTIVE_FRAME
314 {
315 ULONG Flags;
316 struct _TEB_ACTIVE_FRAME *Previous;
317 PTEB_ACTIVE_FRAME_CONTEXT Context;
318 } TEB_ACTIVE_FRAME, *PTEB_ACTIVE_FRAME;
319
320 typedef struct _TEB
321 {
322 NT_TIB Tib; /* 00h */
323 PVOID EnvironmentPointer; /* 1Ch */
324 CLIENT_ID Cid; /* 20h */
325 PVOID ActiveRpcHandle; /* 28h */
326 PVOID ThreadLocalStoragePointer; /* 2Ch */
327 struct _PEB *ProcessEnvironmentBlock; /* 30h */
328 ULONG LastErrorValue; /* 34h */
329 ULONG CountOfOwnedCriticalSections; /* 38h */
330 PVOID CsrClientThread; /* 3Ch */
331 struct _W32THREAD* Win32ThreadInfo; /* 40h */
332 ULONG User32Reserved[0x1A]; /* 44h */
333 ULONG UserReserved[5]; /* ACh */
334 PVOID WOW32Reserved; /* C0h */
335 LCID CurrentLocale; /* C4h */
336 ULONG FpSoftwareStatusRegister; /* C8h */
337 PVOID SystemReserved1[0x36]; /* CCh */
338 LONG ExceptionCode; /* 1A4h */
339 struct _ACTIVATION_CONTEXT_STACK *ActivationContextStackPointer; /* 1A8h */
340 UCHAR SpareBytes1[0x28]; /* 1ACh */
341 GDI_TEB_BATCH GdiTebBatch; /* 1D4h */
342 CLIENT_ID RealClientId; /* 6B4h */
343 PVOID GdiCachedProcessHandle; /* 6BCh */
344 ULONG GdiClientPID; /* 6C0h */
345 ULONG GdiClientTID; /* 6C4h */
346 PVOID GdiThreadLocalInfo; /* 6C8h */
347 ULONG Win32ClientInfo[62]; /* 6CCh */
348 PVOID glDispatchTable[0xE9]; /* 7C4h */
349 ULONG glReserved1[0x1D]; /* B68h */
350 PVOID glReserved2; /* BDCh */
351 PVOID glSectionInfo; /* BE0h */
352 PVOID glSection; /* BE4h */
353 PVOID glTable; /* BE8h */
354 PVOID glCurrentRC; /* BECh */
355 PVOID glContext; /* BF0h */
356 NTSTATUS LastStatusValue; /* BF4h */
357 UNICODE_STRING StaticUnicodeString; /* BF8h */
358 WCHAR StaticUnicodeBuffer[0x105]; /* C00h */
359 PVOID DeallocationStack; /* E0Ch */
360 PVOID TlsSlots[0x40]; /* E10h */
361 LIST_ENTRY TlsLinks; /* F10h */
362 PVOID Vdm; /* F18h */
363 PVOID ReservedForNtRpc; /* F1Ch */
364 PVOID DbgSsReserved[0x2]; /* F20h */
365 ULONG HardErrorDisabled; /* F28h */
366 PVOID Instrumentation[14]; /* F2Ch */
367 PVOID SubProcessTag; /* F64h */
368 PVOID EtwTraceData; /* F68h */
369 PVOID WinSockData; /* F6Ch */
370 ULONG GdiBatchCount; /* F70h */
371 BOOLEAN InDbgPrint; /* F74h */
372 BOOLEAN FreeStackOnTermination; /* F75h */
373 BOOLEAN HasFiberData; /* F76h */
374 UCHAR IdealProcessor; /* F77h */
375 ULONG GuaranteedStackBytes; /* F78h */
376 PVOID ReservedForPerf; /* F7Ch */
377 PVOID ReservedForOle; /* F80h */
378 ULONG WaitingOnLoaderLock; /* F84h */
379 ULONG SparePointer1; /* F88h */
380 ULONG SoftPatchPtr1; /* F8Ch */
381 ULONG SoftPatchPtr2; /* F90h */
382 PVOID *TlsExpansionSlots; /* F94h */
383 ULONG ImpersionationLocale; /* F98h */
384 ULONG IsImpersonating; /* F9Ch */
385 PVOID NlsCache; /* FA0h */
386 PVOID pShimData; /* FA4h */
387 ULONG HeapVirualAffinity; /* FA8h */
388 PVOID CurrentTransactionHandle; /* FACh */
389 PTEB_ACTIVE_FRAME ActiveFrame; /* FB0h */
390 PVOID FlsData; /* FB4h */
391 UCHAR SafeThunkCall; /* FB8h */
392 UCHAR BooleanSpare[3]; /* FB9h */
393 } TEB, *PTEB;
394
395 #ifdef NTOS_MODE_USER
396 typedef struct _PROCESS_BASIC_INFORMATION
397 {
398 NTSTATUS ExitStatus;
399 PPEB PebBaseAddress;
400 ULONG_PTR AffinityMask;
401 KPRIORITY BasePriority;
402 ULONG_PTR UniqueProcessId;
403 ULONG_PTR InheritedFromUniqueProcessId;
404 } PROCESS_BASIC_INFORMATION,*PPROCESS_BASIC_INFORMATION;
405
406 typedef struct _PROCESS_ACCESS_TOKEN
407 {
408 HANDLE Token;
409 HANDLE Thread;
410 } PROCESS_ACCESS_TOKEN, *PPROCESS_ACCESS_TOKEN;
411
412 typedef struct _PROCESS_DEVICEMAP_INFORMATION
413 {
414 union
415 {
416 struct
417 {
418 HANDLE DirectoryHandle;
419 } Set;
420 struct
421 {
422 ULONG DriveMap;
423 UCHAR DriveType[32];
424 } Query;
425 };
426 } PROCESS_DEVICEMAP_INFORMATION, *PPROCESS_DEVICEMAP_INFORMATION;
427
428 typedef struct _KERNEL_USER_TIMES
429 {
430 LARGE_INTEGER CreateTime;
431 LARGE_INTEGER ExitTime;
432 LARGE_INTEGER KernelTime;
433 LARGE_INTEGER UserTime;
434 } KERNEL_USER_TIMES, *PKERNEL_USER_TIMES;
435
436 typedef struct _PROCESS_SESSION_INFORMATION
437 {
438 ULONG SessionId;
439 } PROCESS_SESSION_INFORMATION, *PPROCESS_SESSION_INFORMATION;
440 #endif
441
442 #ifndef NTOS_MODE_USER
443 /* FIXME: see note in mmtypes.h */
444 #ifdef _NTOSKRNL_
445 #include <internal/mm.h>
446 #endif
447
448 typedef struct _EPROCESS_QUOTA_ENTRY
449 {
450 SIZE_T Usage;
451 SIZE_T Limit;
452 SIZE_T Peak;
453 SIZE_T Return;
454 } EPROCESS_QUOTA_ENTRY, *PEPROCESS_QUOTA_ENTRY;
455
456 typedef struct _EPROCESS_QUOTA_BLOCK
457 {
458 EPROCESS_QUOTA_ENTRY QuotaEntry[3];
459 LIST_ENTRY QuotaList;
460 ULONG ReferenceCount;
461 ULONG ProcessCount;
462 } EPROCESS_QUOTA_BLOCK, *PEPROCESS_QUOTA_BLOCK;
463
464 typedef struct _PAGEFAULT_HISTORY
465 {
466 ULONG CurrentIndex;
467 ULONG MapIndex;
468 KSPIN_LOCK SpinLock;
469 PVOID Reserved;
470 PROCESS_WS_WATCH_INFORMATION WatchInfo[1];
471 } PAGEFAULT_HISTORY, *PPAGEFAULT_HISTORY;
472
473 typedef struct _PS_IMPERSONATION_INFORMATION
474 {
475 PACCESS_TOKEN Token;
476 BOOLEAN CopyOnOpen;
477 BOOLEAN EffectiveOnly;
478 SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;
479 } PS_IMPERSONATION_INFORMATION, *PPS_IMPERSONATION_INFORMATION;
480
481 #include <pshpack4.h>
482 typedef struct _ETHREAD
483 {
484 KTHREAD Tcb; /* 1C0 */
485 LARGE_INTEGER CreateTime; /* 1C0 */
486 LARGE_INTEGER ExitTime; /* 1C0 */
487 union
488 {
489 LIST_ENTRY LpcReplyChain; /* 1C0 */
490 LIST_ENTRY KeyedWaitChain; /* 1C0 */
491 };
492 union
493 {
494 NTSTATUS ExitStatus; /* 1C8 */
495 PVOID OfsChain; /* 1C8 */
496 };
497 LIST_ENTRY PostBlockList; /* 1CC */
498 union
499 {
500 struct _TERMINATION_PORT *TerminationPort; /* 1D4 */
501 struct _ETHREAD *ReaperLink; /* 1D4 */
502 PVOID KeyedWaitValue; /* 1D4 */
503 };
504 KSPIN_LOCK ActiveTimerListLock; /* 1D8 */
505 LIST_ENTRY ActiveTimerListHead; /* 1D8 */
506 CLIENT_ID Cid; /* 1E0 */
507 union
508 {
509 KSEMAPHORE LpcReplySemaphore; /* 1E4 */
510 KSEMAPHORE KeyedReplySemaphore; /* 1E4 */
511 };
512 union
513 {
514 PVOID LpcReplyMessage; /* 200 */
515 PVOID LpcWaitingOnPort; /* 200 */
516 };
517 PPS_IMPERSONATION_INFORMATION ImpersonationInfo; /* 204 */
518 LIST_ENTRY IrpList; /* 208 */
519 ULONG TopLevelIrp; /* 210 */
520 PDEVICE_OBJECT DeviceToVerify; /* 214 */
521 struct _EPROCESS *ThreadsProcess; /* 218 */
522 PKSTART_ROUTINE StartAddress; /* 21C */
523 union
524 {
525 PVOID Win32StartAddress; /* 220 */
526 ULONG LpcReceivedMessageId; /* 220 */
527 };
528 LIST_ENTRY ThreadListEntry; /* 224 */
529 EX_RUNDOWN_REF RundownProtect; /* 22C */
530 EX_PUSH_LOCK ThreadLock; /* 230 */
531 ULONG LpcReplyMessageId; /* 234 */
532 ULONG ReadClusterSize; /* 238 */
533 ACCESS_MASK GrantedAccess; /* 23C */
534 union
535 {
536 struct
537 {
538 ULONG Terminated:1;
539 ULONG DeadThread:1;
540 ULONG HideFromDebugger:1;
541 ULONG ActiveImpersonationInfo:1;
542 ULONG SystemThread:1;
543 ULONG HardErrorsAreDisabled:1;
544 ULONG BreakOnTermination:1;
545 ULONG SkipCreationMsg:1;
546 ULONG SkipTerminationMsg:1;
547 };
548 ULONG CrossThreadFlags; /* 240 */
549 };
550 union
551 {
552 struct
553 {
554 ULONG ActiveExWorker:1;
555 ULONG ExWorkerCanWaitUser:1;
556 ULONG MemoryMaker:1;
557 ULONG KeyedEventInUse:1;
558 };
559 ULONG SameThreadPassiveFlags; /* 244 */
560 };
561 union
562 {
563 struct
564 {
565 ULONG LpcReceivedMsgIdValid:1;
566 ULONG LpcExitThreadCalled:1;
567 ULONG AddressSpaceOwner:1;
568 ULONG OwnsProcessWorkingSetExclusive:1;
569 ULONG OwnsProcessWorkingSetShared:1;
570 ULONG OwnsSystemWorkingSetExclusive:1;
571 ULONG OwnsSystemWorkingSetShared:1;
572 ULONG OwnsSessionWorkingSetExclusive:1;
573 ULONG OwnsSessionWorkingSetShared:1;
574 ULONG ApcNeeded:1;
575 };
576 ULONG SameThreadApcFlags; /* 248 */
577 };
578 UCHAR ForwardClusterOnly; /* 24C */
579 UCHAR DisablePageFaultClustering; /* 24D */
580 UCHAR ActiveFaultCount; /* 24E */
581 } ETHREAD;
582
583 typedef struct _EPROCESS
584 {
585 KPROCESS Pcb; /* 000 */
586 EX_PUSH_LOCK ProcessLock; /* 078 */
587 LARGE_INTEGER CreateTime; /* 080 */
588 LARGE_INTEGER ExitTime; /* 088 */
589 EX_RUNDOWN_REF RundownProtect; /* 090 */
590 HANDLE UniqueProcessId; /* 094 */
591 LIST_ENTRY ActiveProcessLinks; /* 098 */
592 ULONG QuotaUsage[3]; /* 0A0 */
593 ULONG QuotaPeak[3]; /* 0AC */
594 ULONG CommitCharge; /* 0B8 */
595 ULONG PeakVirtualSize; /* 0BC */
596 ULONG VirtualSize; /* 0C0 */
597 LIST_ENTRY SessionProcessLinks; /* 0C4 */
598 PVOID DebugPort; /* 0CC */
599 PVOID ExceptionPort; /* 0D0 */
600 PHANDLE_TABLE ObjectTable; /* 0D4 */
601 EX_FAST_REF Token; /* 0D8 */
602 ULONG WorkingSetPage; /* 0DC */
603 KGUARDED_MUTEX AddressCreationLock; /* 0E0 */
604 KSPIN_LOCK HyperSpaceLock; /* 100 */
605 PETHREAD ForkInProgress; /* 104 */
606 ULONG HardwareTrigger; /* 108 */
607 MM_AVL_TABLE PhysicalVadroot; /* 10C */
608 PVOID CloneRoot; /* 110 */
609 ULONG NumberOfPrivatePages; /* 114 */
610 ULONG NumberOfLockedPages; /* 118 */
611 PVOID *Win32Process; /* 11C */
612 struct _EJOB *Job; /* 120 */
613 PVOID SectionObject; /* 124 */
614 PVOID SectionBaseAddress; /* 128 */
615 PEPROCESS_QUOTA_BLOCK QuotaBlock; /* 12C */
616 PPAGEFAULT_HISTORY WorkingSetWatch; /* 130 */
617 PVOID Win32WindowStation; /* 134 */
618 HANDLE InheritedFromUniqueProcessId; /* 138 */
619 PVOID LdtInformation; /* 13C */
620 PVOID VadFreeHint; /* 140 */
621 PVOID VdmObjects; /* 144 */
622 PVOID DeviceMap; /* 148 */
623 PVOID Spare0[3]; /* 14C */
624 union
625 {
626 HARDWARE_PTE_X86 PagedirectoryPte; /* 158 */
627 ULONGLONG Filler; /* 158 */
628 };
629 ULONG Session; /* 160 */
630 CHAR ImageFileName[16]; /* 164 */
631 LIST_ENTRY JobLinks; /* 174 */
632 PVOID LockedPagesList; /* 17C */
633 LIST_ENTRY ThreadListHead; /* 184 */
634 PVOID SecurityPort; /* 188 */
635 PVOID PaeTop; /* 18C */
636 ULONG ActiveThreds; /* 190 */
637 ACCESS_MASK GrantedAccess; /* 194 */
638 ULONG DefaultHardErrorProcessing; /* 198 */
639 NTSTATUS LastThreadExitStatus; /* 19C */
640 struct _PEB* Peb; /* 1A0 */
641 EX_FAST_REF PrefetchTrace; /* 1A4 */
642 LARGE_INTEGER ReadOperationCount; /* 1A8 */
643 LARGE_INTEGER WriteOperationCount; /* 1B0 */
644 LARGE_INTEGER OtherOperationCount; /* 1B8 */
645 LARGE_INTEGER ReadTransferCount; /* 1C0 */
646 LARGE_INTEGER WriteTransferCount; /* 1C8 */
647 LARGE_INTEGER OtherTransferCount; /* 1D0 */
648 ULONG CommitChargeLimit; /* 1D8 */
649 ULONG CommitChargePeak; /* 1DC */
650 PVOID AweInfo; /* 1E0 */
651 SE_AUDIT_PROCESS_CREATION_INFO SeAuditProcessCreationInfo; /* 1E4 */
652 MMSUPPORT Vm; /* 1E8 */
653 LIST_ENTRY MmProcessLinks; /* 230 */
654 ULONG ModifiedPageCount; /* 238 */
655 ULONG JobStatus; /* 23C */
656 union
657 {
658 struct
659 {
660 ULONG CreateReported:1;
661 ULONG NoDebugInherit:1;
662 ULONG ProcessExiting:1;
663 ULONG ProcessDelete:1;
664 ULONG Wow64SplitPages:1;
665 ULONG VmDeleted:1;
666 ULONG OutswapEnabled:1;
667 ULONG Outswapped:1;
668 ULONG ForkFailed:1;
669 ULONG Wow64VaSpace4Gb:1;
670 ULONG AddressSpaceInitialized:2;
671 ULONG SetTimerResolution:1;
672 ULONG BreakOnTermination:1;
673 ULONG SessionCreationUnderway:1;
674 ULONG WriteWatch:1;
675 ULONG ProcessInSession:1;
676 ULONG OverrideAddressSpace:1;
677 ULONG HasAddressSpace:1;
678 ULONG LaunchPrefetched:1;
679 ULONG InjectInpageErrors:1;
680 ULONG VmTopDown:1;
681 ULONG ImageNotifyDone:1;
682 ULONG PdeUpdateNeeded:1;
683 ULONG VdmAllowed:1;
684 ULONG SmapAllowed:1;
685 ULONG CreateFailed:1;
686 ULONG DefaultIoPriority:3;
687 ULONG Spare1:1;
688 ULONG Spare2:1;
689 };
690 ULONG Flags; /* 240 */
691 };
692
693 NTSTATUS ExitStatus; /* 244 */
694 USHORT NextPageColor; /* 248 */
695 union
696 {
697 struct
698 {
699 UCHAR SubSystemMinorVersion; /* 24A */
700 UCHAR SubSystemMajorVersion; /* 24B */
701 };
702 USHORT SubSystemVersion; /* 24A */
703 };
704 UCHAR PriorityClass; /* 24C */
705 MM_AVL_TABLE VadRoot; /* 250 */
706 ULONG Cookie; /* 270 */
707
708 /***************************************************************
709 * REACTOS SPECIFIC START
710 ***************************************************************/
711 /* FIXME WILL BE DEPRECATED WITH PUSHLOCK SUPPORT IN 0.3.0 */
712 KEVENT LockEvent; /* 274 */
713 ULONG LockCount; /* 284 */
714 struct _KTHREAD *LockOwner; /* 288 */
715
716 /* FIXME MOVE TO AVL TREES */
717 MADDRESS_SPACE AddressSpace; /* 28C */
718 } EPROCESS;
719 #include <poppack.h>
720
721 #include <pshpack1.h>
722 typedef struct _PS_JOB_TOKEN_FILTER
723 {
724 ULONG CapturedSidCount;
725 PSID_AND_ATTRIBUTES CapturedSids;
726 ULONG CapturedSidsLength;
727 ULONG CapturedGroupCount;
728 PSID_AND_ATTRIBUTES CapturedGroups;
729 ULONG CapturedGroupsLength;
730 ULONG CapturedPrivilegeCount;
731 PLUID_AND_ATTRIBUTES CapturedPrivileges;
732 ULONG CapturedPrivilegesLength;
733 } PS_JOB_TOKEN_FILTER, *PPS_JOB_TOKEN_FILTER;
734
735 typedef struct _EJOB
736 {
737 KEVENT Event;
738 LIST_ENTRY JobLinks;
739 LIST_ENTRY ProcessListHead;
740 ERESOURCE JobLock;
741 LARGE_INTEGER TotalUserTime;
742 LARGE_INTEGER TotalKernelTime;
743 LARGE_INTEGER ThisPeriodTotalUserTime;
744 LARGE_INTEGER ThisPeriodTotalKernelTime;
745 ULONG TotalPageFaultCount;
746 ULONG TotalProcesses;
747 ULONG ActiveProcesses;
748 ULONG TotalTerminatedProcesses;
749 LARGE_INTEGER PerProcessUserTimeLimit;
750 LARGE_INTEGER PerJobUserTimeLimit;
751 ULONG LimitFlags;
752 ULONG MinimumWorkingSetSize;
753 ULONG MaximumWorkingSetSize;
754 ULONG ActiveProcessLimit;
755 ULONG Affinity;
756 UCHAR PriorityClass;
757 ULONG UIRestrictionsClass;
758 ULONG SecurityLimitFlags;
759 PVOID Token;
760 PPS_JOB_TOKEN_FILTER Filter;
761 ULONG EndOfJobTimeAction;
762 PVOID CompletionPort;
763 PVOID CompletionKey;
764 ULONG SessionId;
765 ULONG SchedulingClass;
766 ULONGLONG ReadOperationCount;
767 ULONGLONG WriteOperationCount;
768 ULONGLONG OtherOperationCount;
769 ULONGLONG ReadTransferCount;
770 ULONGLONG WriteTransferCount;
771 ULONGLONG OtherTransferCount;
772 IO_COUNTERS IoInfo;
773 ULONG ProcessMemoryLimit;
774 ULONG JobMemoryLimit;
775 ULONG PeakProcessMemoryUsed;
776 ULONG PeakJobMemoryUsed;
777 ULONG CurrentJobMemoryUsed;
778 KGUARDED_MUTEX MemoryLimitsLock;
779 ULONG MemberLevel;
780 ULONG JobFlags;
781 } EJOB, *PEJOB;
782 #include <poppack.h>
783
784 typedef struct _W32_CALLOUT_DATA
785 {
786 PW32_PROCESS_CALLBACK W32ProcessCallout;
787 PW32_THREAD_CALLBACK W32ThreadCallout;
788 PVOID UserGlobalAtomTableCallout;
789 PVOID UserPowerEventCallout;
790 PVOID UserPowerStateCallout;
791 PVOID UserJobCallout;
792 PVOID NtGdiUserFlushUserBatch;
793 OB_OPEN_METHOD DesktopOpen;
794 PVOID DesktopUnmap;
795 OB_DELETE_METHOD DesktopDelete;
796 OB_OKAYTOCLOSE_METHOD WinstaOkayToClose;
797 OB_DELETE_METHOD WinStaDelete;
798 OB_PARSE_METHOD WinStaParse;
799 OB_OPEN_METHOD WinStaOpen;
800
801 /* FIXME: These are ROS-ONLY and are fixed in a future local patch */
802 OB_FIND_METHOD WinStaFind;
803 OB_OPEN_METHOD WinStaCreate;
804 OB_CREATE_METHOD DesktopCreate;
805 } W32_CALLOUT_DATA, *PW32_CALLOUT_DATA;
806
807 #endif
808
809 #endif