Re: determining process context

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



>> 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
    ... which is valid in any process context. ... your code needs to touch user data - use MmGetSystemAddressForMdlSafe. ... > wakes up and start processing pending IRP. ... > 1) Is my Thread running in the same process context where Irp buffer ...
    (microsoft.public.development.device.drivers)
  • determining process context
    ... I am developing WDM driver and curious about process context. ... My Driver's Dispatch routine gets invoked, ... wakes up and start processing pending IRP. ... Is my Thread running in the same process context where Irp buffer ...
    (microsoft.public.development.device.drivers)
  • Re: determining process context
    ... PsGetCurrentProcess, PsCreateSystemThread fails. ... Is it possible to create thread from Dispatch routine, ... Mark Roddy wrote: ... >> So how do I create thread in Current Process context? ...
    (microsoft.public.development.device.drivers)
  • Re: determining process context
    ... You have to create a thread with the correct process context, ... process handle of the current process in the DISPATCH routine, ... > But if PsCreateSystemThread doesnt put u in User context then is there ...
    (microsoft.public.development.device.drivers)