<s>
In	O
computing	O
the	O
Process	B-Data_Structure
Environment	I-Data_Structure
Block	I-Data_Structure
(	O
abbreviated	O
PEB	O
)	O
is	O
a	O
data	O
structure	O
in	O
the	O
Windows	B-Device
NT	I-Device
operating	O
system	O
family	O
.	O
</s>
<s>
It	O
is	O
an	O
opaque	B-General_Concept
data	I-General_Concept
structure	I-General_Concept
that	O
is	O
used	O
by	O
the	O
operating	O
system	O
internally	O
,	O
most	O
of	O
whose	O
fields	O
are	O
not	O
intended	O
for	O
use	O
by	O
anything	O
other	O
than	O
the	O
operating	O
system	O
.	O
</s>
<s>
The	O
PEB	O
contains	O
data	O
structures	O
that	O
apply	O
across	O
a	O
whole	O
process	B-Operating_System
,	O
including	O
global	O
context	O
,	O
startup	O
parameters	O
,	O
data	O
structures	O
for	O
the	O
program	O
image	O
loader	O
,	O
the	O
program	O
image	O
base	O
address	O
,	O
and	O
synchronization	O
objects	O
used	O
to	O
provide	O
mutual	B-Operating_System
exclusion	I-Operating_System
for	O
process-wide	O
data	O
structures	O
.	O
</s>
<s>
The	O
PEB	O
is	O
closely	O
associated	O
with	O
the	O
kernel	O
mode	O
data	O
structure	O
,	O
as	O
well	O
as	O
with	O
per-process	O
data	O
structures	O
managed	O
within	O
the	O
address	O
space	O
of	O
the	O
Client-Server	O
Runtime	O
Sub-System	O
process	B-Operating_System
.	O
</s>
<s>
It	O
resides	O
in	O
the	O
application	O
mode	O
address	O
space	O
of	O
the	O
process	B-Operating_System
that	O
it	O
relates	O
to	O
.	O
</s>
<s>
This	O
is	O
because	O
it	O
is	O
designed	O
to	O
be	O
used	O
by	O
the	O
application-mode	O
code	O
in	O
the	O
operating	O
system	O
libraries	O
,	O
such	O
as	O
NTDLL	B-Application
,	O
that	O
executes	O
outside	O
of	O
kernel	O
mode	O
,	O
such	O
as	O
the	O
code	O
for	O
the	O
program	O
image	O
loader	O
and	O
the	O
heap	O
manager	O
.	O
</s>
<s>
In	O
WinDbg	B-Application
,	O
the	O
command	O
that	O
dumps	O
the	O
contents	O
of	O
a	O
PEB	O
is	O
the	O
!	O
peb	O
command	O
,	O
which	O
is	O
passed	O
the	O
address	O
of	O
the	O
PEB	O
within	O
a	O
process	B-Operating_System
 '	O
application	O
address	O
space	O
.	O
</s>
<s>
That	O
information	O
,	O
in	O
turn	O
,	O
is	O
obtained	O
by	O
the	O
!	O
process	B-Operating_System
command	O
,	O
which	O
displays	O
the	O
information	O
from	O
the	O
data	O
structure	O
,	O
one	O
of	O
whose	O
fields	O
is	O
the	O
address	O
of	O
the	O
PEB	O
.	O
</s>
<s>
+	O
Fields	O
of	O
the	O
PEB	O
that	O
are	O
documented	O
by	O
Microsoft	O
Field	O
meaning	O
notes	O
BeingDebugged	O
Whether	O
the	O
process	B-Operating_System
is	O
being	O
debugged	O
Microsoft	O
recommends	O
not	O
using	O
this	O
field	O
but	O
using	O
the	O
official	O
Win32	O
CheckRemoteDebuggerPresent( )	O
library	O
function	O
instead	O
.	O
</s>
<s>
Ldr	O
A	O
pointer	O
to	O
a	O
PEB_LDR_DATA	O
structure	O
providing	O
information	O
about	O
loaded	O
modules	O
Contains	O
the	O
base	O
address	O
of	O
kernel32	O
and	O
ntdll	B-Application
.	O
</s>
<s>
ProcessParameters	O
A	O
pointer	O
to	O
a	O
RTL_USER_PROCESS_PARAMETERS	O
structure	O
providing	O
information	O
about	O
process	B-Operating_System
startup	O
parameters	O
The	O
RTL_USER_PROCESS_PARAMETERS	O
structure	O
is	O
also	O
mostly	O
opaque	O
and	O
not	O
guaranteed	O
to	O
be	O
consistent	O
across	O
multiple	O
versions	O
of	O
Windows	O
.	O
</s>
<s>
PostProcessInitRoutine	O
A	O
pointer	O
to	O
a	O
callback	O
function	O
called	O
after	O
DLL	O
initialization	O
but	O
before	O
the	O
main	O
executable	O
code	O
is	O
invoked	O
This	O
callback	O
function	O
is	O
used	O
on	O
Windows	B-Application
2000	I-Application
,	O
but	O
is	O
not	O
guaranteed	O
to	O
be	O
used	O
on	O
later	O
versions	O
of	O
Windows	B-Device
NT	I-Device
.	O
</s>
<s>
SessionId	O
The	O
session	O
ID	O
of	O
the	O
Terminal	O
Services	O
session	O
that	O
the	O
process	B-Operating_System
is	O
part	O
of	O
The	O
NtCreateUserProcess( )	O
system	O
call	O
initializes	O
this	O
by	O
calling	O
the	O
kernel	O
's	O
internal	O
MmGetSessionId( )	O
function	O
.	O
</s>
<s>
The	O
contents	O
of	O
the	O
PEB	O
are	O
initialized	O
by	O
the	O
system	O
call	O
,	O
the	O
Native	B-Application
API	I-Application
function	O
that	O
implements	O
part	O
of	O
,	O
and	O
underpins	O
,	O
the	O
Win32	O
,	O
,	O
,	O
and	O
library	O
functions	O
that	O
are	O
in	O
the	O
kernel32.dll	O
and	O
advapi32.dll	O
libraries	O
as	O
well	O
as	O
underpinning	O
the	O
fork( )	O
function	O
in	O
the	O
Windows	B-Device
NT	I-Device
POSIX	I-Device
library	O
,	O
posix.dll	O
.	O
</s>
<s>
For	O
Windows	B-Device
NT	I-Device
POSIX	I-Device
processes	O
,	O
the	O
contents	O
of	O
a	O
new	O
process	B-Operating_System
 '	O
PEB	O
are	O
initialized	O
by	O
as	O
simply	O
a	O
direct	O
copy	O
of	O
the	O
parent	O
process	B-Operating_System
 '	O
PEB	O
,	O
in	O
line	O
with	O
how	O
the	O
function	O
operates	O
.	O
</s>
<s>
For	O
Win32	O
processes	O
,	O
the	O
initial	O
contents	O
of	O
a	O
new	O
process	B-Operating_System
 '	O
PEB	O
are	O
mainly	O
taken	O
from	O
global	O
variables	O
maintained	O
within	O
the	O
kernel	O
.	O
</s>
<s>
However	O
,	O
several	O
fields	O
may	O
instead	O
be	O
taken	O
from	O
information	O
provided	O
within	O
the	O
process	B-Operating_System
 '	O
image	O
file	O
,	O
in	O
particular	O
information	O
provided	O
in	O
the	O
data	O
structure	O
within	O
the	O
PE	O
file	O
format	O
(	O
PE+	O
or	O
PE32+	O
in	O
64	O
bit	O
executable	O
images	O
)	O
.	O
</s>
<s>
The	O
WineHQ	B-Application
project	O
provides	O
a	O
fuller	O
PEB	O
definition	O
in	O
its	O
version	O
of	O
winternl.h.	O
</s>
