Windows API Reference: Kernel Base

The Kernel-Base API contains fundamental functions for accessing and managing the Windows kernel. These functions provide core operating system services for processes, threads, memory management, and inter-process communication.

Core Concepts

Understanding the Kernel-Base API involves grasping concepts such as:

Key Functions

Process Management

CreateProcessA

BOOL CreateProcessA(
  LPCSTR lpApplicationName,
  LPSTR lpCommandLine,
  LPSECURITY_ATTRIBUTES lpProcessAttributes,
  LPSECURITY_ATTRIBUTES lpThreadAttributes,
  BOOL bInheritHandles,
  DWORD dwCreationFlags,
  LPVOID lpEnvironment,
  LPCSTR lpCurrentDirectory,
  LPSTARTUPINFOA lpStartupInfo,
  LPPROCESS_INFORMATION lpProcessInformation
);
Creates a new process and its primary thread. The new process runs in the security context of the calling process.
Parameters:
Return Value:
See Also: ExitProcess, TerminateProcess

GetCurrentProcessId

DWORD GetCurrentProcessId(void);
Retrieves the identifier of the current process. This identifier is unique among all processes running on the system.
Return Value:
See Also: GetCurrentProcess, GetCurrentThreadId

Memory Management

VirtualAlloc

LPVOID VirtualAlloc(
  LPVOID lpAddress,
  SIZE_T dwSize,
  DWORD flAllocationType,
  DWORD flProtect
);
Reserves, commits, or changes the state of a region of pages in the virtual address space of the calling process.
Parameters:
Return Value:
See Also: VirtualFree, VirtualAllocEx

Synchronization Objects

CreateMutexA

HANDLE CreateMutexA(
  LPSECURITY_ATTRIBUTES lpMutexAttributes,
  BOOL bInitialOwner,
  LPCSTR lpName
);
Creates or opens a mutex object. A mutex is a synchronization object that can be used to protect shared resources from simultaneous access by multiple threads.
Parameters:
Return Value:
See Also: ReleaseMutex, OpenMutex