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 // NtCreateProcessEx flags
94 #define PS_REQUEST_BREAKAWAY 1
95 #define PS_NO_DEBUG_INHERIT 2
96 #define PS_INHERIT_HANDLES 4
97 #define PS_UNKNOWN_VALUE 8
98 #define PS_ALL_FLAGS (PS_REQUEST_BREAKAWAY | \
99 PS_NO_DEBUG_INHERIT | \
100 PS_INHERIT_HANDLES | \
104 // Process base priorities
106 #define PROCESS_PRIORITY_IDLE 3
107 #define PROCESS_PRIORITY_NORMAL 8
108 #define PROCESS_PRIORITY_NORMAL_FOREGROUND 9
114 #define JOB_OBJECT_ASSIGN_PROCESS 0x1
115 #define JOB_OBJECT_SET_ATTRIBUTES 0x2
116 #define JOB_OBJECT_QUERY 0x4
117 #define JOB_OBJECT_TERMINATE 0x8
118 #define JOB_OBJECT_SET_SECURITY_ATTRIBUTES 0x10
119 #define JOB_OBJECT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 31)
122 #ifdef NTOS_MODE_USER
124 // Current Process/Thread built-in 'special' handles
126 #define NtCurrentProcess() ((HANDLE)(LONG_PTR)-1)
127 #define ZwCurrentProcess() NtCurrentProcess()
128 #define NtCurrentThread() ((HANDLE)(LONG_PTR)-2)
129 #define ZwCurrentThread() NtCurrentThread()
132 // Process/Thread/Job Information Classes for NtQueryInformationProcess/Thread/Job
134 typedef enum _PROCESSINFOCLASS
136 ProcessBasicInformation
,
142 ProcessRaisePriority
,
144 ProcessExceptionPort
,
146 ProcessLdtInformation
,
148 ProcessDefaultHardErrorMode
,
149 ProcessIoPortHandlers
,
150 ProcessPooledUsageAndLimits
,
151 ProcessWorkingSetWatch
,
153 ProcessEnableAlignmentFaultFixup
,
154 ProcessPriorityClass
,
155 ProcessWx86Information
,
158 ProcessPriorityBoost
,
160 ProcessSessionInformation
,
161 ProcessForegroundInformation
,
162 ProcessWow64Information
,
163 ProcessImageFileName
,
164 ProcessLUIDDeviceMapsEnabled
,
165 ProcessBreakOnTermination
,
166 ProcessDebugObjectHandle
,
168 ProcessHandleTracing
,
171 ProcessTlsInformation
,
173 ProcessImageInformation
,
176 ProcessInstrumentationCallback
,
180 typedef enum _THREADINFOCLASS
182 ThreadBasicInformation
,
187 ThreadImpersonationToken
,
188 ThreadDescriptorTableEntry
,
189 ThreadEnableAlignmentFaultFixup
,
190 ThreadEventPair_Reusable
,
191 ThreadQuerySetWin32StartAddress
,
193 ThreadPerformanceCount
,
195 ThreadIdealProcessor
,
197 ThreadSetTlsArrayAddress
,
199 ThreadHideFromDebugger
,
200 ThreadBreakOnTermination
,
201 ThreadSwitchLegacyState
,
203 ThreadLastSystemCall
,
207 ThreadActualBasePriority
,
213 typedef enum _JOBOBJECTINFOCLASS
215 JobObjectBasicAccountingInformation
= 1,
216 JobObjectBasicLimitInformation
,
217 JobObjectBasicProcessIdList
,
218 JobObjectBasicUIRestrictions
,
219 JobObjectSecurityLimitInformation
,
220 JobObjectEndOfJobTimeInformation
,
221 JobObjectAssociateCompletionPortInformation
,
222 JobObjectBasicAndIoAccountingInformation
,
223 JobObjectExtendedLimitInformation
,
224 JobObjectJobSetInformation
,
225 MaxJobObjectInfoClass
226 } JOBOBJECTINFOCLASS
;
229 // Declare empty structure definitions so that they may be referenced by
230 // routines before they are defined
237 // Win32K Process and Thread Callbacks
240 (NTAPI
*PW32_PROCESS_CALLBACK
)(
241 struct _EPROCESS
*Process
,
246 (NTAPI
*PW32_THREAD_CALLBACK
)(
247 struct _ETHREAD
*Thread
,
253 #ifdef NTOS_MODE_USER
256 // ClientID Structure
258 typedef struct _CLIENT_ID
260 HANDLE UniqueProcess
;
262 } CLIENT_ID
, *PCLIENT_ID
;
267 // Descriptor Table Entry Definition
269 #define _DESCRIPTOR_TABLE_ENTRY_DEFINED
270 typedef struct _DESCRIPTOR_TABLE_ENTRY
273 LDT_ENTRY Descriptor
;
274 } DESCRIPTOR_TABLE_ENTRY
, *PDESCRIPTOR_TABLE_ENTRY
;
280 (NTAPI
*PPEBLOCKROUTINE
)(
285 // PEB Free Block Descriptor
287 typedef struct _PEB_FREE_BLOCK
289 struct _PEB_FREE_BLOCK
* Next
;
291 } PEB_FREE_BLOCK
, *PPEB_FREE_BLOCK
;
294 // Process Environment Block (PEB)
298 UCHAR InheritedAddressSpace
; /* 00h */
299 UCHAR ReadImageFileExecOptions
; /* 01h */
300 UCHAR BeingDebugged
; /* 02h */
301 BOOLEAN SpareBool
; /* 03h */
302 HANDLE Mutant
; /* 04h */
303 PVOID ImageBaseAddress
; /* 08h */
304 PPEB_LDR_DATA Ldr
; /* 0Ch */
305 struct _RTL_USER_PROCESS_PARAMETERS
*ProcessParameters
; /* 10h */
306 PVOID SubSystemData
; /* 14h */
307 PVOID ProcessHeap
; /* 18h */
308 PVOID FastPebLock
; /* 1Ch */
309 PPEBLOCKROUTINE FastPebLockRoutine
; /* 20h */
310 PPEBLOCKROUTINE FastPebUnlockRoutine
; /* 24h */
311 ULONG EnvironmentUpdateCount
; /* 28h */
312 PVOID
* KernelCallbackTable
; /* 2Ch */
313 PVOID EventLogSection
; /* 30h */
314 PVOID EventLog
; /* 34h */
315 PPEB_FREE_BLOCK FreeList
; /* 38h */
316 ULONG TlsExpansionCounter
; /* 3Ch */
317 PVOID TlsBitmap
; /* 40h */
318 ULONG TlsBitmapBits
[0x2]; /* 44h */
319 PVOID ReadOnlySharedMemoryBase
; /* 4Ch */
320 PVOID ReadOnlySharedMemoryHeap
; /* 50h */
321 PVOID
* ReadOnlyStaticServerData
; /* 54h */
322 PVOID AnsiCodePageData
; /* 58h */
323 PVOID OemCodePageData
; /* 5Ch */
324 PVOID UnicodeCaseTableData
; /* 60h */
325 ULONG NumberOfProcessors
; /* 64h */
326 ULONG NtGlobalFlag
; /* 68h */
327 LARGE_INTEGER CriticalSectionTimeout
; /* 70h */
328 ULONG HeapSegmentReserve
; /* 78h */
329 ULONG HeapSegmentCommit
; /* 7Ch */
330 ULONG HeapDeCommitTotalFreeThreshold
; /* 80h */
331 ULONG HeapDeCommitFreeBlockThreshold
; /* 84h */
332 ULONG NumberOfHeaps
; /* 88h */
333 ULONG MaximumNumberOfHeaps
; /* 8Ch */
334 PVOID
* ProcessHeaps
; /* 90h */
335 PVOID GdiSharedHandleTable
; /* 94h */
336 PVOID ProcessStarterHelper
; /* 98h */
337 PVOID GdiDCAttributeList
; /* 9Ch */
338 PVOID LoaderLock
; /* A0h */
339 ULONG OSMajorVersion
; /* A4h */
340 ULONG OSMinorVersion
; /* A8h */
341 USHORT OSBuildNumber
; /* ACh */
342 USHORT OSCSDVersion
; /* AEh */
343 ULONG OSPlatformId
; /* B0h */
344 ULONG ImageSubSystem
; /* B4h */
345 ULONG ImageSubSystemMajorVersion
; /* B8h */
346 ULONG ImageSubSystemMinorVersion
; /* BCh */
347 ULONG ImageProcessAffinityMask
; /* C0h */
348 ULONG GdiHandleBuffer
[0x22]; /* C4h */
349 PVOID PostProcessInitRoutine
; /* 14Ch */
350 struct _RTL_BITMAP
*TlsExpansionBitmap
; /* 150h */
351 ULONG TlsExpansionBitmapBits
[0x20]; /* 154h */
352 ULONG SessionId
; /* 1D4h */
353 PVOID AppCompatInfo
; /* 1D8h */
354 UNICODE_STRING CSDVersion
; /* 1DCh */
358 // GDI Batch Descriptor
360 typedef struct _GDI_TEB_BATCH
365 } GDI_TEB_BATCH
, *PGDI_TEB_BATCH
;
370 typedef struct _INITIAL_TEB
372 PVOID PreviousStackBase
;
373 PVOID PreviousStackLimit
;
376 PVOID AllocatedStackBase
;
377 } INITIAL_TEB
, *PINITIAL_TEB
;
380 // TEB Active Frame Structures
382 typedef struct _TEB_ACTIVE_FRAME_CONTEXT
386 } TEB_ACTIVE_FRAME_CONTEXT
, *PTEB_ACTIVE_FRAME_CONTEXT
;
388 typedef struct _TEB_ACTIVE_FRAME
391 struct _TEB_ACTIVE_FRAME
*Previous
;
392 PTEB_ACTIVE_FRAME_CONTEXT Context
;
393 } TEB_ACTIVE_FRAME
, *PTEB_ACTIVE_FRAME
;
396 // Thread Environment Block (TEB)
400 NT_TIB Tib
; /* 00h */
401 PVOID EnvironmentPointer
; /* 1Ch */
402 CLIENT_ID Cid
; /* 20h */
403 PVOID ActiveRpcHandle
; /* 28h */
404 PVOID ThreadLocalStoragePointer
; /* 2Ch */
405 struct _PEB
*ProcessEnvironmentBlock
; /* 30h */
406 ULONG LastErrorValue
; /* 34h */
407 ULONG CountOfOwnedCriticalSections
; /* 38h */
408 PVOID CsrClientThread
; /* 3Ch */
409 struct _W32THREAD
* Win32ThreadInfo
; /* 40h */
410 ULONG User32Reserved
[0x1A]; /* 44h */
411 ULONG UserReserved
[5]; /* ACh */
412 PVOID WOW32Reserved
; /* C0h */
413 LCID CurrentLocale
; /* C4h */
414 ULONG FpSoftwareStatusRegister
; /* C8h */
415 PVOID SystemReserved1
[0x36]; /* CCh */
416 LONG ExceptionCode
; /* 1A4h */
417 struct _ACTIVATION_CONTEXT_STACK
*ActivationContextStackPointer
; /* 1A8h */
418 UCHAR SpareBytes1
[0x28]; /* 1ACh */
419 GDI_TEB_BATCH GdiTebBatch
; /* 1D4h */
420 CLIENT_ID RealClientId
; /* 6B4h */
421 PVOID GdiCachedProcessHandle
; /* 6BCh */
422 ULONG GdiClientPID
; /* 6C0h */
423 ULONG GdiClientTID
; /* 6C4h */
424 PVOID GdiThreadLocalInfo
; /* 6C8h */
425 ULONG Win32ClientInfo
[62]; /* 6CCh */
426 PVOID glDispatchTable
[0xE9]; /* 7C4h */
427 ULONG glReserved1
[0x1D]; /* B68h */
428 PVOID glReserved2
; /* BDCh */
429 PVOID glSectionInfo
; /* BE0h */
430 PVOID glSection
; /* BE4h */
431 PVOID glTable
; /* BE8h */
432 PVOID glCurrentRC
; /* BECh */
433 PVOID glContext
; /* BF0h */
434 NTSTATUS LastStatusValue
; /* BF4h */
435 UNICODE_STRING StaticUnicodeString
; /* BF8h */
436 WCHAR StaticUnicodeBuffer
[0x105]; /* C00h */
437 PVOID DeallocationStack
; /* E0Ch */
438 PVOID TlsSlots
[0x40]; /* E10h */
439 LIST_ENTRY TlsLinks
; /* F10h */
440 PVOID Vdm
; /* F18h */
441 PVOID ReservedForNtRpc
; /* F1Ch */
442 PVOID DbgSsReserved
[0x2]; /* F20h */
443 ULONG HardErrorDisabled
; /* F28h */
444 PVOID Instrumentation
[14]; /* F2Ch */
445 PVOID SubProcessTag
; /* F64h */
446 PVOID EtwTraceData
; /* F68h */
447 PVOID WinSockData
; /* F6Ch */
448 ULONG GdiBatchCount
; /* F70h */
449 BOOLEAN InDbgPrint
; /* F74h */
450 BOOLEAN FreeStackOnTermination
; /* F75h */
451 BOOLEAN HasFiberData
; /* F76h */
452 UCHAR IdealProcessor
; /* F77h */
453 ULONG GuaranteedStackBytes
; /* F78h */
454 PVOID ReservedForPerf
; /* F7Ch */
455 PVOID ReservedForOle
; /* F80h */
456 ULONG WaitingOnLoaderLock
; /* F84h */
457 ULONG SparePointer1
; /* F88h */
458 ULONG SoftPatchPtr1
; /* F8Ch */
459 ULONG SoftPatchPtr2
; /* F90h */
460 PVOID
*TlsExpansionSlots
; /* F94h */
461 ULONG ImpersionationLocale
; /* F98h */
462 ULONG IsImpersonating
; /* F9Ch */
463 PVOID NlsCache
; /* FA0h */
464 PVOID pShimData
; /* FA4h */
465 ULONG HeapVirualAffinity
; /* FA8h */
466 PVOID CurrentTransactionHandle
; /* FACh */
467 PTEB_ACTIVE_FRAME ActiveFrame
; /* FB0h */
468 PVOID FlsData
; /* FB4h */
469 UCHAR SafeThunkCall
; /* FB8h */
470 UCHAR BooleanSpare
[3]; /* FB9h */
473 #ifdef NTOS_MODE_USER
476 // Process Information Structures for NtQueryProcessInformation
478 typedef struct _PROCESS_BASIC_INFORMATION
482 ULONG_PTR AffinityMask
;
483 KPRIORITY BasePriority
;
484 ULONG_PTR UniqueProcessId
;
485 ULONG_PTR InheritedFromUniqueProcessId
;
486 } PROCESS_BASIC_INFORMATION
,*PPROCESS_BASIC_INFORMATION
;
488 typedef struct _PROCESS_ACCESS_TOKEN
492 } PROCESS_ACCESS_TOKEN
, *PPROCESS_ACCESS_TOKEN
;
494 typedef struct _PROCESS_DEVICEMAP_INFORMATION
500 HANDLE DirectoryHandle
;
508 } PROCESS_DEVICEMAP_INFORMATION
, *PPROCESS_DEVICEMAP_INFORMATION
;
510 typedef struct _KERNEL_USER_TIMES
512 LARGE_INTEGER CreateTime
;
513 LARGE_INTEGER ExitTime
;
514 LARGE_INTEGER KernelTime
;
515 LARGE_INTEGER UserTime
;
516 } KERNEL_USER_TIMES
, *PKERNEL_USER_TIMES
;
518 typedef struct _PROCESS_SESSION_INFORMATION
521 } PROCESS_SESSION_INFORMATION
, *PPROCESS_SESSION_INFORMATION
;
525 typedef struct _PROCESS_PRIORITY_CLASS
529 } PROCESS_PRIORITY_CLASS
, *PPROCESS_PRIORITY_CLASS
;
532 // Thread Information Structures for NtQueryProcessInformation
534 typedef struct _THREAD_BASIC_INFORMATION
537 PVOID TebBaseAddress
;
539 KAFFINITY AffinityMask
;
541 KPRIORITY BasePriority
;
542 } THREAD_BASIC_INFORMATION
, *PTHREAD_BASIC_INFORMATION
;
544 #ifndef NTOS_MODE_USER
547 // EPROCESS Quota Structures
549 typedef struct _EPROCESS_QUOTA_ENTRY
555 } EPROCESS_QUOTA_ENTRY
, *PEPROCESS_QUOTA_ENTRY
;
557 typedef struct _EPROCESS_QUOTA_BLOCK
559 EPROCESS_QUOTA_ENTRY QuotaEntry
[3];
560 LIST_ENTRY QuotaList
;
561 ULONG ReferenceCount
;
563 } EPROCESS_QUOTA_BLOCK
, *PEPROCESS_QUOTA_BLOCK
;
566 // FIXME: This really belongs in mmtypes.h
568 typedef struct _PAGEFAULT_HISTORY
574 PROCESS_WS_WATCH_INFORMATION WatchInfo
[1];
575 } PAGEFAULT_HISTORY
, *PPAGEFAULT_HISTORY
;
578 // Process Impersonation Information
580 typedef struct _PS_IMPERSONATION_INFORMATION
584 BOOLEAN EffectiveOnly
;
585 SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
;
586 } PS_IMPERSONATION_INFORMATION
, *PPS_IMPERSONATION_INFORMATION
;
589 // Process Termination Port
591 typedef struct _TERMINATION_PORT
593 struct _TERMINATION_PORT
*Next
;
595 } TERMINATION_PORT
, *PTERMINATION_PORT
;
598 // Executive Thread (ETHREAD)
600 #include <pshpack4.h>
601 typedef struct _ETHREAD
603 KTHREAD Tcb
; /* 000 */
604 PVOID Padding
; /* 1B4 */
605 LARGE_INTEGER CreateTime
; /* 1B8 */
608 LARGE_INTEGER ExitTime
; /* 1C0 */
609 LIST_ENTRY LpcReplyChain
; /* 1C0 */
610 LIST_ENTRY KeyedWaitChain
; /* 1C0 */
614 NTSTATUS ExitStatus
; /* 1C8 */
615 PVOID OfsChain
; /* 1C8 */
617 LIST_ENTRY PostBlockList
; /* 1CC */
620 struct _TERMINATION_PORT
*TerminationPort
; /* 1D4 */
621 struct _ETHREAD
*ReaperLink
; /* 1D4 */
622 PVOID KeyedWaitValue
; /* 1D4 */
624 KSPIN_LOCK ActiveTimerListLock
; /* 1D8 */
625 LIST_ENTRY ActiveTimerListHead
; /* 1DC */
626 CLIENT_ID Cid
; /* 1E4 */
629 KSEMAPHORE LpcReplySemaphore
; /* 1EC */
630 KSEMAPHORE KeyedReplySemaphore
; /* 1EC */
634 PVOID LpcReplyMessage
; /* 200 */
635 PVOID LpcWaitingOnPort
; /* 200 */
637 PPS_IMPERSONATION_INFORMATION ImpersonationInfo
; /* 204 */
638 LIST_ENTRY IrpList
; /* 208 */
639 ULONG TopLevelIrp
; /* 210 */
640 PDEVICE_OBJECT DeviceToVerify
; /* 214 */
641 struct _EPROCESS
*ThreadsProcess
; /* 218 */
642 PKSTART_ROUTINE StartAddress
; /* 21C */
645 PVOID Win32StartAddress
; /* 220 */
646 ULONG LpcReceivedMessageId
; /* 220 */
648 LIST_ENTRY ThreadListEntry
; /* 224 */
649 EX_RUNDOWN_REF RundownProtect
; /* 22C */
650 EX_PUSH_LOCK ThreadLock
; /* 230 */
651 ULONG LpcReplyMessageId
; /* 234 */
652 ULONG ReadClusterSize
; /* 238 */
653 ACCESS_MASK GrantedAccess
; /* 23C */
660 ULONG HideFromDebugger
:1;
661 ULONG ActiveImpersonationInfo
:1;
662 ULONG SystemThread
:1;
663 ULONG HardErrorsAreDisabled
:1;
664 ULONG BreakOnTermination
:1;
665 ULONG SkipCreationMsg
:1;
666 ULONG SkipTerminationMsg
:1;
668 ULONG CrossThreadFlags
; /* 240 */
674 ULONG ActiveExWorker
:1;
675 ULONG ExWorkerCanWaitUser
:1;
677 ULONG KeyedEventInUse
:1;
679 ULONG SameThreadPassiveFlags
; /* 244 */
685 ULONG LpcReceivedMsgIdValid
:1;
686 ULONG LpcExitThreadCalled
:1;
687 ULONG AddressSpaceOwner
:1;
688 ULONG OwnsProcessWorkingSetExclusive
:1;
689 ULONG OwnsProcessWorkingSetShared
:1;
690 ULONG OwnsSystemWorkingSetExclusive
:1;
691 ULONG OwnsSystemWorkingSetShared
:1;
692 ULONG OwnsSessionWorkingSetExclusive
:1;
693 ULONG OwnsSessionWorkingSetShared
:1;
696 ULONG SameThreadApcFlags
; /* 248 */
698 UCHAR ForwardClusterOnly
; /* 24C */
699 UCHAR DisablePageFaultClustering
; /* 24D */
700 UCHAR ActiveFaultCount
; /* 24E */
703 #if defined(_NTOSKRNL_)
704 #include <internal/mm.h>
708 // Executive Process (EPROCESS)
710 typedef struct _EPROCESS
712 KPROCESS Pcb
; /* 000 */
713 EX_PUSH_LOCK ProcessLock
; /* 078 */
714 LARGE_INTEGER CreateTime
; /* 080 */
715 LARGE_INTEGER ExitTime
; /* 088 */
716 EX_RUNDOWN_REF RundownProtect
; /* 090 */
717 HANDLE UniqueProcessId
; /* 094 */
718 LIST_ENTRY ActiveProcessLinks
; /* 098 */
719 ULONG QuotaUsage
[3]; /* 0A0 */
720 ULONG QuotaPeak
[3]; /* 0AC */
721 ULONG CommitCharge
; /* 0B8 */
722 ULONG PeakVirtualSize
; /* 0BC */
723 ULONG VirtualSize
; /* 0C0 */
724 LIST_ENTRY SessionProcessLinks
; /* 0C4 */
725 PVOID DebugPort
; /* 0CC */
726 PVOID ExceptionPort
; /* 0D0 */
727 PHANDLE_TABLE ObjectTable
; /* 0D4 */
728 EX_FAST_REF Token
; /* 0D8 */
729 ULONG WorkingSetPage
; /* 0DC */
730 KGUARDED_MUTEX AddressCreationLock
; /* 0E0 */
731 KSPIN_LOCK HyperSpaceLock
; /* 100 */
732 PETHREAD ForkInProgress
; /* 104 */
733 ULONG HardwareTrigger
; /* 108 */
734 MM_AVL_TABLE PhysicalVadroot
; /* 10C */
735 PVOID CloneRoot
; /* 110 */
736 ULONG NumberOfPrivatePages
; /* 114 */
737 ULONG NumberOfLockedPages
; /* 118 */
738 PVOID
*Win32Process
; /* 11C */
739 struct _EJOB
*Job
; /* 120 */
740 PVOID SectionObject
; /* 124 */
741 PVOID SectionBaseAddress
; /* 128 */
742 PEPROCESS_QUOTA_BLOCK QuotaBlock
; /* 12C */
743 PPAGEFAULT_HISTORY WorkingSetWatch
; /* 130 */
744 PVOID Win32WindowStation
; /* 134 */
745 HANDLE InheritedFromUniqueProcessId
; /* 138 */
746 PVOID LdtInformation
; /* 13C */
747 PVOID VadFreeHint
; /* 140 */
748 PVOID VdmObjects
; /* 144 */
749 PVOID DeviceMap
; /* 148 */
750 PVOID Spare0
[3]; /* 14C */
753 HARDWARE_PTE_X86 PagedirectoryPte
; /* 158 */
754 ULONGLONG Filler
; /* 158 */
756 ULONG Session
; /* 160 */
757 CHAR ImageFileName
[16]; /* 164 */
758 LIST_ENTRY JobLinks
; /* 174 */
759 PVOID LockedPagesList
; /* 17C */
760 LIST_ENTRY ThreadListHead
; /* 184 */
761 PVOID SecurityPort
; /* 188 */
762 PVOID PaeTop
; /* 18C */
763 ULONG ActiveThreads
; /* 190 */
764 ACCESS_MASK GrantedAccess
; /* 194 */
765 ULONG DefaultHardErrorProcessing
; /* 198 */
766 NTSTATUS LastThreadExitStatus
; /* 19C */
767 struct _PEB
* Peb
; /* 1A0 */
768 EX_FAST_REF PrefetchTrace
; /* 1A4 */
769 LARGE_INTEGER ReadOperationCount
; /* 1A8 */
770 LARGE_INTEGER WriteOperationCount
; /* 1B0 */
771 LARGE_INTEGER OtherOperationCount
; /* 1B8 */
772 LARGE_INTEGER ReadTransferCount
; /* 1C0 */
773 LARGE_INTEGER WriteTransferCount
; /* 1C8 */
774 LARGE_INTEGER OtherTransferCount
; /* 1D0 */
775 ULONG CommitChargeLimit
; /* 1D8 */
776 ULONG CommitChargePeak
; /* 1DC */
777 PVOID AweInfo
; /* 1E0 */
778 SE_AUDIT_PROCESS_CREATION_INFO SeAuditProcessCreationInfo
; /* 1E4 */
779 MMSUPPORT Vm
; /* 1E8 */
780 LIST_ENTRY MmProcessLinks
; /* 230 */
781 ULONG ModifiedPageCount
; /* 238 */
782 ULONG JobStatus
; /* 23C */
787 ULONG CreateReported
:1;
788 ULONG NoDebugInherit
:1;
789 ULONG ProcessExiting
:1;
790 ULONG ProcessDelete
:1;
791 ULONG Wow64SplitPages
:1;
793 ULONG OutswapEnabled
:1;
796 ULONG Wow64VaSpace4Gb
:1;
797 ULONG AddressSpaceInitialized
:2;
798 ULONG SetTimerResolution
:1;
799 ULONG BreakOnTermination
:1;
800 ULONG SessionCreationUnderway
:1;
802 ULONG ProcessInSession
:1;
803 ULONG OverrideAddressSpace
:1;
804 ULONG HasAddressSpace
:1;
805 ULONG LaunchPrefetched
:1;
806 ULONG InjectInpageErrors
:1;
808 ULONG ImageNotifyDone
:1;
809 ULONG PdeUpdateNeeded
:1;
812 ULONG CreateFailed
:1;
813 ULONG DefaultIoPriority
:3;
817 ULONG Flags
; /* 240 */
820 NTSTATUS ExitStatus
; /* 244 */
821 USHORT NextPageColor
; /* 248 */
826 UCHAR SubSystemMinorVersion
; /* 24A */
827 UCHAR SubSystemMajorVersion
; /* 24B */
829 USHORT SubSystemVersion
; /* 24A */
831 UCHAR PriorityClass
; /* 24C */
832 MM_AVL_TABLE VadRoot
; /* 250 */
833 ULONG Cookie
; /* 270 */
836 /* FIXME: WILL BE DEPRECATED WITH PUSHLOCK SUPPORT IN 0.3.0*/
837 KEVENT LockEvent
; /* 274 */
838 ULONG LockCount
; /* 284 */
839 struct _KTHREAD
*LockOwner
; /* 288 */
841 /* FIXME: MOVE TO AVL TREES */
842 MADDRESS_SPACE AddressSpace
; /* 28C */
848 // Job Token Filter Data
850 #include <pshpack1.h>
851 typedef struct _PS_JOB_TOKEN_FILTER
853 ULONG CapturedSidCount
;
854 PSID_AND_ATTRIBUTES CapturedSids
;
855 ULONG CapturedSidsLength
;
856 ULONG CapturedGroupCount
;
857 PSID_AND_ATTRIBUTES CapturedGroups
;
858 ULONG CapturedGroupsLength
;
859 ULONG CapturedPrivilegeCount
;
860 PLUID_AND_ATTRIBUTES CapturedPrivileges
;
861 ULONG CapturedPrivilegesLength
;
862 } PS_JOB_TOKEN_FILTER
, *PPS_JOB_TOKEN_FILTER
;
865 // Executive Job (EJOB)
871 LIST_ENTRY ProcessListHead
;
873 LARGE_INTEGER TotalUserTime
;
874 LARGE_INTEGER TotalKernelTime
;
875 LARGE_INTEGER ThisPeriodTotalUserTime
;
876 LARGE_INTEGER ThisPeriodTotalKernelTime
;
877 ULONG TotalPageFaultCount
;
878 ULONG TotalProcesses
;
879 ULONG ActiveProcesses
;
880 ULONG TotalTerminatedProcesses
;
881 LARGE_INTEGER PerProcessUserTimeLimit
;
882 LARGE_INTEGER PerJobUserTimeLimit
;
884 ULONG MinimumWorkingSetSize
;
885 ULONG MaximumWorkingSetSize
;
886 ULONG ActiveProcessLimit
;
889 ULONG UIRestrictionsClass
;
890 ULONG SecurityLimitFlags
;
892 PPS_JOB_TOKEN_FILTER Filter
;
893 ULONG EndOfJobTimeAction
;
894 PVOID CompletionPort
;
897 ULONG SchedulingClass
;
898 ULONGLONG ReadOperationCount
;
899 ULONGLONG WriteOperationCount
;
900 ULONGLONG OtherOperationCount
;
901 ULONGLONG ReadTransferCount
;
902 ULONGLONG WriteTransferCount
;
903 ULONGLONG OtherTransferCount
;
905 ULONG ProcessMemoryLimit
;
906 ULONG JobMemoryLimit
;
907 ULONG PeakProcessMemoryUsed
;
908 ULONG PeakJobMemoryUsed
;
909 ULONG CurrentJobMemoryUsed
;
910 KGUARDED_MUTEX MemoryLimitsLock
;
917 // Win32K Callback Registration Data
919 typedef struct _W32_CALLOUT_DATA
921 PW32_PROCESS_CALLBACK W32ProcessCallout
;
922 PW32_THREAD_CALLBACK W32ThreadCallout
;
923 PVOID UserGlobalAtomTableCallout
;
924 PVOID UserPowerEventCallout
;
925 PVOID UserPowerStateCallout
;
926 PVOID UserJobCallout
;
927 PVOID NtGdiUserFlushUserBatch
;
928 OB_OPEN_METHOD DesktopOpen
;
930 OB_DELETE_METHOD DesktopDelete
;
931 OB_OKAYTOCLOSE_METHOD WinstaOkayToClose
;
932 OB_DELETE_METHOD WinStaDelete
;
933 OB_PARSE_METHOD WinStaParse
;
934 OB_OPEN_METHOD WinStaOpen
;
936 /* FIXME: REACTOS ONLY */
937 OB_FIND_METHOD WinStaFind
;
938 OB_OPEN_METHOD WinStaCreate
;
939 OB_CREATE_METHOD DesktopCreate
;
941 } W32_CALLOUT_DATA
, *PW32_CALLOUT_DATA
;
943 #endif // !NTOS_MODE_USER