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