Re: determining process context
- From: "David" <know_devig@xxxxxxxxxxx>
- Date: 23 Jul 2005 22:37:33 -0700
Hi Mark,
Thats what I tried. but when I pass handle parameter obtained by
PsGetCurrentProcess(), PsCreateSystemThread fails.
So my question is,
Is it possible to create thread from Dispatch routine, which will run
in same context as dispatch routine i.e. user-context.
If yes, is it some different way than I tried?
- David
Mark Roddy wrote:
> David wrote:
> > Hi Don,
> > I tried to get the Process context in dispatch routine using
> > PsGetCurrentProcess and tried to supply this argument to my
> > PsCreateSystemThread but when I do this, it DOESNT create Thread AT
> > ALL.
> > If I change that process handle parameter to (HANDLE)0 , it creates the
> > thread (which must be in System Context).
> >
> > So how do I create thread in Current Process context?
> >
>
> Read the docs for PsCreateSystemThread. The handle parameter allows you
> to create the thread in the process context specified by the handle
> rather than the default, which is the system process. The other
> alternative is, as noted earler, to use KeStackAttachProcess.
>
> You have however been warned that there are issues and complications and
> edge cases and essentially here be dragons. Good luck.
>
>
> --
>
> =====================
> Mark Roddy DDK MVP
> Windows 2003/XP/2000 Consulting
> Hollis Technology Solutions 603-321-1032
> www.hollistech.com
>
>
> > - David
> >
> > Doron Holan [MS] wrote:
> >
> >>you can create a transaction object and add buffers to it with individual
> >>IOCTL calls. in the end, you should map the buffers into kernel space in
> >>the dispatch routine and then hand them off to the thread. getting the
> >>thread back into the process context is not easy, do all the process context
> >>specific actions in your dispatch code.
> >>
> >>d
> >>
> >>--
> >>Please do not send e-mail directly to this alias. this alias is for
> >>newsgroup purposes only.
> >>This posting is provided "AS IS" with no warranties, and confers no rights.
> >>
> >>
> >>"David" <know_devig@xxxxxxxxxxx> wrote in message
> >>news:1122099724.982502.35280@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> >>
> >>>Hi Doron,
> >>> My application requirement is passing multiple buffers to the
> >>>kernel so I cannot use buffered or direct method because it will be
> >>>locked,
> >>>we want to lock the buffers only when device requests it for DMA.
> >>>Alternative approach is call-back events but performance wise passing
> >>>buffers to kernel will be efficient. Thats why we are using neither
> >>>method so we can lock the buffer only when required.
> >>>
> >
> >
.
- Follow-Ups:
- Re: determining process context
- From: Alexander Grigoriev
- Re: determining process context
- References:
- determining process context
- From: David
- Re: determining process context
- From: Doron Holan [MS]
- Re: determining process context
- From: David
- Re: determining process context
- From: Doron Holan [MS]
- Re: determining process context
- From: David
- Re: determining process context
- From: Mark Roddy
- determining process context
- Prev by Date: Re: Can windows process USB mouse data in absolute mode?
- Next by Date: Macrovision
- Previous by thread: Re: determining process context
- Next by thread: Re: determining process context
- Index(es):
Relevant Pages
|