Re: How to access environment variables from KernelMo- de??- ?

> ----------

From: xxxxx@pdq.net[SMTP:xxxxx@pdq.net]
Reply To: xxxxx@lists.osr.com
Sent: Thursday, November 22, 2001 3:32 AM
To: xxxxx@lists.osr.com
Subject: [ntdev] Re: How to access environment variables from
KernelMode??- ?

Environment variables are by their nature
a user-mode entity and a hold-over from older operating systems.

How would you want to store per-process environment in registry? No
hold-over but necessary vehicle. Note it isn’t per-application but
per-process environment. Usually, I have opened several console windows
every one with different environment (for DDK build, Platform SDK build, our
internal build and so on). Fortunately, ms developers use command line
utilities and understand the importance of environment variables :wink:

Best regards,

Michal Vodicka
STMicroelectronics Design and Application s.r.o.
[michal.vodicka@st.com, http:://www.st.com]


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Hi,

Excellent! And how PEB formatted? Can I add own entries to it? What kind
on
synchronization have I use while accesing PEB? (I think I’m not the only
one who uses it).

Thanks,
Anton

If you know the PID of the process whose environment variables you want to
read, you can call PsLookupProcessByProcessId (undocumented routine exported
by NTOSKRNL.EXE) to get a pointer to that process’s EPROCESS block. Then you
can get a pointer to the PEB and use Charles’s technique.


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com