WIPIVERSE All articles

Windows Native API

The Native API is a lightweight application programming interface (API) used by Windows NT's kernel and user-mode applications. It is primarily implemented in the kernel-mode module ntoskrnl.exe and exposed to user mode through the dynamic-link library ntdll.dll. This API is used in the early stages of the Windows NT startup process, when other components and APIs (such as the Win32 API) are not yet available. Consequently, certain Windows components, such as the Client/Server Runtime Subsystem (CSRSS), are implemented using the Native API. The Native API is also used internally by subroutines in kernel32.dll and other libraries that implement the higher-level Windows API.

Architecture

Native API calls are handled by the kernel via the System Service Descriptor Table (SSDT). The entry point of ntdll.dll is LdrInitializeThunk. Most of the Native API is undocumented by Microsoft; only about 25 of its roughly 250 functions are described in the Windows NT Device Driver Kit (DDK). The remainder is known primarily through reverse engineering and community documentation efforts.

Function Groups

Native API routines are conventionally named with two- or three-letter prefixes:

  • Nt and Zw — System calls declared in ntdll.dll and ntoskrnl.exe. In user mode, both groups behave nearly identically: they execute an interrupt into kernel mode and call the equivalent function in ntoskrnl.exe via the SSDT. In kernel mode, the Zw variants ensure proper kernel-mode semantics, whereas the Nt variants do not. The "Zw" prefix does not stand for anything specific.
  • Rtl — The second largest group of ntdll calls, comprising extended C Run-Time Library functions (e.g., memory manipulation, string handling) that do not directly involve kernel support.
  • Csr — Client-server functions used to communicate with the Win32 subsystem process (csrss.exe).
  • Dbg — Debugging functions, including software breakpoints.
  • Ki — Upcalls from kernel mode for events such as asynchronous procedure call (APC) dispatching.
  • Ldr — Loader functions for Portable Executable (PE) file handling and process startup.
  • Nls — National Language Support functions (code page handling).
  • Pfx — Prefix handling functions.
  • Tp — Thread pool handling functions.

Additionally, functions with the NtUser and NtGdi prefixes (e.g., NtUserLockWorkStation, NtGdiEnableEudc) are system calls handled by win32k.sys (the kernel-mode graphics driver) rather than ntoskrnl.exe, and are declared in user32.dll and gdi32.dll.

Uses

Notable uses of Native API functions include:

  • Enabling and disabling privileges (RtlAdjustPrivilege)
  • Creating remote threads in processes running in different sessions (RtlCreateUserThread)
  • Running native applications (RtlCreateUserProcess)
  • Performing a forced system shutdown (NtShutdownSystem)
  • Causing a blue screen of death (BSOD) from user mode (NtRaiseHardError)
  • Displaying a string in native mode (NtDisplayString)

Documentation Status

The Native API is largely undocumented by Microsoft. Community-driven documentation projects, such as the "Undocumented NT" website and the NtDoc project, have cataloged and described the majority of these functions through reverse engineering. The API is of particular interest to security researchers, malware analysts, and developers working on low-level Windows system utilities.

Browse

More topics to explore

    Browse all articles