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