MSDN Documentation

Windows Kernel Processes

Understanding Windows Processes

A process is an instance of an executing program. It is the fundamental unit of resource allocation and execution within the Windows operating system. Each process has its own independent virtual address space, handles to system resources, and security context.

Process Structure

The Windows kernel represents a process using the Executive Process Block (EPROCESS) structure. This structure contains information about the process, including:

Process Creation

Processes are typically created using the CreateProcess API function. This function:

  1. Allocates memory for the new process's address space.
  2. Creates the primary thread for the process.
  3. Loads the executable image into the process's address space.
  4. Initializes the process environment.
  5. Returns a handle to the new process and its primary thread.

The kernel manages the creation and destruction of processes, ensuring proper resource allocation and cleanup.

Process Termination

A process can terminate in several ways:

When a process terminates, the kernel reclaims all its resources, including memory, handles, and I/O buffers.

Inter-Process Communication (IPC)

Processes can communicate with each other through various mechanisms, collectively known as Inter-Process Communication (IPC):

Important Note: Each process operates in its own isolated memory space, preventing direct memory corruption between unrelated applications. Security is a primary concern, and mechanisms like the Security Reference Monitor (SRM) ensure that processes only access resources they are authorized to use.

Kernel-Level Details

At the kernel level, process management is handled by the Object Manager and the Process Manager components. The scheduler assigns CPU time to threads within processes, and memory management ensures that each process has a contiguous view of its own virtual address space.

For more in-depth information on specific kernel structures and APIs related to process management, refer to the following: