<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://debianws.lexgopc.com/wiki143/index.php?action=history&amp;feed=atom&amp;title=Windows_Native_API</id>
	<title>Windows Native API - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://debianws.lexgopc.com/wiki143/index.php?action=history&amp;feed=atom&amp;title=Windows_Native_API"/>
	<link rel="alternate" type="text/html" href="http://debianws.lexgopc.com/wiki143/index.php?title=Windows_Native_API&amp;action=history"/>
	<updated>2026-05-01T17:40:17Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>http://debianws.lexgopc.com/wiki143/index.php?title=Windows_Native_API&amp;diff=2399175&amp;oldid=prev</id>
		<title>imported&gt;InternetArchiveBot: Rescuing 1 sources and tagging 0 as dead.) #IABot (v2.0.9.5) (Whoop whoop pull up - 22405</title>
		<link rel="alternate" type="text/html" href="http://debianws.lexgopc.com/wiki143/index.php?title=Windows_Native_API&amp;diff=2399175&amp;oldid=prev"/>
		<updated>2025-01-07T21:56:33Z</updated>

		<summary type="html">&lt;p&gt;Rescuing 1 sources and tagging 0 as dead.) #IABot (v2.0.9.5) (&lt;a href=&quot;/wiki143/index.php?title=User:Whoop_whoop_pull_up&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;User:Whoop whoop pull up (page does not exist)&quot;&gt;Whoop whoop pull up&lt;/a&gt; - 22405&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{primary sources|date=January 2018}}&lt;br /&gt;
{{notability|date=February 2022}}&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Native API&amp;#039;&amp;#039;&amp;#039; is a lightweight [[application programming interface]] (API) used by [[Windows NT]]&amp;#039;s [[Ntoskrnl.exe|kernel]] and [[user mode]] applications. This API is used in the early stages of  [[Windows NT startup process]], when other components and APIs are still unavailable. Therefore, a few Windows components, such as the [[Client/Server Runtime Subsystem]] (CSRSS), are implemented using the Native API. The Native API is also used by [[subroutine]]s such as those in [[kernel32.dll]] that implement the [[Windows API]], the API based on which most of the Windows components are created.&lt;br /&gt;
&lt;br /&gt;
Most of the Native API calls are implemented in [[ntoskrnl.exe]] and are exposed to user mode by &amp;#039;&amp;#039;&amp;#039;ntdll.dll&amp;#039;&amp;#039;&amp;#039;. The [[entry point]] of ntdll.dll is &amp;lt;code&amp;gt;LdrInitializeThunk&amp;lt;/code&amp;gt;. Native API calls are handled by the [[Windows NT kernel|kernel]] via the [[System Service Descriptor Table]] (SSDT).&lt;br /&gt;
&lt;br /&gt;
== Function groups ==&lt;br /&gt;
The Native API comprises many functions. They include [[C standard library|C runtime functions]] that are needed for a very basic [[C (programming language)|C]] runtime execution, such as strlen(), sprintf(), memcpy() and floor(). Other common procedures like malloc(), printf(), scanf() are missing (the first because it does not specify a [[Dynamic memory allocation|heap]] to allocate memory from and the second and third because they use the console, accessed only via KERNEL32.DLL). The vast majority of other Native API routines, by convention, have a 2 or 3 letter prefix, which is:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Nt&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;Zw&amp;#039;&amp;#039;&amp;#039; are [[system call]]s declared in ntdll.dll and ntoskrnl.exe. When called from ntdll.dll in user mode, these groups are almost exactly the same; they execute an [[interrupt]] into [[Ring (computer security)#Supervisor mode|kernel mode]] and call the equivalent function in ntoskrnl.exe via the [[System Service Dispatch Table|SSDT]]. When calling the functions directly in ntoskrnl.exe (only possible in kernel mode), the Zw variants ensure kernel mode, whereas the Nt variants do not.&amp;lt;ref&amp;gt;{{cite journal | author=The NT Insider | journal=OSR Online | volume=10 | issue=4 | date=August 27, 2003 | url=http://www.osronline.com/article.cfm?article=257 | title=Nt vs. Zw - Clearing Confusion On The Native API | publisher=OSR Open Systems Resources | access-date=2013-09-16 }}&amp;lt;/ref&amp;gt; The Zw prefix does not stand for anything.&amp;lt;ref name=&amp;quot;oldnewthing&amp;quot;&amp;gt;{{cite web | author=Raymond Chen | year=2009 | url=https://devblogs.microsoft.com/oldnewthing/?p=18043 | title=The Old New Thing : What does the &amp;quot;Zw&amp;quot; prefix mean? | publisher=[[Microsoft Corporation]] | access-date=2009-06-13 }}&amp;lt;/ref&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Rtl&amp;#039;&amp;#039;&amp;#039; 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&amp;#039;t directly involve kernel support.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Csr&amp;#039;&amp;#039;&amp;#039; are client-server functions that are used to communicate with the Win32 subsystem process, [[csrss.exe]] (&amp;#039;&amp;#039;csrss&amp;#039;&amp;#039; stands for client/server runtime sub-system).&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Dbg&amp;#039;&amp;#039;&amp;#039; are [[debugging]] functions such as a software [[breakpoint]].&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Ki&amp;#039;&amp;#039;&amp;#039; are upcalls from kernel mode for events like [[Asynchronous procedure call|APC]] dispatching.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Ldr&amp;#039;&amp;#039;&amp;#039; are loader functions for [[Portable Executable|PE]] file handling and starting of new processes.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Nls&amp;#039;&amp;#039;&amp;#039; for [[Internationalization and localization|National Language Support]] (similar to code pages).&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Pfx&amp;#039;&amp;#039;&amp;#039; for prefix handling.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Tp&amp;#039;&amp;#039;&amp;#039; for threadpool handling.&lt;br /&gt;
&lt;br /&gt;
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 &amp;#039;&amp;#039;&amp;#039;NtUser&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;NtGdi&amp;#039;&amp;#039;&amp;#039; prefix (e.g. &amp;#039;&amp;#039;&amp;#039;NtUserLockWorkStation&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;NtGdiEnableEudc&amp;#039;&amp;#039;&amp;#039;).&lt;br /&gt;
&lt;br /&gt;
==Uses==&lt;br /&gt;
Uses of Native API functions includes but not limited to:&lt;br /&gt;
&lt;br /&gt;
*Enabling and disabling privileges (RtlAdjustPrivilege)&lt;br /&gt;
*Creating remote threads within processes that are running in different session (RtlCreateUserThread)&lt;br /&gt;
*Running native applications (RtlCreateUserProcess)&lt;br /&gt;
*Performing a forced shutdown (NtShutdownSystem)&lt;br /&gt;
*Causing a BSOD in User mode (NtRaiseHardError)&lt;br /&gt;
*Displaying a string in Native Mode (NtDisplayString)&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[List of Microsoft Windows components]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
{{Reflist}}&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
* [https://undocumented.ntinternals.net/ A website that documents most of the Native API functions] {{Webarchive|url=https://web.archive.org/web/20171025041949/http://undocumented.ntinternals.net/ |date=2017-10-25 }}&lt;br /&gt;
* [https://technet.microsoft.com/sysinternals/bb897447.aspx Inside Native Applications]&lt;br /&gt;
* [https://web.archive.org/web/20121224002314/http://netcode.cz/img/83/nativeapi.html Inside the Native API]&lt;br /&gt;
* [http://zenwinx.sourceforge.net/ Open source native applications development framework]&lt;br /&gt;
* [http://wiki.lazarus.freepascal.org/Target_NativeNT Compiling Free Pascal programs for the native API]&lt;br /&gt;
* [https://sourceforge.net/projects/nativetools/ Windows NT Native Tools - A free native applications development util]&lt;br /&gt;
* [http://hex.pp.ua/nt-native-applications-shell-eng.php Native shell - Windows command prompt which can start before Winlogon and Win32 subsystem] {{Webarchive|url=https://web.archive.org/web/20150811102814/http://hex.pp.ua/nt-native-applications-shell-eng.php |date=2015-08-11 }}&lt;br /&gt;
&lt;br /&gt;
{{Microsoft APIs}}&lt;br /&gt;
{{Microsoft Windows components}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Microsoft application programming interfaces]]&lt;br /&gt;
[[Category:Operating system APIs]]&lt;br /&gt;
[[Category:Windows NT kernel]]&lt;/div&gt;</summary>
		<author><name>imported&gt;InternetArchiveBot</name></author>
	</entry>
</feed>