How to get the PID of the last running UM process within an ISR

Hi,

I require the PID (or thread ID) of the last running UM process (thread)
that was interrupted from my ISR. These PID is required within that ISR:

  1. myAppl.exe running
  2. Interrupt triggered, myAppl.exe interrupted
  3. KmDriverIsr(){
    lastPid = GetPidOfInterruptedProcess();
    }

Is there such a GetPidOfInterruptedProcess() function that the ISR could
call?
Any suggestions?

Thanks in advance!

Have a nice day,
:)Dieter

wrote in message news:xxxxx@ntdev…
>
> I require the PID (or thread ID) of the last running UM process (thread)
> that was interrupted from my ISR. These PID is required within that ISR:
>

I can’t think of any “official” approved way to do this.

On the other hand, KeGetCurrentThread() should do what you want. I realize
that the docs say you shouldn’t call this above IRQL DISPATCH_LEVEL, but I
don’t really see why…

Peter
OSR

Undocumented PsGetCurrentProcessId() should do the work. This API can be
called at any IRQL level.

----- Original Message -----
From:
To: “Windows System Software Developers Interest List”
Sent: Friday, September 05, 2003 3:15 PM
Subject: [ntdev] How to get the PID of the last running UM process within an
ISR

> Hi,
>
> I require the PID (or thread ID) of the last running UM process (thread)
> that was interrupted from my ISR. These PID is required within that ISR:
>
> 1. myAppl.exe running
> 2. Interrupt triggered, myAppl.exe interrupted
> 3. KmDriverIsr(){
> lastPid = GetPidOfInterruptedProcess();
> }
>
> Is there such a GetPidOfInterruptedProcess() function that the ISR could
> call?
> Any suggestions?
>
> Thanks in advance!
>
> Have a nice day,
> :)Dieter
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@rdsor.ro
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

KeGetCurrentThread will possibly be operable from the ISR, though the
documentation says otherwise.

The rest of the work must be done on IRQL <= DISPATCH_LEVEL, if not on
PASSIVE_LEVEL.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From:
To: “Windows System Software Developers Interest List”
Sent: Friday, September 05, 2003 4:15 PM
Subject: [ntdev] How to get the PID of the last running UM process within an
ISR

> Hi,
>
> I require the PID (or thread ID) of the last running UM process (thread)
> that was interrupted from my ISR. These PID is required within that ISR:
>
> 1. myAppl.exe running
> 2. Interrupt triggered, myAppl.exe interrupted
> 3. KmDriverIsr(){
> lastPid = GetPidOfInterruptedProcess();
> }
>
> Is there such a GetPidOfInterruptedProcess() function that the ISR could
> call?
> Any suggestions?
>
> Thanks in advance!
>
> Have a nice day,
> :)Dieter
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com

KeGetCurrentThread & PsGetCurrentProcessId can be called at any IRQL. We
will update the docs to say that.

--

-Eliyas
This posting is provided "AS IS" with no warranties, and confers no rights.

"Peter Viscarola" wrote in message news:xxxxx@ntdev...
>
>
> wrote in message news:xxxxx@ntdev...
> >
> > I require the PID (or thread ID) of the last running UM process (thread)
> > that was interrupted from my ISR. These PID is required within that ISR:
> >
>
> I can't think of any "official" approved way to do this.
>
> On the other hand, KeGetCurrentThread() should do what you want. I
realize
> that the docs say you shouldn't call this above IRQL DISPATCH_LEVEL, but I
> don't really see why...
>
> Peter
> OSR
>
>
>
>