- How to get Thread ID in the driver dispatch function.
- Posted by raj on March 1st, 2005
Hi,
I have two questions which are given below.
How to find out the thread ID inside any dispatch function of a
Top-level driver (ex- file system driver).
How can I find out the thread ID inside any dispatch function of a
low-level driver? As all dispatch function of the low-level driver are
called in the arbitrary thread context.
For the both above question I am interested in the ID of original
thread how has make the request.
- Posted by Mark Roddy on March 1st, 2005
raj wrote:
You can't in a dependable way. A lower level driver that is being called
in an arbitrary thread context has no access to thread specific
information. You have to rethink your requirements or your design.
--
=====================
Mark Roddy DDK MVP
Windows 2003/XP/2000 Consulting
Hollis Technology Solutions 603-321-1032
www.hollistech.com
- Posted by Steve on March 2nd, 2005
Firstly, your dispatch functions may be get called in the
context of a system thread. However, if you are working
with certain types of highest or high level drivers
you'll probably find that the majority of calls happen in
the context of the calling usermode app. Use ...
PsGetCurrentProcessId();
PsGetCurrentThreadId();
There is also a function that tells you information about
the originator of an irp but I've forgotten what its
called.
Steve
- Posted by Bajamani on March 2nd, 2005
Is it IoGetRequestorProcessId?
...Mani
- Posted by Mark Cariddi on March 2nd, 2005
There is a ThreadId in the Tail section of the IRP that indicates which
thread this IRP was created for.
--
Mark Cariddi
Consulting Associate
OSR, Open Systems Resources, Inc.
http://www.osr.com/
"raj" <raj_patil27@hotmail.com> wrote in message
news:1109676457.140696.176960@o13g2000cwo.googlegr oups.com...