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
111 // Process Access Types
113 #ifndef NTOS_MODE_USER
114 #define PROCESS_TERMINATE 0x0001
115 #define PROCESS_CREATE_THREAD 0x0002
116 #define PROCESS_SET_SESSIONID 0x0004
117 #define PROCESS_VM_OPERATION 0x0008
118 #define PROCESS_VM_READ 0x0010
119 #define PROCESS_VM_WRITE 0x0020
120 #define PROCESS_CREATE_PROCESS 0x0080
121 #define PROCESS_SET_QUOTA 0x0100
122 #define PROCESS_SET_INFORMATION 0x0200
123 #define PROCESS_QUERY_INFORMATION 0x0400
124 #define PROCESS_SUSPEND_RESUME 0x0800
125 #define PROCESS_QUERY_LIMITED_INFORMATION 0x1000
126 #define PROCESS_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0xFFFF)
132 #define JOB_OBJECT_ASSIGN_PROCESS 0x1
133 #define JOB_OBJECT_SET_ATTRIBUTES 0x2
134 #define JOB_OBJECT_QUERY 0x4
135 #define JOB_OBJECT_TERMINATE 0x8
136 #define JOB_OBJECT_SET_SECURITY_ATTRIBUTES 0x10
137 #define JOB_OBJECT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 31)
140 #ifdef NTOS_MODE_USER
142 // Current Process/Thread built-in 'special' handles
144 #define NtCurrentProcess() ((HANDLE)(LONG_PTR)-1)
145 #define ZwCurrentProcess() NtCurrentProcess()
146 #define NtCurrentThread() ((HANDLE)(LONG_PTR)-2)
147 #define ZwCurrentThread() NtCurrentThread()
150 // Process/Thread/Job Information Classes for NtQueryInformationProcess/Thread/Job
152 typedef enum _PROCESSINFOCLASS
154 ProcessBasicInformation
,
160 ProcessRaisePriority
,
162 ProcessExceptionPort
,
164 ProcessLdtInformation
,
166 ProcessDefaultHardErrorMode
,
167 ProcessIoPortHandlers
,
168 ProcessPooledUsageAndLimits
,
169 ProcessWorkingSetWatch
,
171 ProcessEnableAlignmentFaultFixup
,
172 ProcessPriorityClass
,
173 ProcessWx86Information
,
176 ProcessPriorityBoost
,
178 ProcessSessionInformation
,
179 ProcessForegroundInformation
,
180 ProcessWow64Information
,
181 ProcessImageFileName
,
182 ProcessLUIDDeviceMapsEnabled
,
183 ProcessBreakOnTermination
,
184 ProcessDebugObjectHandle
,
186 ProcessHandleTracing
,
189 ProcessTlsInformation
,
191 ProcessImageInformation
,
194 ProcessInstrumentationCallback
,
198 typedef enum _THREADINFOCLASS
200 ThreadBasicInformation
,
205 ThreadImpersonationToken
,
206 ThreadDescriptorTableEntry
,
207 ThreadEnableAlignmentFaultFixup
,
208 ThreadEventPair_Reusable
,
209 ThreadQuerySetWin32StartAddress
,
211 ThreadPerformanceCount
,
213 ThreadIdealProcessor
,
215 ThreadSetTlsArrayAddress
,
217 ThreadHideFromDebugger
,
218 ThreadBreakOnTermination
,
219 ThreadSwitchLegacyState
,
221 ThreadLastSystemCall
,
225 ThreadActualBasePriority
,
231 typedef enum _JOBOBJECTINFOCLASS
233 JobObjectBasicAccountingInformation
= 1,
234 JobObjectBasicLimitInformation
,
235 JobObjectBasicProcessIdList
,
236 JobObjectBasicUIRestrictions
,
237 JobObjectSecurityLimitInformation
,
238 JobObjectEndOfJobTimeInformation
,
239 JobObjectAssociateCompletionPortInformation
,
240 JobObjectBasicAndIoAccountingInformation
,
241 JobObjectExtendedLimitInformation
,
242 JobObjectJobSetInformation
,
243 MaxJobObjectInfoClass
244 } JOBOBJECTINFOCLASS
;
247 // Declare empty structure definitions so that they may be referenced by
248 // routines before they are defined
255 // Win32K Process and Thread Callbacks
258 (NTAPI
*PW32_PROCESS_CALLBACK
)(
259 struct _EPROCESS
*Process
,
264 (NTAPI
*PW32_THREAD_CALLBACK
)(
265 struct _ETHREAD
*Thread
,
271 #ifdef NTOS_MODE_USER
274 // ClientID Structure
276 typedef struct _CLIENT_ID
278 HANDLE UniqueProcess
;
280 } CLIENT_ID
, *PCLIENT_ID
;
285 // Descriptor Table Entry Definition
287 #define _DESCRIPTOR_TABLE_ENTRY_DEFINED
288 typedef struct _DESCRIPTOR_TABLE_ENTRY
291 LDT_ENTRY Descriptor
;
292 } DESCRIPTOR_TABLE_ENTRY
, *PDESCRIPTOR_TABLE_ENTRY
;
298 (NTAPI
*PPEBLOCKROUTINE
)(
303 // PEB Free Block Descriptor
305 typedef struct _PEB_FREE_BLOCK
307 struct _PEB_FREE_BLOCK
* Next
;
309 } PEB_FREE_BLOCK
, *PPEB_FREE_BLOCK
;
312 // Process Environment Block (PEB)
316 UCHAR InheritedAddressSpace
; /* 00h */
317 UCHAR ReadImageFileExecOptions
; /* 01h */
318 UCHAR BeingDebugged
; /* 02h */
319 BOOLEAN SpareBool
; /* 03h */
320 HANDLE Mutant
; /* 04h */
321 PVOID ImageBaseAddress
; /* 08h */
322 PPEB_LDR_DATA Ldr
; /* 0Ch */
323 struct _RTL_USER_PROCESS_PARAMETERS
*ProcessParameters
; /* 10h */
324 PVOID SubSystemData
; /* 14h */
325 PVOID ProcessHeap
; /* 18h */
326 PVOID FastPebLock
; /* 1Ch */
327 PPEBLOCKROUTINE FastPebLockRoutine
; /* 20h */
328 PPEBLOCKROUTINE FastPebUnlockRoutine
; /* 24h */
329 ULONG EnvironmentUpdateCount
; /* 28h */
330 PVOID
* KernelCallbackTable
; /* 2Ch */
331 PVOID EventLogSection
; /* 30h */
332 PVOID EventLog
; /* 34h */
333 PPEB_FREE_BLOCK FreeList
; /* 38h */
334 ULONG TlsExpansionCounter
; /* 3Ch */
335 PVOID TlsBitmap
; /* 40h */
336 ULONG TlsBitmapBits
[0x2]; /* 44h */
337 PVOID ReadOnlySharedMemoryBase
; /* 4Ch */
338 PVOID ReadOnlySharedMemoryHeap
; /* 50h */
339 PVOID
* ReadOnlyStaticServerData
; /* 54h */
340 PVOID AnsiCodePageData
; /* 58h */
341 PVOID OemCodePageData
; /* 5Ch */
342 PVOID UnicodeCaseTableData
; /* 60h */
343 ULONG NumberOfProcessors
; /* 64h */
344 ULONG NtGlobalFlag
; /* 68h */
345 LARGE_INTEGER CriticalSectionTimeout
; /* 70h */
346 ULONG HeapSegmentReserve
; /* 78h */
347 ULONG HeapSegmentCommit
; /* 7Ch */
348 ULONG HeapDeCommitTotalFreeThreshold
; /* 80h */
349 ULONG HeapDeCommitFreeBlockThreshold
; /* 84h */
350 ULONG NumberOfHeaps
; /* 88h */
351 ULONG MaximumNumberOfHeaps
; /* 8Ch */
352 PVOID
* ProcessHeaps
; /* 90h */
353 PVOID GdiSharedHandleTable
; /* 94h */
354 PVOID ProcessStarterHelper
; /* 98h */
355 PVOID GdiDCAttributeList
; /* 9Ch */
356 PVOID LoaderLock
; /* A0h */
357 ULONG OSMajorVersion
; /* A4h */
358 ULONG OSMinorVersion
; /* A8h */
359 USHORT OSBuildNumber
; /* ACh */
360 USHORT OSCSDVersion
; /* AEh */
361 ULONG OSPlatformId
; /* B0h */
362 ULONG ImageSubSystem
; /* B4h */
363 ULONG ImageSubSystemMajorVersion
; /* B8h */
364 ULONG ImageSubSystemMinorVersion
; /* BCh */
365 ULONG ImageProcessAffinityMask
; /* C0h */
366 ULONG GdiHandleBuffer
[0x22]; /* C4h */
367 PVOID PostProcessInitRoutine
; /* 14Ch */
368 struct _RTL_BITMAP
*TlsExpansionBitmap
; /* 150h */
369 ULONG TlsExpansionBitmapBits
[0x20]; /* 154h */
370 ULONG SessionId
; /* 1D4h */
371 PVOID AppCompatInfo
; /* 1D8h */
372 UNICODE_STRING CSDVersion
; /* 1DCh */
376 // GDI Batch Descriptor
378 typedef struct _GDI_TEB_BATCH
383 } GDI_TEB_BATCH
, *PGDI_TEB_BATCH
;
388 typedef struct _INITIAL_TEB
390 PVOID PreviousStackBase
;
391 PVOID PreviousStackLimit
;
394 PVOID AllocatedStackBase
;
395 } INITIAL_TEB
, *PINITIAL_TEB
;
398 // TEB Active Frame Structures
400 typedef struct _TEB_ACTIVE_FRAME_CONTEXT
404 } TEB_ACTIVE_FRAME_CONTEXT
, *PTEB_ACTIVE_FRAME_CONTEXT
;
406 typedef struct _TEB_ACTIVE_FRAME
409 struct _TEB_ACTIVE_FRAME
*Previous
;
410 PTEB_ACTIVE_FRAME_CONTEXT Context
;
411 } TEB_ACTIVE_FRAME
, *PTEB_ACTIVE_FRAME
;
414 // Thread Environment Block (TEB)
418 NT_TIB Tib
; /* 00h */
419 PVOID EnvironmentPointer
; /* 1Ch */
420 CLIENT_ID Cid
; /* 20h */
421 PVOID ActiveRpcHandle
; /* 28h */
422 PVOID ThreadLocalStoragePointer
; /* 2Ch */
423 struct _PEB
*ProcessEnvironmentBlock
; /* 30h */
424 ULONG LastErrorValue
; /* 34h */
425 ULONG CountOfOwnedCriticalSections
; /* 38h */
426 PVOID CsrClientThread
; /* 3Ch */
427 PVOID Win32ThreadInfo
; /* 40h */
428 ULONG User32Reserved
[0x1A]; /* 44h */
429 ULONG UserReserved
[5]; /* ACh */
430 PVOID WOW32Reserved
; /* C0h */
431 LCID CurrentLocale
; /* C4h */
432 ULONG FpSoftwareStatusRegister
; /* C8h */
433 PVOID SystemReserved1
[0x36]; /* CCh */
434 LONG ExceptionCode
; /* 1A4h */
435 struct _ACTIVATION_CONTEXT_STACK
*ActivationContextStackPointer
; /* 1A8h */
436 UCHAR SpareBytes1
[0x28]; /* 1ACh */
437 GDI_TEB_BATCH GdiTebBatch
; /* 1D4h */
438 CLIENT_ID RealClientId
; /* 6B4h */
439 PVOID GdiCachedProcessHandle
; /* 6BCh */
440 ULONG GdiClientPID
; /* 6C0h */
441 ULONG GdiClientTID
; /* 6C4h */
442 PVOID GdiThreadLocalInfo
; /* 6C8h */
443 ULONG Win32ClientInfo
[62]; /* 6CCh */
444 PVOID glDispatchTable
[0xE9]; /* 7C4h */
445 ULONG glReserved1
[0x1D]; /* B68h */
446 PVOID glReserved2
; /* BDCh */
447 PVOID glSectionInfo
; /* BE0h */
448 PVOID glSection
; /* BE4h */
449 PVOID glTable
; /* BE8h */
450 PVOID glCurrentRC
; /* BECh */
451 PVOID glContext
; /* BF0h */
452 NTSTATUS LastStatusValue
; /* BF4h */
453 UNICODE_STRING StaticUnicodeString
; /* BF8h */
454 WCHAR StaticUnicodeBuffer
[0x105]; /* C00h */
455 PVOID DeallocationStack
; /* E0Ch */
456 PVOID TlsSlots
[0x40]; /* E10h */
457 LIST_ENTRY TlsLinks
; /* F10h */
458 PVOID Vdm
; /* F18h */
459 PVOID ReservedForNtRpc
; /* F1Ch */
460 PVOID DbgSsReserved
[0x2]; /* F20h */
461 ULONG HardErrorDisabled
; /* F28h */
462 PVOID Instrumentation
[14]; /* F2Ch */
463 PVOID SubProcessTag
; /* F64h */
464 PVOID EtwTraceData
; /* F68h */
465 PVOID WinSockData
; /* F6Ch */
466 ULONG GdiBatchCount
; /* F70h */
467 BOOLEAN InDbgPrint
; /* F74h */
468 BOOLEAN FreeStackOnTermination
; /* F75h */
469 BOOLEAN HasFiberData
; /* F76h */
470 UCHAR IdealProcessor
; /* F77h */
471 ULONG GuaranteedStackBytes
; /* F78h */
472 PVOID ReservedForPerf
; /* F7Ch */
473 PVOID ReservedForOle
; /* F80h */
474 ULONG WaitingOnLoaderLock
; /* F84h */
475 ULONG SparePointer1
; /* F88h */
476 ULONG SoftPatchPtr1
; /* F8Ch */
477 ULONG SoftPatchPtr2
; /* F90h */
478 PVOID
*TlsExpansionSlots
; /* F94h */
479 ULONG ImpersionationLocale
; /* F98h */
480 ULONG IsImpersonating
; /* F9Ch */
481 PVOID NlsCache
; /* FA0h */
482 PVOID pShimData
; /* FA4h */
483 ULONG HeapVirualAffinity
; /* FA8h */
484 PVOID CurrentTransactionHandle
; /* FACh */
485 PTEB_ACTIVE_FRAME ActiveFrame
; /* FB0h */
486 PVOID FlsData
; /* FB4h */
487 UCHAR SafeThunkCall
; /* FB8h */
488 UCHAR BooleanSpare
[3]; /* FB9h */
491 #ifdef NTOS_MODE_USER
494 // Process Information Structures for NtQueryProcessInformation
496 typedef struct _PROCESS_BASIC_INFORMATION
500 ULONG_PTR AffinityMask
;
501 KPRIORITY BasePriority
;
502 ULONG_PTR UniqueProcessId
;
503 ULONG_PTR InheritedFromUniqueProcessId
;
504 } PROCESS_BASIC_INFORMATION
,*PPROCESS_BASIC_INFORMATION
;
506 typedef struct _PROCESS_ACCESS_TOKEN
510 } PROCESS_ACCESS_TOKEN
, *PPROCESS_ACCESS_TOKEN
;
512 typedef struct _PROCESS_DEVICEMAP_INFORMATION
518 HANDLE DirectoryHandle
;
526 } PROCESS_DEVICEMAP_INFORMATION
, *PPROCESS_DEVICEMAP_INFORMATION
;
528 typedef struct _KERNEL_USER_TIMES
530 LARGE_INTEGER CreateTime
;
531 LARGE_INTEGER ExitTime
;
532 LARGE_INTEGER KernelTime
;
533 LARGE_INTEGER UserTime
;
534 } KERNEL_USER_TIMES
, *PKERNEL_USER_TIMES
;
536 typedef struct _PROCESS_SESSION_INFORMATION
539 } PROCESS_SESSION_INFORMATION
, *PPROCESS_SESSION_INFORMATION
;
543 typedef struct _PROCESS_PRIORITY_CLASS
547 } PROCESS_PRIORITY_CLASS
, *PPROCESS_PRIORITY_CLASS
;
550 // Thread Information Structures for NtQueryProcessInformation
552 typedef struct _THREAD_BASIC_INFORMATION
555 PVOID TebBaseAddress
;
557 KAFFINITY AffinityMask
;
559 KPRIORITY BasePriority
;
560 } THREAD_BASIC_INFORMATION
, *PTHREAD_BASIC_INFORMATION
;
562 #ifndef NTOS_MODE_USER
565 // EPROCESS Quota Structures
567 typedef struct _EPROCESS_QUOTA_ENTRY
573 } EPROCESS_QUOTA_ENTRY
, *PEPROCESS_QUOTA_ENTRY
;
575 typedef struct _EPROCESS_QUOTA_BLOCK
577 EPROCESS_QUOTA_ENTRY QuotaEntry
[3];
578 LIST_ENTRY QuotaList
;
579 ULONG ReferenceCount
;
581 } EPROCESS_QUOTA_BLOCK
, *PEPROCESS_QUOTA_BLOCK
;
584 // FIXME: This really belongs in mmtypes.h
586 typedef struct _PAGEFAULT_HISTORY
592 PROCESS_WS_WATCH_INFORMATION WatchInfo
[1];
593 } PAGEFAULT_HISTORY
, *PPAGEFAULT_HISTORY
;
596 // Process Impersonation Information
598 typedef struct _PS_IMPERSONATION_INFORMATION
602 BOOLEAN EffectiveOnly
;
603 SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
;
604 } PS_IMPERSONATION_INFORMATION
, *PPS_IMPERSONATION_INFORMATION
;
607 // Process Termination Port
609 typedef struct _TERMINATION_PORT
611 struct _TERMINATION_PORT
*Next
;
613 } TERMINATION_PORT
, *PTERMINATION_PORT
;
616 // Executive Thread (ETHREAD)
618 #include <pshpack4.h>
619 typedef struct _ETHREAD
621 KTHREAD Tcb
; /* 000 */
622 PVOID Padding
; /* 1B4 */
623 LARGE_INTEGER CreateTime
; /* 1B8 */
626 LARGE_INTEGER ExitTime
; /* 1C0 */
627 LIST_ENTRY LpcReplyChain
; /* 1C0 */
628 LIST_ENTRY KeyedWaitChain
; /* 1C0 */
632 NTSTATUS ExitStatus
; /* 1C8 */
633 PVOID OfsChain
; /* 1C8 */
635 LIST_ENTRY PostBlockList
; /* 1CC */
638 struct _TERMINATION_PORT
*TerminationPort
; /* 1D4 */
639 struct _ETHREAD
*ReaperLink
; /* 1D4 */
640 PVOID KeyedWaitValue
; /* 1D4 */
642 KSPIN_LOCK ActiveTimerListLock
; /* 1D8 */
643 LIST_ENTRY ActiveTimerListHead
; /* 1DC */
644 CLIENT_ID Cid
; /* 1E4 */
647 KSEMAPHORE LpcReplySemaphore
; /* 1EC */
648 KSEMAPHORE KeyedReplySemaphore
; /* 1EC */
652 PVOID LpcReplyMessage
; /* 200 */
653 PVOID LpcWaitingOnPort
; /* 200 */
655 PPS_IMPERSONATION_INFORMATION ImpersonationInfo
; /* 204 */
656 LIST_ENTRY IrpList
; /* 208 */
657 ULONG TopLevelIrp
; /* 210 */
658 PDEVICE_OBJECT DeviceToVerify
; /* 214 */
659 struct _EPROCESS
*ThreadsProcess
; /* 218 */
660 PKSTART_ROUTINE StartAddress
; /* 21C */
663 PVOID Win32StartAddress
; /* 220 */
664 ULONG LpcReceivedMessageId
; /* 220 */
666 LIST_ENTRY ThreadListEntry
; /* 224 */
667 EX_RUNDOWN_REF RundownProtect
; /* 22C */
668 EX_PUSH_LOCK ThreadLock
; /* 230 */
669 ULONG LpcReplyMessageId
; /* 234 */
670 ULONG ReadClusterSize
; /* 238 */
671 ACCESS_MASK GrantedAccess
; /* 23C */
678 ULONG HideFromDebugger
:1;
679 ULONG ActiveImpersonationInfo
:1;
680 ULONG SystemThread
:1;
681 ULONG HardErrorsAreDisabled
:1;
682 ULONG BreakOnTermination
:1;
683 ULONG SkipCreationMsg
:1;
684 ULONG SkipTerminationMsg
:1;
686 ULONG CrossThreadFlags
; /* 240 */
692 ULONG ActiveExWorker
:1;
693 ULONG ExWorkerCanWaitUser
:1;
695 ULONG KeyedEventInUse
:1;
697 ULONG SameThreadPassiveFlags
; /* 244 */
703 ULONG LpcReceivedMsgIdValid
:1;
704 ULONG LpcExitThreadCalled
:1;
705 ULONG AddressSpaceOwner
:1;
706 ULONG OwnsProcessWorkingSetExclusive
:1;
707 ULONG OwnsProcessWorkingSetShared
:1;
708 ULONG OwnsSystemWorkingSetExclusive
:1;
709 ULONG OwnsSystemWorkingSetShared
:1;
710 ULONG OwnsSessionWorkingSetExclusive
:1;
711 ULONG OwnsSessionWorkingSetShared
:1;
714 ULONG SameThreadApcFlags
; /* 248 */
716 UCHAR ForwardClusterOnly
; /* 24C */
717 UCHAR DisablePageFaultClustering
; /* 24D */
718 UCHAR ActiveFaultCount
; /* 24E */
721 #if defined(_NTOSKRNL_)
722 #include <internal/mm.h>
726 // Executive Process (EPROCESS)
728 typedef struct _EPROCESS
730 KPROCESS Pcb
; /* 000 */
731 EX_PUSH_LOCK ProcessLock
; /* 078 */
732 LARGE_INTEGER CreateTime
; /* 080 */
733 LARGE_INTEGER ExitTime
; /* 088 */
734 EX_RUNDOWN_REF RundownProtect
; /* 090 */
735 HANDLE UniqueProcessId
; /* 094 */
736 LIST_ENTRY ActiveProcessLinks
; /* 098 */
737 ULONG QuotaUsage
[3]; /* 0A0 */
738 ULONG QuotaPeak
[3]; /* 0AC */
739 ULONG CommitCharge
; /* 0B8 */
740 ULONG PeakVirtualSize
; /* 0BC */
741 ULONG VirtualSize
; /* 0C0 */
742 LIST_ENTRY SessionProcessLinks
; /* 0C4 */
743 PVOID DebugPort
; /* 0CC */
744 PVOID ExceptionPort
; /* 0D0 */
745 PHANDLE_TABLE ObjectTable
; /* 0D4 */
746 EX_FAST_REF Token
; /* 0D8 */
747 ULONG WorkingSetPage
; /* 0DC */
748 KGUARDED_MUTEX AddressCreationLock
; /* 0E0 */
749 KSPIN_LOCK HyperSpaceLock
; /* 100 */
750 PETHREAD ForkInProgress
; /* 104 */
751 ULONG HardwareTrigger
; /* 108 */
752 MM_AVL_TABLE PhysicalVadroot
; /* 10C */
753 PVOID CloneRoot
; /* 110 */
754 ULONG NumberOfPrivatePages
; /* 114 */
755 ULONG NumberOfLockedPages
; /* 118 */
756 PVOID
*Win32Process
; /* 11C */
757 struct _EJOB
*Job
; /* 120 */
758 PVOID SectionObject
; /* 124 */
759 PVOID SectionBaseAddress
; /* 128 */
760 PEPROCESS_QUOTA_BLOCK QuotaBlock
; /* 12C */
761 PPAGEFAULT_HISTORY WorkingSetWatch
; /* 130 */
762 PVOID Win32WindowStation
; /* 134 */
763 HANDLE InheritedFromUniqueProcessId
; /* 138 */
764 PVOID LdtInformation
; /* 13C */
765 PVOID VadFreeHint
; /* 140 */
766 PVOID VdmObjects
; /* 144 */
767 PVOID DeviceMap
; /* 148 */
768 PVOID Spare0
[3]; /* 14C */
771 HARDWARE_PTE_X86 PagedirectoryPte
; /* 158 */
772 ULONGLONG Filler
; /* 158 */
774 ULONG Session
; /* 160 */
775 CHAR ImageFileName
[16]; /* 164 */
776 LIST_ENTRY JobLinks
; /* 174 */
777 PVOID LockedPagesList
; /* 17C */
778 LIST_ENTRY ThreadListHead
; /* 184 */
779 PVOID SecurityPort
; /* 188 */
780 PVOID PaeTop
; /* 18C */
781 ULONG ActiveThreads
; /* 190 */
782 ACCESS_MASK GrantedAccess
; /* 194 */
783 ULONG DefaultHardErrorProcessing
; /* 198 */
784 NTSTATUS LastThreadExitStatus
; /* 19C */
785 struct _PEB
* Peb
; /* 1A0 */
786 EX_FAST_REF PrefetchTrace
; /* 1A4 */
787 LARGE_INTEGER ReadOperationCount
; /* 1A8 */
788 LARGE_INTEGER WriteOperationCount
; /* 1B0 */
789 LARGE_INTEGER OtherOperationCount
; /* 1B8 */
790 LARGE_INTEGER ReadTransferCount
; /* 1C0 */
791 LARGE_INTEGER WriteTransferCount
; /* 1C8 */
792 LARGE_INTEGER OtherTransferCount
; /* 1D0 */
793 ULONG CommitChargeLimit
; /* 1D8 */
794 ULONG CommitChargePeak
; /* 1DC */
795 PVOID AweInfo
; /* 1E0 */
796 SE_AUDIT_PROCESS_CREATION_INFO SeAuditProcessCreationInfo
; /* 1E4 */
797 MMSUPPORT Vm
; /* 1E8 */
798 LIST_ENTRY MmProcessLinks
; /* 230 */
799 ULONG ModifiedPageCount
; /* 238 */
800 ULONG JobStatus
; /* 23C */
805 ULONG CreateReported
:1;
806 ULONG NoDebugInherit
:1;
807 ULONG ProcessExiting
:1;
808 ULONG ProcessDelete
:1;
809 ULONG Wow64SplitPages
:1;
811 ULONG OutswapEnabled
:1;
814 ULONG Wow64VaSpace4Gb
:1;
815 ULONG AddressSpaceInitialized
:2;
816 ULONG SetTimerResolution
:1;
817 ULONG BreakOnTermination
:1;
818 ULONG SessionCreationUnderway
:1;
820 ULONG ProcessInSession
:1;
821 ULONG OverrideAddressSpace
:1;
822 ULONG HasAddressSpace
:1;
823 ULONG LaunchPrefetched
:1;
824 ULONG InjectInpageErrors
:1;
826 ULONG ImageNotifyDone
:1;
827 ULONG PdeUpdateNeeded
:1;
830 ULONG CreateFailed
:1;
831 ULONG DefaultIoPriority
:3;
835 ULONG Flags
; /* 240 */
838 NTSTATUS ExitStatus
; /* 244 */
839 USHORT NextPageColor
; /* 248 */
844 UCHAR SubSystemMinorVersion
; /* 24A */
845 UCHAR SubSystemMajorVersion
; /* 24B */
847 USHORT SubSystemVersion
; /* 24A */
849 UCHAR PriorityClass
; /* 24C */
850 MM_AVL_TABLE VadRoot
; /* 250 */
851 ULONG Cookie
; /* 270 */
854 /* FIXME: WILL BE DEPRECATED WITH PUSHLOCK SUPPORT IN 0.3.0*/
855 KEVENT LockEvent
; /* 274 */
856 ULONG LockCount
; /* 284 */
857 struct _KTHREAD
*LockOwner
; /* 288 */
859 /* FIXME: MOVE TO AVL TREES */
860 MADDRESS_SPACE AddressSpace
; /* 28C */
866 // Job Token Filter Data
868 #include <pshpack1.h>
869 typedef struct _PS_JOB_TOKEN_FILTER
871 ULONG CapturedSidCount
;
872 PSID_AND_ATTRIBUTES CapturedSids
;
873 ULONG CapturedSidsLength
;
874 ULONG CapturedGroupCount
;
875 PSID_AND_ATTRIBUTES CapturedGroups
;
876 ULONG CapturedGroupsLength
;
877 ULONG CapturedPrivilegeCount
;
878 PLUID_AND_ATTRIBUTES CapturedPrivileges
;
879 ULONG CapturedPrivilegesLength
;
880 } PS_JOB_TOKEN_FILTER
, *PPS_JOB_TOKEN_FILTER
;
883 // Executive Job (EJOB)
889 LIST_ENTRY ProcessListHead
;
891 LARGE_INTEGER TotalUserTime
;
892 LARGE_INTEGER TotalKernelTime
;
893 LARGE_INTEGER ThisPeriodTotalUserTime
;
894 LARGE_INTEGER ThisPeriodTotalKernelTime
;
895 ULONG TotalPageFaultCount
;
896 ULONG TotalProcesses
;
897 ULONG ActiveProcesses
;
898 ULONG TotalTerminatedProcesses
;
899 LARGE_INTEGER PerProcessUserTimeLimit
;
900 LARGE_INTEGER PerJobUserTimeLimit
;
902 ULONG MinimumWorkingSetSize
;
903 ULONG MaximumWorkingSetSize
;
904 ULONG ActiveProcessLimit
;
907 ULONG UIRestrictionsClass
;
908 ULONG SecurityLimitFlags
;
910 PPS_JOB_TOKEN_FILTER Filter
;
911 ULONG EndOfJobTimeAction
;
912 PVOID CompletionPort
;
915 ULONG SchedulingClass
;
916 ULONGLONG ReadOperationCount
;
917 ULONGLONG WriteOperationCount
;
918 ULONGLONG OtherOperationCount
;
919 ULONGLONG ReadTransferCount
;
920 ULONGLONG WriteTransferCount
;
921 ULONGLONG OtherTransferCount
;
923 ULONG ProcessMemoryLimit
;
924 ULONG JobMemoryLimit
;
925 ULONG PeakProcessMemoryUsed
;
926 ULONG PeakJobMemoryUsed
;
927 ULONG CurrentJobMemoryUsed
;
928 KGUARDED_MUTEX MemoryLimitsLock
;
935 // Win32K Callback Registration Data
937 typedef struct _W32_CALLOUT_DATA
939 PW32_PROCESS_CALLBACK W32ProcessCallout
;
940 PW32_THREAD_CALLBACK W32ThreadCallout
;
941 PVOID UserGlobalAtomTableCallout
;
942 PVOID UserPowerEventCallout
;
943 PVOID UserPowerStateCallout
;
944 PVOID UserJobCallout
;
945 PVOID NtGdiUserFlushUserBatch
;
946 OB_OPEN_METHOD DesktopOpen
;
948 OB_DELETE_METHOD DesktopDelete
;
949 OB_OKAYTOCLOSE_METHOD WinstaOkayToClose
;
950 OB_DELETE_METHOD WinStaDelete
;
951 OB_PARSE_METHOD WinStaParse
;
952 OB_OPEN_METHOD WinStaOpen
;
954 /* FIXME: REACTOS ONLY */
955 OB_FIND_METHOD WinStaFind
;
956 OB_OPEN_METHOD WinStaCreate
;
957 OB_CREATE_METHOD DesktopCreate
;
959 } W32_CALLOUT_DATA
, *PW32_CALLOUT_DATA
;
961 #endif // !NTOS_MODE_USER