<s>
The	O
Native	B-Application
API	I-Application
is	O
a	O
lightweight	O
application	B-Application
programming	I-Application
interface	I-Application
(	O
API	B-Application
)	O
used	O
by	O
Windows	B-Device
NT	I-Device
and	O
user	B-Operating_System
mode	I-Operating_System
applications	O
.	O
</s>
<s>
This	O
API	B-Application
is	O
used	O
in	O
the	O
early	O
stages	O
of	O
Windows	B-Operating_System
NT	I-Operating_System
startup	I-Operating_System
process	I-Operating_System
,	O
when	O
other	O
components	O
and	O
APIs	B-Application
are	O
still	O
unavailable	O
.	O
</s>
<s>
Therefore	O
,	O
a	O
few	O
Windows	B-Device
components	I-Device
,	O
such	O
as	O
the	O
Client/Server	O
Runtime	O
Subsystem	O
(	O
CSRSS	O
)	O
,	O
are	O
implemented	O
using	O
the	O
Native	B-Application
API	I-Application
.	O
</s>
<s>
The	O
Native	B-Application
API	I-Application
is	O
also	O
used	O
by	O
subroutines	O
such	O
as	O
those	O
in	O
kernel32.dll	O
that	O
implement	O
the	O
Windows	B-Library
API	I-Library
,	O
the	O
API	B-Application
based	O
on	O
which	O
most	O
of	O
the	O
Windows	B-Device
components	I-Device
are	O
created	O
.	O
</s>
<s>
Most	O
of	O
the	O
Native	B-Application
API	I-Application
calls	O
are	O
implemented	O
in	O
ntoskrnl.exe	O
and	O
are	O
exposed	O
to	O
user	B-Operating_System
mode	I-Operating_System
by	O
ntdll.dll	B-Application
.	O
</s>
<s>
The	O
entry	B-Language
point	I-Language
of	O
ntdll.dll	B-Application
is	O
LdrInitializeThunk	O
.	O
</s>
<s>
Native	B-Application
API	I-Application
calls	O
are	O
handled	O
by	O
the	O
kernel	O
via	O
the	O
System	B-Device
Service	I-Device
Descriptor	I-Device
Table	I-Device
(	O
SSDT	B-Device
)	O
.	O
</s>
<s>
The	O
Native	B-Application
API	I-Application
comprises	O
many	O
functions	O
.	O
</s>
<s>
They	O
include	O
C	B-Language
runtime	I-Language
functions	I-Language
that	O
are	O
needed	O
for	O
a	O
very	O
basic	O
C	B-Language
runtime	I-Language
execution	O
,	O
such	O
as	O
strlen( )	O
,	O
sprintf( )	O
,	O
memcpy( )	O
and	O
floor( )	O
.	O
</s>
<s>
Other	O
common	O
procedures	O
like	O
malloc( )	O
,	O
printf( )	O
,	O
scanf( )	O
are	O
missing	O
(	O
the	O
first	O
because	O
it	O
does	O
not	O
specify	O
a	O
heap	B-General_Concept
to	O
allocate	O
memory	O
from	O
and	O
the	O
second	O
and	O
third	O
because	O
they	O
use	O
the	O
console	O
,	O
accessed	O
only	O
via	O
KERNEL32.DLL	O
)	O
.	O
</s>
<s>
The	O
vast	O
majority	O
of	O
other	O
Native	B-Application
API	I-Application
routines	O
,	O
by	O
convention	O
,	O
have	O
a	O
2	O
or	O
3	O
letter	O
prefix	O
,	O
which	O
is	O
:	O
</s>
<s>
Nt	O
or	O
Zw	O
are	O
system	B-Operating_System
calls	I-Operating_System
declared	O
in	O
ntdll.dll	B-Application
and	O
ntoskrnl.exe	O
.	O
</s>
<s>
When	O
called	O
from	O
ntdll.dll	B-Application
in	O
user	B-Operating_System
mode	I-Operating_System
,	O
these	O
groups	O
are	O
almost	O
exactly	O
the	O
same	O
;	O
they	O
execute	O
an	O
interrupt	B-Application
into	O
kernel	O
mode	O
and	O
call	O
the	O
equivalent	O
function	O
in	O
ntoskrnl.exe	O
via	O
the	O
SSDT	B-Device
.	O
</s>
<s>
Rtl	O
is	O
the	O
second	O
largest	O
group	O
of	O
ntdll	B-Application
calls	O
.	O
</s>
<s>
These	O
comprise	O
the	O
(	O
extended	O
)	O
C	B-Language
Run-Time	I-Language
Library	I-Language
,	O
which	O
includes	O
many	O
utility	O
functions	O
that	O
can	O
be	O
used	O
by	O
native	O
applications	O
,	O
yet	O
do	O
n't	O
directly	O
involve	O
kernel	O
support	O
.	O
</s>
<s>
Csr	O
are	O
client-server	O
functions	O
that	O
are	O
used	O
to	O
communicate	O
with	O
the	O
Win32	B-Library
subsystem	O
process	O
,	O
csrss.exe	O
(	O
csrss	O
stands	O
for	O
client/server	O
runtime	O
sub-system	O
)	O
.	O
</s>
<s>
Ki	O
are	O
upcalls	O
from	O
kernel	O
mode	O
for	O
events	O
like	O
APC	B-Device
dispatching	O
.	O
</s>
<s>
Nls	O
for	O
National	B-General_Concept
Language	I-General_Concept
Support	I-General_Concept
(	O
similar	O
to	O
code	O
pages	O
)	O
.	O
</s>
<s>
user32.dll	O
and	O
gdi32.dll	O
include	O
several	O
other	O
calls	O
that	O
execute	O
an	O
interrupt	B-Application
into	O
kernel	O
mode	O
.	O
</s>
<s>
These	O
were	O
not	O
part	O
of	O
the	O
original	O
Windows	B-Device
NT	I-Device
design	O
,	O
as	O
can	O
be	O
seen	O
in	O
Windows	B-Device
NT	I-Device
3.5	I-Device
.	O
</s>
<s>
As	O
such	O
,	O
system	B-Operating_System
call	I-Operating_System
in	O
the	O
range	O
of	O
0x1000-0x1FFF	O
are	O
satisfied	O
by	O
win32k.sys	O
(	O
instead	O
of	O
ntoskrnl.exe	O
as	O
done	O
for	O
0-0x0FFF	O
)	O
,	O
and	O
are	O
declared	O
in	O
user32.dll	O
and	O
gdi32.dll	O
.	O
</s>
<s>
Uses	O
of	O
Native	B-Application
API	I-Application
functions	O
includes	O
but	O
not	O
limited	O
to	O
:	O
</s>
