Validating context of the User mode process ?

Hi,

I am trying to communicate with my NDIS driver from an application using
the
IOCTL_NDIS_QUERY_GLOBAL_STATS method. I am handling some private OIDs in
my
QueryInformation handler.
I want to share a chunk of memory between my user mode application and the
NDIS driver. For this I am using the article “Sharing Memory Between
Drivers
and Applications” available at the OSR site for reference.

The articles describes the use of ‘MmMapLocked’, however mentions that
“you
must call the function from within the context of the process into which
you
want to map the buffer”.

My question is - How do you ensure that current context is the same as
that
of the user mode process ?
In my case (being inside the NDIS driver), I can’t guarantee that I am in
the context of user mode process.
Is there any way by which you can achieve this ?

Thanking in anticipation,

Regards,
Abhijit Mirajkar