Update KPROCESS and KTHREAD structure definitions
All checks were successful
Builds / ExectOS (amd64) (push) Successful in 39s
Builds / ExectOS (i686) (push) Successful in 37s

This commit is contained in:
Rafal Kupiec 2024-05-14 19:44:10 +02:00
parent 9f1a4f0ced
commit f74a5521ba
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4

View File

@ -365,25 +365,35 @@ typedef struct _KPROCESS
LIST_ENTRY ProfileListHead; LIST_ENTRY ProfileListHead;
ULONG_PTR DirectoryTable[2]; ULONG_PTR DirectoryTable[2];
USHORT IopmOffset; USHORT IopmOffset;
UCHAR Iopl;
VOLATILE KAFFINITY ActiveProcessors; VOLATILE KAFFINITY ActiveProcessors;
ULONG KernelTime;
ULONG UserTime;
LIST_ENTRY ReadyListHead; LIST_ENTRY ReadyListHead;
SINGLE_LIST_ENTRY SwapListEntry;
PVOID VdmTrapHandler;
LIST_ENTRY ThreadListHead; LIST_ENTRY ThreadListHead;
KSPIN_LOCK ProcessLock;
KAFFINITY Affinity; KAFFINITY Affinity;
union union
{ {
struct struct
{ {
LONG AutoAlignment:1; BOOLEAN AutoAlignment;
LONG DisableBoost:1; BOOLEAN DisableBoost;
LONG DisableQuantum:1; BOOLEAN DisableQuantum;
LONG ReservedFlags:29; LONG ReservedFlags:29;
}; };
LONG ProcessFlags; LONG ProcessFlags;
}; };
ULONG_PTR StackCount;
SCHAR BasePriority; SCHAR BasePriority;
SCHAR Quantum; SCHAR Quantum;
UCHAR State; UCHAR State;
ULONG_PTR StackCount; UCHAR ThreadSeed;
UCHAR PowerState;
UCHAR IdealNode;
UCHAR Spare;
} KPROCESS, *PKPROCESS; } KPROCESS, *PKPROCESS;
/* Thread control block structure definition */ /* Thread control block structure definition */
@ -396,7 +406,13 @@ typedef struct _KTHREAD
PVOID StackBase; PVOID StackBase;
PVOID StackLimit; PVOID StackLimit;
KSPIN_LOCK ThreadLock; KSPIN_LOCK ThreadLock;
volatile UCHAR State;
ULONG ContextSwitches;
VOLATILE UCHAR State;
UCHAR NpxState;
KRUNLEVEL WaitRunLevel;
KPROCESSOR_MODE WaitMode;
PTHREAD_ENVIRONMENT_BLOCK EnvironmentBlock;
union union
{ {
KAPC_STATE ApcState; KAPC_STATE ApcState;
@ -411,13 +427,8 @@ typedef struct _KTHREAD
}; };
}; };
KSPIN_LOCK ApcQueueLock; KSPIN_LOCK ApcQueueLock;
ULONG ContextSwitches;
LONG_PTR WaitStatus; LONG_PTR WaitStatus;
union
{
PKWAIT_BLOCK WaitBlockList; PKWAIT_BLOCK WaitBlockList;
PKGATE GateObject;
};
BOOLEAN Alertable; BOOLEAN Alertable;
BOOLEAN WaitNext; BOOLEAN WaitNext;
UCHAR WaitReason; UCHAR WaitReason;
@ -431,43 +442,62 @@ typedef struct _KTHREAD
SINGLE_LIST_ENTRY SwapListEntry; SINGLE_LIST_ENTRY SwapListEntry;
}; };
PKQUEUE Queue; PKQUEUE Queue;
CHAR PreviousMode; ULONG WaitTime;
union
{
struct
{
SHORT KernelApcDisable;
SHORT SpecialApcDisable; SHORT SpecialApcDisable;
PTHREAD_ENVIRONMENT_BLOCK EnvironmentBlock; };
union ULONG CombinedApcDisable;
{ };
KTIMER Timer; KTIMER Timer;
struct
{
UCHAR TimerFill[KTIMER_LENGTH];
union
{
struct
{
LONG AutoAlignment:1;
LONG DisableBoost:1;
LONG ReservedFlags:30;
};
LONG ThreadFlags;
};
};
};
KWAIT_BLOCK WaitBlock[KTHREAD_WAIT_BLOCK + 1]; KWAIT_BLOCK WaitBlock[KTHREAD_WAIT_BLOCK + 1];
UCHAR NpxState;
KRUNLEVEL WaitRunLevel;
LIST_ENTRY QueueListEntry; LIST_ENTRY QueueListEntry;
PKTRAP_FRAME TrapFrame;
PVOID CallbackStack;
PVOID ServiceTable;
ULONG KernelLimit;
UCHAR ApcStateIndex; UCHAR ApcStateIndex;
BOOLEAN StackResident; BOOLEAN Preempted;
BOOLEAN ProcessReadyQueue;
BOOLEAN KernelStackResident;
CHAR Saturation;
UCHAR IdealProcessor;
SCHAR BasePriority;
UCHAR Spare4;
SCHAR PriorityDecrement;
SCHAR Quantum;
BOOLEAN SystemAffinityActive;
CHAR PreviousMode;
UCHAR ResourceIndex;
UCHAR DisableBoost;
KAFFINITY UserAffinity;
PKPROCESS Process; PKPROCESS Process;
KAFFINITY Affinity; KAFFINITY Affinity;
PVOID ServiceTable;
PKAPC_STATE ApcStatePointer[2]; PKAPC_STATE ApcStatePointer[2];
KAPC_STATE SavedApcState; KAPC_STATE SavedApcState;
PVOID CallbackStack;
PVOID SubSystemThread;
PKTRAP_FRAME TrapFrame;
ULONG KernelTime;
ULONG UserTime;
KAPC SuspendApc; KAPC SuspendApc;
KSEMAPHORE SuspendSemaphore; KSEMAPHORE SuspendSemaphore;
PVOID TlsArray;
PVOID LegoData;
LIST_ENTRY ThreadListEntry;
UCHAR LargeStack;
UCHAR PowerState;
UCHAR NpxIrql;
UCHAR Spare5;
BOOLEAN AutoAlignment;
UCHAR Iopl;
CCHAR FreezeCount;
CCHAR SuspendCount;
UCHAR Spare0[1];
UCHAR UserIdealProcessor;
UCHAR Spare2[3];
ULONG KernelLimit;
BOOLEAN StackResident;
} KTHREAD, *PKTHREAD; } KTHREAD, *PKTHREAD;
#endif /* __XTDK_KEFUNCS_H */ #endif /* __XTDK_KEFUNCS_H */