Re: How to access environment variables from KernelMode??- ?

I take it your trying to get the current directory of the active process?
Look at the PROCESS_PARAMETERS (usually at 0x20000) if the peb isn’t null.
This is assuming your in the process’s context.

Charles

----- Original Message -----
From:
To: “NT Developers Interest List”
Sent: Sunday, November 18, 2001 12:00 AM
Subject: [ntdev] How to access environment variables from KernelMode???

> Hi everyone,
>
> In my current project (ANSI C library port to NT kernel) I need to access
> the environmnet variables from KernelMode. As I’ve never did it before and

> I found nothing in DDK documentation about this I’d like to ask how can I
> do this? Any ZwXxx routines in kernel API like GetCurrentDirectory() under

> Win32?
>
> Thanks for help,
> Anton
>
> —
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


You are currently subscribed to ntdev as: xxxxx@xetron.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.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

Thank you for reply. The problem is the driver is a kernel mode DLL called
by other driver. And active process can be arbitrary at the call time. It
looks like I have to manage own environment variables list and just copy
the values from registry at C RTL startup… What do you think? In any case
nobady except me uses this -)

Anton

On 11/21/01, ““Parton, Charles W.” ” wrote:
> I take it your trying to get the current directory of the active process?
> Look at the PROCESS_PARAMETERS (usually at 0x20000) if the peb isn’t null.
> This is assuming your in the process’s context.
>
> Charles
>
>
> ----- Original Message -----
> From:
> To: “NT Developers Interest List”
> Sent: Sunday, November 18, 2001 12:00 AM
> Subject: [ntdev] How to access environment variables from KernelMode???
>
>
> > Hi everyone,
> >
> > In my current project (ANSI C library port to NT kernel) I need to access
> > the environmnet variables from KernelMode. As I’ve never did it before and
>
> > I found nothing in DDK documentation about this I’d like to ask how can I
> > do this? Any ZwXxx routines in kernel API like GetCurrentDirectory() under
>
> > Win32?
> >
> > Thanks for help,
> > Anton
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> >
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@xetron.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.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


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

Use the registry. That is the proper way to store any information an
environment would normally hold. Environment variables are by their nature
a user-mode entity and a hold-over from older operating systems.

Greg

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of
xxxxx@hotmail.com
Sent: Wednesday, November 21, 2001 5:00 PM
To: NT Developers Interest List
Subject: [ntdev] Re: How to access environment variables from
KernelMode??- ?

Thank you for reply. The problem is the driver is a kernel mode DLL called
by other driver. And active process can be arbitrary at the call time. It
looks like I have to manage own environment variables list and just copy
the values from registry at C RTL startup… What do you think? In any case
nobady except me uses this -)

Anton

On 11/21/01, ““Parton, Charles W.” ” wrote:
> I take it your trying to get the current directory of the active process?
> Look at the PROCESS_PARAMETERS (usually at 0x20000) if the peb isn’t null.
> This is assuming your in the process’s context.
>
> Charles
>
>
> ----- Original Message -----
> From:
> To: “NT Developers Interest List”
> Sent: Sunday, November 18, 2001 12:00 AM
> Subject: [ntdev] How to access environment variables from KernelMode???
>
>
> > Hi everyone,
> >
> > In my current project (ANSI C library port to NT kernel) I need to
access
> > the environmnet variables from KernelMode. As I’ve never did it before
and
>
> > I found nothing in DDK documentation about this I’d like to ask how can
I
> > do this? Any ZwXxx routines in kernel API like GetCurrentDirectory()
under
>
> > Win32?
> >
> > Thanks for help,
> > Anton
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> >
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@xetron.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
> —
> You are currently subscribed to ntdev as: xxxxx@pdq.net
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@pdq.net
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.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