Windows Native API
The topic of this article may not meet Wikipedia's general notability guideline. (February 2022) |
The Native API is a lightweight
Most of the Native API calls are implemented in
Function groups
The Native API comprises many functions. They include
- Nt or Zw are
- Rtl is the second largest group of ntdll calls. These comprise the (extended) C Run-Time Library, which includes many utility functions that can be used by native applications, yet don't directly involve kernel support.
- Csr are client-server functions that are used to communicate with the Win32 subsystem process, csrss.exe(csrss stands for client/server runtime sub-system).
- Dbg are debugging functions such as a software breakpoint.
- Ki are upcalls from kernel mode for events like APC dispatching.
- Ldr are loader functions for PE file handling and starting of new processes.
- Nls for National Language Support (similar to code pages).
- Pfx for prefix handling.
- Tp for threadpool handling.
user32.dll and gdi32.dll include several other calls that execute an interrupt into kernel mode. These were not part of the original Windows NT design, as can be seen in Windows NT 3.5. However, due to performance issues of hardware of that age, it was decided to move the graphics subsystem into kernel mode. As such, system call in the range of 0x1000-0x1FFF are satisfied by win32k.sys (instead of ntoskrnl.exe as done for 0-0x0FFF), and are declared in user32.dll and gdi32.dll. These functions have the NtUser and NtGdi prefix (e.g. NtUserLockWorkStation and NtGdiEnableEudc).
Uses
Uses of Native API functions includes but not limited to:
- Enabling and disabling privileges (RtlAdjustPrivilege)
- Creating remote thread within processes that are running in different session (RtlCreateUserThread)
- Running native application (RtlCreateUserProcess)
- Performing force shutdown (NtShutdownSystem)
- Cause a BSOD in User mode (NtRaiseHardError)
- Display a string in Native Mode (NtDisplayString)
See also
References
- ^ The NT Insider (August 27, 2003). "Nt vs. Zw - Clearing Confusion On The Native API". OSR Online. 10 (4). OSR Open Systems Resources. Retrieved 2013-09-16.
- Microsoft Corporation. Retrieved 2009-06-13.
External links
- A website that documents most of the Native API functions
- Inside Native Applications
- Inside the Native API
- Open source native applications development framework
- Compiling Free Pascal programs for the native API
- Windows NT Native Tools - A free native applications development util
- Native shell - Windows command prompt which can start before Winlogon and Win32 subsystem Archived 2015-08-11 at the Wayback Machine