kernel
Loading...
Searching...
No Matches
thread.c File Reference
#include "../../includes/ps.h"
#include "../../assert.h"
#include "../../includes/mg.h"
#include "../../includes/ob.h"

Go to the source code of this file.

Macros

#define MIN_TID   3u
#define MAX_TID   0xFFFFFFFCu
#define ALIGN_DELTA   3u
#define MAX_FREE_POOL   1024u
#define THREAD_STACK_SIZE   (1024*24)
#define THREAD_ALIGNMENT   16

Functions

MTSTATUS PsCreateThread (HANDLE ProcessHandle, PHANDLE ThreadHandle, ThreadEntry EntryPoint, THREAD_PARAMETER ThreadParameter, TimeSliceTicks TimeSlice, ThreadEntry MtdllEntrypoint)
MTSTATUS PsCreateSystemThread (ThreadEntry entry, THREAD_PARAMETER parameter, TimeSliceTicks TIMESLICE, _Out_Opt PETHREAD *OutThread)
PETHREAD PsGetCurrentThread (void)
MTSTATUS PsTerminateThread (IN PETHREAD Thread, IN MTSTATUS ExitStatus)
void PsDeleteThread (IN void *Object)
NORETURN void PspExitThread (IN MTSTATUS ExitStatus)

Variables

EPROCESS PsInitialSystemProcess

Macro Definition Documentation

◆ ALIGN_DELTA

#define ALIGN_DELTA   3u

Definition at line 8 of file thread.c.

◆ MAX_FREE_POOL

#define MAX_FREE_POOL   1024u

Definition at line 9 of file thread.c.

◆ MAX_TID

#define MAX_TID   0xFFFFFFFCu

Definition at line 7 of file thread.c.

◆ MIN_TID

#define MIN_TID   3u

Definition at line 6 of file thread.c.

◆ THREAD_ALIGNMENT

#define THREAD_ALIGNMENT   16

Definition at line 12 of file thread.c.

◆ THREAD_STACK_SIZE

#define THREAD_STACK_SIZE   (1024*24)

Definition at line 11 of file thread.c.

Function Documentation

◆ PsCreateSystemThread()

MTSTATUS PsCreateSystemThread ( ThreadEntry entry,
THREAD_PARAMETER parameter,
TimeSliceTicks TIMESLICE,
_Out_Opt PETHREAD * OutThread )

Definition at line 196 of file thread.c.

◆ PsCreateThread()

MTSTATUS PsCreateThread ( HANDLE ProcessHandle,
PHANDLE ThreadHandle,
ThreadEntry EntryPoint,
THREAD_PARAMETER ThreadParameter,
TimeSliceTicks TimeSlice,
ThreadEntry MtdllEntrypoint )

Definition at line 38 of file thread.c.

◆ PsDeleteThread()

void PsDeleteThread ( IN void * Object)

Definition at line 305 of file thread.c.

◆ PsGetCurrentThread()

PETHREAD PsGetCurrentThread ( void )

Definition at line 279 of file thread.c.

◆ PspExitThread()

NORETURN void PspExitThread ( IN MTSTATUS ExitStatus)

Definition at line 335 of file thread.c.

◆ PsTerminateThread()

MTSTATUS PsTerminateThread ( IN PETHREAD Thread,
IN MTSTATUS ExitStatus )

Definition at line 284 of file thread.c.

Variable Documentation

◆ PsInitialSystemProcess

EPROCESS PsInitialSystemProcess
extern

The Stack Overflow check only checks for minor overflows, that don't completely smash the stack, yet do change the canaries (since it only checks in function epilogue) Complete stack smashes are guarded with the guard page in MiCreateKernelStack.

Definition at line 165 of file kernel.c.