3 Copyright (c) Alex Ionescu. All rights reserved.
11 Type definitions for the Process Manager
15 Alex Ionescu (alex.ionescu@reactos.com) 06-Oct-2004
29 #ifndef NTOS_MODE_USER
35 // KUSER_SHARED_DATA location in User Mode
37 #define USER_SHARED_DATA (0x7FFE0000)
42 #ifndef NTOS_MODE_USER
44 extern NTSYSAPI
struct _EPROCESS
* PsInitialSystemProcess
;
45 extern NTSYSAPI POBJECT_TYPE PsProcessType
;
52 #define FLG_STOP_ON_EXCEPTION 0x00000001
53 #define FLG_SHOW_LDR_SNAPS 0x00000002
54 #define FLG_DEBUG_INITIAL_COMMAND 0x00000004
55 #define FLG_STOP_ON_HUNG_GUI 0x00000008
56 #define FLG_HEAP_ENABLE_TAIL_CHECK 0x00000010
57 #define FLG_HEAP_ENABLE_FREE_CHECK 0x00000020
58 #define FLG_HEAP_VALIDATE_PARAMETERS 0x00000040
59 #define FLG_HEAP_VALIDATE_ALL 0x00000080
60 #define FLG_POOL_ENABLE_TAIL_CHECK 0x00000100
61 #define FLG_POOL_ENABLE_FREE_CHECK 0x00000200
62 #define FLG_POOL_ENABLE_TAGGING 0x00000400
63 #define FLG_HEAP_ENABLE_TAGGING 0x00000800
64 #define FLG_USER_STACK_TRACE_DB 0x00001000
65 #define FLG_KERNEL_STACK_TRACE_DB 0x00002000
66 #define FLG_MAINTAIN_OBJECT_TYPELIST 0x00004000
67 #define FLG_HEAP_ENABLE_TAG_BY_DLL 0x00008000
68 #define FLG_IGNORE_DEBUG_PRIV 0x00010000
69 #define FLG_ENABLE_CSRDEBUG 0x00020000
70 #define FLG_ENABLE_KDEBUG_SYMBOL_LOAD 0x00040000
71 #define FLG_DISABLE_PAGE_KERNEL_STACKS 0x00080000
72 #define FLG_HEAP_ENABLE_CALL_TRACING 0x00100000
73 #define FLG_HEAP_DISABLE_COALESCING 0x00200000
74 #define FLG_ENABLE_CLOSE_EXCEPTIONS 0x00400000
75 #define FLG_ENABLE_EXCEPTION_LOGGING 0x00800000
76 #define FLG_ENABLE_HANDLE_TYPE_TAGGING 0x01000000
77 #define FLG_HEAP_PAGE_ALLOCS 0x02000000
78 #define FLG_DEBUG_INITIAL_COMMAND_EX 0x04000000
81 // Process priority classes
83 #define PROCESS_PRIORITY_CLASS_INVALID 0
84 #define PROCESS_PRIORITY_CLASS_IDLE 1
85 #define PROCESS_PRIORITY_CLASS_NORMAL 2
86 #define PROCESS_PRIORITY_CLASS_HIGH 3
87 #define PROCESS_PRIORITY_CLASS_REALTIME 4
88 #define PROCESS_PRIORITY_CLASS_BELOW_NORMAL 5
89 #define PROCESS_PRIORITY_CLASS_ABOVE_NORMAL 6
92 // Process base priorities
94 #define PROCESS_PRIORITY_IDLE 3
95 #define PROCESS_PRIORITY_NORMAL 8
96 #define PROCESS_PRIORITY_NORMAL_FOREGROUND 9
102 #define JOB_OBJECT_ASSIGN_PROCESS 0x1
103 #define JOB_OBJECT_SET_ATTRIBUTES 0x2
104 #define JOB_OBJECT_QUERY 0x4
105 #define JOB_OBJECT_TERMINATE 0x8
106 #define JOB_OBJECT_SET_SECURITY_ATTRIBUTES 0x10
107 #define JOB_OBJECT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 31)
110 #ifdef NTOS_MODE_USER
112 // Current Process/Thread built-in 'special' handles
114 #define NtCurrentProcess() ((HANDLE)(LONG_PTR)-1)
115 #define ZwCurrentProcess() NtCurrentProcess()
116 #define NtCurrentThread() ((HANDLE)(LONG_PTR)-2)
117 #define ZwCurrentThread() NtCurrentThread()
120 // Process/Thread/Job Information Classes for NtQueryInformationProcess/Thread/Job
122 typedef enum _PROCESSINFOCLASS
124 ProcessBasicInformation
,
130 ProcessRaisePriority
,
132 ProcessExceptionPort
,
134 ProcessLdtInformation
,
136 ProcessDefaultHardErrorMode
,
137 ProcessIoPortHandlers
,
138 ProcessPooledUsageAndLimits
,
139 ProcessWorkingSetWatch
,
141 ProcessEnableAlignmentFaultFixup
,
142 ProcessPriorityClass
,
143 ProcessWx86Information
,
146 ProcessPriorityBoost
,
148 ProcessSessionInformation
,
149 ProcessForegroundInformation
,
150 ProcessWow64Information
,
151 ProcessImageFileName
,
152 ProcessLUIDDeviceMapsEnabled
,
153 ProcessBreakOnTermination
,
154 ProcessDebugObjectHandle
,
156 ProcessHandleTracing
,
159 ProcessTlsInformation
,
161 ProcessImageInformation
,
164 ProcessInstrumentationCallback
,
168 typedef enum _THREADINFOCLASS
170 ThreadBasicInformation
,
175 ThreadImpersonationToken
,
176 ThreadDescriptorTableEntry
,
177 ThreadEnableAlignmentFaultFixup
,
178 ThreadEventPair_Reusable
,
179 ThreadQuerySetWin32StartAddress
,
181 ThreadPerformanceCount
,
183 ThreadIdealProcessor
,
185 ThreadSetTlsArrayAddress
,
187 ThreadHideFromDebugger
,
188 ThreadBreakOnTermination
,
189 ThreadSwitchLegacyState
,
191 ThreadLastSystemCall
,
195 ThreadActualBasePriority
,
201 typedef enum _JOBOBJECTINFOCLASS
203 JobObjectBasicAccountingInformation
= 1,
204 JobObjectBasicLimitInformation
,
205 JobObjectBasicProcessIdList
,
206 JobObjectBasicUIRestrictions
,
207 JobObjectSecurityLimitInformation
,
208 JobObjectEndOfJobTimeInformation
,
209 JobObjectAssociateCompletionPortInformation
,
210 JobObjectBasicAndIoAccountingInformation
,
211 JobObjectExtendedLimitInformation
,
212 JobObjectJobSetInformation
,
213 MaxJobObjectInfoClass
214 } JOBOBJECTINFOCLASS
;
217 // Declare empty structure definitions so that they may be referenced by
218 // routines before they are defined
225 // Win32K Process and Thread Callbacks
228 (NTAPI
*PW32_PROCESS_CALLBACK
)(
229 struct _EPROCESS
*Process
,
234 (NTAPI
*PW32_THREAD_CALLBACK
)(
235 struct _ETHREAD
*Thread
,
241 #ifdef NTOS_MODE_USER
244 // ClientID Structure
246 typedef struct _CLIENT_ID
248 HANDLE UniqueProcess
;
250 } CLIENT_ID
, *PCLIENT_ID
;
255 // Descriptor Table Entry Definition
257 typedef struct _DESCRIPTOR_TABLE_ENTRY
260 LDT_ENTRY Descriptor
;
261 } DESCRIPTOR_TABLE_ENTRY
, *PDESCRIPTOR_TABLE_ENTRY
;
267 (NTAPI
*PPEBLOCKROUTINE
)(
272 // PEB Free Block Descriptor
274 typedef struct _PEB_FREE_BLOCK
276 struct _PEB_FREE_BLOCK
* Next
;
278 } PEB_FREE_BLOCK
, *PPEB_FREE_BLOCK
;
281 // Process Environment Block (PEB)
285 UCHAR InheritedAddressSpace
; /* 00h */
286 UCHAR ReadImageFileExecOptions
; /* 01h */
287 UCHAR BeingDebugged
; /* 02h */
288 BOOLEAN SpareBool
; /* 03h */
289 HANDLE Mutant
; /* 04h */
290 PVOID ImageBaseAddress
; /* 08h */
291 PPEB_LDR_DATA Ldr
; /* 0Ch */
292 struct _RTL_USER_PROCESS_PARAMETERS
*ProcessParameters
; /* 10h */
293 PVOID SubSystemData
; /* 14h */
294 PVOID ProcessHeap
; /* 18h */
295 PVOID FastPebLock
; /* 1Ch */
296 PPEBLOCKROUTINE FastPebLockRoutine
; /* 20h */
297 PPEBLOCKROUTINE FastPebUnlockRoutine
; /* 24h */
298 ULONG EnvironmentUpdateCount
; /* 28h */
299 PVOID
* KernelCallbackTable
; /* 2Ch */
300 PVOID EventLogSection
; /* 30h */
301 PVOID EventLog
; /* 34h */
302 PPEB_FREE_BLOCK FreeList
; /* 38h */
303 ULONG TlsExpansionCounter
; /* 3Ch */
304 PVOID TlsBitmap
; /* 40h */
305 ULONG TlsBitmapBits
[0x2]; /* 44h */
306 PVOID ReadOnlySharedMemoryBase
; /* 4Ch */
307 PVOID ReadOnlySharedMemoryHeap
; /* 50h */
308 PVOID
* ReadOnlyStaticServerData
; /* 54h */
309 PVOID AnsiCodePageData
; /* 58h */
310 PVOID OemCodePageData
; /* 5Ch */
311 PVOID UnicodeCaseTableData
; /* 60h */
312 ULONG NumberOfProcessors
; /* 64h */
313 ULONG NtGlobalFlag
; /* 68h */
314 LARGE_INTEGER CriticalSectionTimeout
; /* 70h */
315 ULONG HeapSegmentReserve
; /* 78h */
316 ULONG HeapSegmentCommit
; /* 7Ch */
317 ULONG HeapDeCommitTotalFreeThreshold
; /* 80h */
318 ULONG HeapDeCommitFreeBlockThreshold
; /* 84h */
319 ULONG NumberOfHeaps
; /* 88h */
320 ULONG MaximumNumberOfHeaps
; /* 8Ch */
321 PVOID
* ProcessHeaps
; /* 90h */
322 PVOID GdiSharedHandleTable
; /* 94h */
323 PVOID ProcessStarterHelper
; /* 98h */
324 PVOID GdiDCAttributeList
; /* 9Ch */
325 PVOID LoaderLock
; /* A0h */
326 ULONG OSMajorVersion
; /* A4h */
327 ULONG OSMinorVersion
; /* A8h */
328 USHORT OSBuildNumber
; /* ACh */
329 USHORT OSCSDVersion
; /* AEh */
330 ULONG OSPlatformId
; /* B0h */
331 ULONG ImageSubSystem
; /* B4h */
332 ULONG ImageSubSystemMajorVersion
; /* B8h */
333 ULONG ImageSubSystemMinorVersion
; /* BCh */
334 ULONG ImageProcessAffinityMask
; /* C0h */
335 ULONG GdiHandleBuffer
[0x22]; /* C4h */
336 PVOID PostProcessInitRoutine
; /* 14Ch */
337 struct _RTL_BITMAP
*TlsExpansionBitmap
; /* 150h */
338 ULONG TlsExpansionBitmapBits
[0x20]; /* 154h */
339 ULONG SessionId
; /* 1D4h */
340 PVOID AppCompatInfo
; /* 1D8h */
341 UNICODE_STRING CSDVersion
; /* 1DCh */
345 // GDI Batch Descriptor
347 typedef struct _GDI_TEB_BATCH
352 } GDI_TEB_BATCH
, *PGDI_TEB_BATCH
;
357 typedef struct _INITIAL_TEB
359 PVOID PreviousStackBase
;
360 PVOID PreviousStackLimit
;
363 PVOID AllocatedStackBase
;
364 } INITIAL_TEB
, *PINITIAL_TEB
;
367 // TEB Active Frame Structures
369 typedef struct _TEB_ACTIVE_FRAME_CONTEXT
373 } TEB_ACTIVE_FRAME_CONTEXT
, *PTEB_ACTIVE_FRAME_CONTEXT
;
375 typedef struct _TEB_ACTIVE_FRAME
378 struct _TEB_ACTIVE_FRAME
*Previous
;
379 PTEB_ACTIVE_FRAME_CONTEXT Context
;
380 } TEB_ACTIVE_FRAME
, *PTEB_ACTIVE_FRAME
;
383 // Thread Environment Block (TEB)
387 NT_TIB Tib
; /* 00h */
388 PVOID EnvironmentPointer
; /* 1Ch */
389 CLIENT_ID Cid
; /* 20h */
390 PVOID ActiveRpcHandle
; /* 28h */
391 PVOID ThreadLocalStoragePointer
; /* 2Ch */
392 struct _PEB
*ProcessEnvironmentBlock
; /* 30h */
393 ULONG LastErrorValue
; /* 34h */
394 ULONG CountOfOwnedCriticalSections
; /* 38h */
395 PVOID CsrClientThread
; /* 3Ch */
396 struct _W32THREAD
* Win32ThreadInfo
; /* 40h */
397 ULONG User32Reserved
[0x1A]; /* 44h */
398 ULONG UserReserved
[5]; /* ACh */
399 PVOID WOW32Reserved
; /* C0h */
400 LCID CurrentLocale
; /* C4h */
401 ULONG FpSoftwareStatusRegister
; /* C8h */
402 PVOID SystemReserved1
[0x36]; /* CCh */
403 LONG ExceptionCode
; /* 1A4h */
404 struct _ACTIVATION_CONTEXT_STACK
*ActivationContextStackPointer
; /* 1A8h */
405 UCHAR SpareBytes1
[0x28]; /* 1ACh */
406 GDI_TEB_BATCH GdiTebBatch
; /* 1D4h */
407 CLIENT_ID RealClientId
; /* 6B4h */
408 PVOID GdiCachedProcessHandle
; /* 6BCh */
409 ULONG GdiClientPID
; /* 6C0h */
410 ULONG GdiClientTID
; /* 6C4h */
411 PVOID GdiThreadLocalInfo
; /* 6C8h */
412 ULONG Win32ClientInfo
[62]; /* 6CCh */
413 PVOID glDispatchTable
[0xE9]; /* 7C4h */
414 ULONG glReserved1
[0x1D]; /* B68h */
415 PVOID glReserved2
; /* BDCh */
416 PVOID glSectionInfo
; /* BE0h */
417 PVOID glSection
; /* BE4h */
418 PVOID glTable
; /* BE8h */
419 PVOID glCurrentRC
; /* BECh */
420 PVOID glContext
; /* BF0h */
421 NTSTATUS LastStatusValue
; /* BF4h */
422 UNICODE_STRING StaticUnicodeString
; /* BF8h */
423 WCHAR StaticUnicodeBuffer
[0x105]; /* C00h */
424 PVOID DeallocationStack
; /* E0Ch */
425 PVOID TlsSlots
[0x40]; /* E10h */
426 LIST_ENTRY TlsLinks
; /* F10h */
427 PVOID Vdm
; /* F18h */
428 PVOID ReservedForNtRpc
; /* F1Ch */
429 PVOID DbgSsReserved
[0x2]; /* F20h */
430 ULONG HardErrorDisabled
; /* F28h */
431 PVOID Instrumentation
[14]; /* F2Ch */
432 PVOID SubProcessTag
; /* F64h */
433 PVOID EtwTraceData
; /* F68h */
434 PVOID WinSockData
; /* F6Ch */
435 ULONG GdiBatchCount
; /* F70h */
436 BOOLEAN InDbgPrint
; /* F74h */
437 BOOLEAN FreeStackOnTermination
; /* F75h */
438 BOOLEAN HasFiberData
; /* F76h */
439 UCHAR IdealProcessor
; /* F77h */
440 ULONG GuaranteedStackBytes
; /* F78h */
441 PVOID ReservedForPerf
; /* F7Ch */
442 PVOID ReservedForOle
; /* F80h */
443 ULONG WaitingOnLoaderLock
; /* F84h */
444 ULONG SparePointer1
; /* F88h */
445 ULONG SoftPatchPtr1
; /* F8Ch */
446 ULONG SoftPatchPtr2
; /* F90h */
447 PVOID
*TlsExpansionSlots
; /* F94h */
448 ULONG ImpersionationLocale
; /* F98h */
449 ULONG IsImpersonating
; /* F9Ch */
450 PVOID NlsCache
; /* FA0h */
451 PVOID pShimData
; /* FA4h */
452 ULONG HeapVirualAffinity
; /* FA8h */
453 PVOID CurrentTransactionHandle
; /* FACh */
454 PTEB_ACTIVE_FRAME ActiveFrame
; /* FB0h */
455 PVOID FlsData
; /* FB4h */
456 UCHAR SafeThunkCall
; /* FB8h */
457 UCHAR BooleanSpare
[3]; /* FB9h */
460 #ifdef NTOS_MODE_USER
463 // Process Information Structures for NtQueryProcessInformation
465 typedef struct _PROCESS_BASIC_INFORMATION
469 ULONG_PTR AffinityMask
;
470 KPRIORITY BasePriority
;
471 ULONG_PTR UniqueProcessId
;
472 ULONG_PTR InheritedFromUniqueProcessId
;
473 } PROCESS_BASIC_INFORMATION
,*PPROCESS_BASIC_INFORMATION
;
475 typedef struct _PROCESS_ACCESS_TOKEN
479 } PROCESS_ACCESS_TOKEN
, *PPROCESS_ACCESS_TOKEN
;
481 typedef struct _PROCESS_DEVICEMAP_INFORMATION
487 HANDLE DirectoryHandle
;
495 } PROCESS_DEVICEMAP_INFORMATION
, *PPROCESS_DEVICEMAP_INFORMATION
;
497 typedef struct _KERNEL_USER_TIMES
499 LARGE_INTEGER CreateTime
;
500 LARGE_INTEGER ExitTime
;
501 LARGE_INTEGER KernelTime
;
502 LARGE_INTEGER UserTime
;
503 } KERNEL_USER_TIMES
, *PKERNEL_USER_TIMES
;
505 typedef struct _PROCESS_SESSION_INFORMATION
508 } PROCESS_SESSION_INFORMATION
, *PPROCESS_SESSION_INFORMATION
;
512 typedef struct _PROCESS_PRIORITY_CLASS
516 } PROCESS_PRIORITY_CLASS
, *PPROCESS_PRIORITY_CLASS
;
519 // Thread Information Structures for NtQueryProcessInformation
521 typedef struct _THREAD_BASIC_INFORMATION
524 PVOID TebBaseAddress
;
526 KAFFINITY AffinityMask
;
528 KPRIORITY BasePriority
;
529 } THREAD_BASIC_INFORMATION
, *PTHREAD_BASIC_INFORMATION
;
531 #ifndef NTOS_MODE_USER
534 // EPROCESS Quota Structures
536 typedef struct _EPROCESS_QUOTA_ENTRY
542 } EPROCESS_QUOTA_ENTRY
, *PEPROCESS_QUOTA_ENTRY
;
544 typedef struct _EPROCESS_QUOTA_BLOCK
546 EPROCESS_QUOTA_ENTRY QuotaEntry
[3];
547 LIST_ENTRY QuotaList
;
548 ULONG ReferenceCount
;
550 } EPROCESS_QUOTA_BLOCK
, *PEPROCESS_QUOTA_BLOCK
;
553 // FIXME: This really belongs in mmtypes.h
555 typedef struct _PAGEFAULT_HISTORY
561 PROCESS_WS_WATCH_INFORMATION WatchInfo
[1];
562 } PAGEFAULT_HISTORY
, *PPAGEFAULT_HISTORY
;
565 // Process Impersonation Information
567 typedef struct _PS_IMPERSONATION_INFORMATION
571 BOOLEAN EffectiveOnly
;
572 SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
;
573 } PS_IMPERSONATION_INFORMATION
, *PPS_IMPERSONATION_INFORMATION
;
576 // Process Termination Port
578 typedef struct _TERMINATION_PORT
580 struct _TERMINATION_PORT
*Next
;
582 } TERMINATION_PORT
, *PTERMINATION_PORT
;
585 // Executive Thread (ETHREAD)
587 #include <pshpack4.h>
588 typedef struct _ETHREAD
590 KTHREAD Tcb
; /* 1C0 */
591 LARGE_INTEGER CreateTime
; /* 1C0 */
592 LARGE_INTEGER ExitTime
; /* 1C0 */
595 LIST_ENTRY LpcReplyChain
; /* 1C0 */
596 LIST_ENTRY KeyedWaitChain
; /* 1C0 */
600 NTSTATUS ExitStatus
; /* 1C8 */
601 PVOID OfsChain
; /* 1C8 */
603 LIST_ENTRY PostBlockList
; /* 1CC */
606 struct _TERMINATION_PORT
*TerminationPort
; /* 1D4 */
607 struct _ETHREAD
*ReaperLink
; /* 1D4 */
608 PVOID KeyedWaitValue
; /* 1D4 */
610 KSPIN_LOCK ActiveTimerListLock
; /* 1D8 */
611 LIST_ENTRY ActiveTimerListHead
; /* 1D8 */
612 CLIENT_ID Cid
; /* 1E0 */
615 KSEMAPHORE LpcReplySemaphore
; /* 1E4 */
616 KSEMAPHORE KeyedReplySemaphore
; /* 1E4 */
620 PVOID LpcReplyMessage
; /* 200 */
621 PVOID LpcWaitingOnPort
; /* 200 */
623 PPS_IMPERSONATION_INFORMATION ImpersonationInfo
; /* 204 */
624 LIST_ENTRY IrpList
; /* 208 */
625 ULONG TopLevelIrp
; /* 210 */
626 PDEVICE_OBJECT DeviceToVerify
; /* 214 */
627 struct _EPROCESS
*ThreadsProcess
; /* 218 */
628 PKSTART_ROUTINE StartAddress
; /* 21C */
631 PVOID Win32StartAddress
; /* 220 */
632 ULONG LpcReceivedMessageId
; /* 220 */
634 LIST_ENTRY ThreadListEntry
; /* 224 */
635 EX_RUNDOWN_REF RundownProtect
; /* 22C */
636 EX_PUSH_LOCK ThreadLock
; /* 230 */
637 ULONG LpcReplyMessageId
; /* 234 */
638 ULONG ReadClusterSize
; /* 238 */
639 ACCESS_MASK GrantedAccess
; /* 23C */
646 ULONG HideFromDebugger
:1;
647 ULONG ActiveImpersonationInfo
:1;
648 ULONG SystemThread
:1;
649 ULONG HardErrorsAreDisabled
:1;
650 ULONG BreakOnTermination
:1;
651 ULONG SkipCreationMsg
:1;
652 ULONG SkipTerminationMsg
:1;
654 ULONG CrossThreadFlags
; /* 240 */
660 ULONG ActiveExWorker
:1;
661 ULONG ExWorkerCanWaitUser
:1;
663 ULONG KeyedEventInUse
:1;
665 ULONG SameThreadPassiveFlags
; /* 244 */
671 ULONG LpcReceivedMsgIdValid
:1;
672 ULONG LpcExitThreadCalled
:1;
673 ULONG AddressSpaceOwner
:1;
674 ULONG OwnsProcessWorkingSetExclusive
:1;
675 ULONG OwnsProcessWorkingSetShared
:1;
676 ULONG OwnsSystemWorkingSetExclusive
:1;
677 ULONG OwnsSystemWorkingSetShared
:1;
678 ULONG OwnsSessionWorkingSetExclusive
:1;
679 ULONG OwnsSessionWorkingSetShared
:1;
682 ULONG SameThreadApcFlags
; /* 248 */
684 UCHAR ForwardClusterOnly
; /* 24C */
685 UCHAR DisablePageFaultClustering
; /* 24D */
686 UCHAR ActiveFaultCount
; /* 24E */
689 #if defined(_NTOSKRNL_)
690 #include <internal/mm.h>
694 // Executive Process (EPROCESS)
696 typedef struct _EPROCESS
698 KPROCESS Pcb
; /* 000 */
699 EX_PUSH_LOCK ProcessLock
; /* 078 */
700 LARGE_INTEGER CreateTime
; /* 080 */
701 LARGE_INTEGER ExitTime
; /* 088 */
702 EX_RUNDOWN_REF RundownProtect
; /* 090 */
703 HANDLE UniqueProcessId
; /* 094 */
704 LIST_ENTRY ActiveProcessLinks
; /* 098 */
705 ULONG QuotaUsage
[3]; /* 0A0 */
706 ULONG QuotaPeak
[3]; /* 0AC */
707 ULONG CommitCharge
; /* 0B8 */
708 ULONG PeakVirtualSize
; /* 0BC */
709 ULONG VirtualSize
; /* 0C0 */
710 LIST_ENTRY SessionProcessLinks
; /* 0C4 */
711 PVOID DebugPort
; /* 0CC */
712 PVOID ExceptionPort
; /* 0D0 */
713 PHANDLE_TABLE ObjectTable
; /* 0D4 */
714 EX_FAST_REF Token
; /* 0D8 */
715 ULONG WorkingSetPage
; /* 0DC */
716 KGUARDED_MUTEX AddressCreationLock
; /* 0E0 */
717 KSPIN_LOCK HyperSpaceLock
; /* 100 */
718 PETHREAD ForkInProgress
; /* 104 */
719 ULONG HardwareTrigger
; /* 108 */
720 MM_AVL_TABLE PhysicalVadroot
; /* 10C */
721 PVOID CloneRoot
; /* 110 */
722 ULONG NumberOfPrivatePages
; /* 114 */
723 ULONG NumberOfLockedPages
; /* 118 */
724 PVOID
*Win32Process
; /* 11C */
725 struct _EJOB
*Job
; /* 120 */
726 PVOID SectionObject
; /* 124 */
727 PVOID SectionBaseAddress
; /* 128 */
728 PEPROCESS_QUOTA_BLOCK QuotaBlock
; /* 12C */
729 PPAGEFAULT_HISTORY WorkingSetWatch
; /* 130 */
730 PVOID Win32WindowStation
; /* 134 */
731 HANDLE InheritedFromUniqueProcessId
; /* 138 */
732 PVOID LdtInformation
; /* 13C */
733 PVOID VadFreeHint
; /* 140 */
734 PVOID VdmObjects
; /* 144 */
735 PVOID DeviceMap
; /* 148 */
736 PVOID Spare0
[3]; /* 14C */
739 HARDWARE_PTE_X86 PagedirectoryPte
; /* 158 */
740 ULONGLONG Filler
; /* 158 */
742 ULONG Session
; /* 160 */
743 CHAR ImageFileName
[16]; /* 164 */
744 LIST_ENTRY JobLinks
; /* 174 */
745 PVOID LockedPagesList
; /* 17C */
746 LIST_ENTRY ThreadListHead
; /* 184 */
747 PVOID SecurityPort
; /* 188 */
748 PVOID PaeTop
; /* 18C */
749 ULONG ActiveThreds
; /* 190 */
750 ACCESS_MASK GrantedAccess
; /* 194 */
751 ULONG DefaultHardErrorProcessing
; /* 198 */
752 NTSTATUS LastThreadExitStatus
; /* 19C */
753 struct _PEB
* Peb
; /* 1A0 */
754 EX_FAST_REF PrefetchTrace
; /* 1A4 */
755 LARGE_INTEGER ReadOperationCount
; /* 1A8 */
756 LARGE_INTEGER WriteOperationCount
; /* 1B0 */
757 LARGE_INTEGER OtherOperationCount
; /* 1B8 */
758 LARGE_INTEGER ReadTransferCount
; /* 1C0 */
759 LARGE_INTEGER WriteTransferCount
; /* 1C8 */
760 LARGE_INTEGER OtherTransferCount
; /* 1D0 */
761 ULONG CommitChargeLimit
; /* 1D8 */
762 ULONG CommitChargePeak
; /* 1DC */
763 PVOID AweInfo
; /* 1E0 */
764 SE_AUDIT_PROCESS_CREATION_INFO SeAuditProcessCreationInfo
; /* 1E4 */
765 MMSUPPORT Vm
; /* 1E8 */
766 LIST_ENTRY MmProcessLinks
; /* 230 */
767 ULONG ModifiedPageCount
; /* 238 */
768 ULONG JobStatus
; /* 23C */
773 ULONG CreateReported
:1;
774 ULONG NoDebugInherit
:1;
775 ULONG ProcessExiting
:1;
776 ULONG ProcessDelete
:1;
777 ULONG Wow64SplitPages
:1;
779 ULONG OutswapEnabled
:1;
782 ULONG Wow64VaSpace4Gb
:1;
783 ULONG AddressSpaceInitialized
:2;
784 ULONG SetTimerResolution
:1;
785 ULONG BreakOnTermination
:1;
786 ULONG SessionCreationUnderway
:1;
788 ULONG ProcessInSession
:1;
789 ULONG OverrideAddressSpace
:1;
790 ULONG HasAddressSpace
:1;
791 ULONG LaunchPrefetched
:1;
792 ULONG InjectInpageErrors
:1;
794 ULONG ImageNotifyDone
:1;
795 ULONG PdeUpdateNeeded
:1;
798 ULONG CreateFailed
:1;
799 ULONG DefaultIoPriority
:3;
803 ULONG Flags
; /* 240 */
806 NTSTATUS ExitStatus
; /* 244 */
807 USHORT NextPageColor
; /* 248 */
812 UCHAR SubSystemMinorVersion
; /* 24A */
813 UCHAR SubSystemMajorVersion
; /* 24B */
815 USHORT SubSystemVersion
; /* 24A */
817 UCHAR PriorityClass
; /* 24C */
818 MM_AVL_TABLE VadRoot
; /* 250 */
819 ULONG Cookie
; /* 270 */
822 /* FIXME: WILL BE DEPRECATED WITH PUSHLOCK SUPPORT IN 0.3.0*/
823 KEVENT LockEvent
; /* 274 */
824 ULONG LockCount
; /* 284 */
825 struct _KTHREAD
*LockOwner
; /* 288 */
827 /* FIXME: MOVE TO AVL TREES */
828 MADDRESS_SPACE AddressSpace
; /* 28C */
834 // Job Token Filter Data
836 #include <pshpack1.h>
837 typedef struct _PS_JOB_TOKEN_FILTER
839 ULONG CapturedSidCount
;
840 PSID_AND_ATTRIBUTES CapturedSids
;
841 ULONG CapturedSidsLength
;
842 ULONG CapturedGroupCount
;
843 PSID_AND_ATTRIBUTES CapturedGroups
;
844 ULONG CapturedGroupsLength
;
845 ULONG CapturedPrivilegeCount
;
846 PLUID_AND_ATTRIBUTES CapturedPrivileges
;
847 ULONG CapturedPrivilegesLength
;
848 } PS_JOB_TOKEN_FILTER
, *PPS_JOB_TOKEN_FILTER
;
851 // Executive Job (EJOB)
857 LIST_ENTRY ProcessListHead
;
859 LARGE_INTEGER TotalUserTime
;
860 LARGE_INTEGER TotalKernelTime
;
861 LARGE_INTEGER ThisPeriodTotalUserTime
;
862 LARGE_INTEGER ThisPeriodTotalKernelTime
;
863 ULONG TotalPageFaultCount
;
864 ULONG TotalProcesses
;
865 ULONG ActiveProcesses
;
866 ULONG TotalTerminatedProcesses
;
867 LARGE_INTEGER PerProcessUserTimeLimit
;
868 LARGE_INTEGER PerJobUserTimeLimit
;
870 ULONG MinimumWorkingSetSize
;
871 ULONG MaximumWorkingSetSize
;
872 ULONG ActiveProcessLimit
;
875 ULONG UIRestrictionsClass
;
876 ULONG SecurityLimitFlags
;
878 PPS_JOB_TOKEN_FILTER Filter
;
879 ULONG EndOfJobTimeAction
;
880 PVOID CompletionPort
;
883 ULONG SchedulingClass
;
884 ULONGLONG ReadOperationCount
;
885 ULONGLONG WriteOperationCount
;
886 ULONGLONG OtherOperationCount
;
887 ULONGLONG ReadTransferCount
;
888 ULONGLONG WriteTransferCount
;
889 ULONGLONG OtherTransferCount
;
891 ULONG ProcessMemoryLimit
;
892 ULONG JobMemoryLimit
;
893 ULONG PeakProcessMemoryUsed
;
894 ULONG PeakJobMemoryUsed
;
895 ULONG CurrentJobMemoryUsed
;
896 KGUARDED_MUTEX MemoryLimitsLock
;
903 // Win32K Callback Registration Data
905 typedef struct _W32_CALLOUT_DATA
907 PW32_PROCESS_CALLBACK W32ProcessCallout
;
908 PW32_THREAD_CALLBACK W32ThreadCallout
;
909 PVOID UserGlobalAtomTableCallout
;
910 PVOID UserPowerEventCallout
;
911 PVOID UserPowerStateCallout
;
912 PVOID UserJobCallout
;
913 PVOID NtGdiUserFlushUserBatch
;
914 OB_OPEN_METHOD DesktopOpen
;
916 OB_DELETE_METHOD DesktopDelete
;
917 OB_OKAYTOCLOSE_METHOD WinstaOkayToClose
;
918 OB_DELETE_METHOD WinStaDelete
;
919 OB_PARSE_METHOD WinStaParse
;
920 OB_OPEN_METHOD WinStaOpen
;
922 /* FIXME: REACTOS ONLY */
923 OB_FIND_METHOD WinStaFind
;
924 OB_OPEN_METHOD WinStaCreate
;
925 OB_CREATE_METHOD DesktopCreate
;
927 } W32_CALLOUT_DATA
, *PW32_CALLOUT_DATA
;
929 #endif // !NTOS_MODE_USER