Re: determining process context

Tech-Archive recommends: Fix windows errors by optimizing your registry



Does that mean, when it runs under system process context it is
essentially same "Application" process context by which this dispatch
routine is called?
Reason of this question is, I need to access buffer pointer from IRP
which has User virtual address and in order to access that, i need to
be in same process context else i will corrupt some memory.
So am i doing it correctly by running PsCreateSystemThread in system
process context ? if not, what do I need to do to achieve this?

- David



cristalink wrote:
> >> Is my Thread running in the same process context where Irp buffer belongs
>
> PsCreateSystemThread has nothing to do with IRPs. The process context of the
> created thread depends on the 4th parameter of PsCreateSystemThread. As per
> DDK documentation, you should use NULL for the 4th parameter. If you do,
> then the thread will run in the system process context.
> --
> http://www.cristalink.com
>
>
> "David" <know_devig@xxxxxxxxxxx> wrote in message
> news:1122086162.688945.164730@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> > Hi,
> > I am developing WDM driver and curious about process context.
> >
> > 1) My Application calls DeviceIoControl.
> > 2) My Driver's Dispatch routine gets invoked, in this routine I start
> > thread using PsCreateSystemThread. ( Which waits on syncronization
> > objects)
> > 3) Once Interrupt (or synchronization event) happens, this thread
> > wakes up and start processing pending IRP.
> >
> > So question is ->
> > 1) Is my Thread running in the same process context where Irp buffer
> > belongs? Because I need to lock the buffer and write some data to it,
> > (I am using METHODE_NEITHER)
> >
> > Thanks,
> > David
> >

.



Relevant Pages

  • Re: determining process context
    ... when it runs under system process context it is ... > essentially same "Application" process context by which this dispatch ... > routine is called? ... Don Burn (MVP, Windows DDK) ...
    (microsoft.public.development.device.drivers)
  • Re: METHOD_OUT_DIRECT and MmGetSystemAddressForMdlSafe
    ... There is no requirement to be in the process context. ... routine and processed later by a kernel worker thread, ... the calling process? ...
    (microsoft.public.development.device.drivers)
  • Re: context of irp_mj_close
    ... IRP_MJ_CLOSE is sent when a last reference to FILE_OBJECT is closed. ... each IRP originating from user ... process context. ... > the context of this process object. ...
    (microsoft.public.development.device.drivers)