[wdmaudiodev] Re: How to Get PID of a audio player in the audio driver

  • From: Eugene Muzychenko <emuzychenko@xxxxxxxxx>
  • To: Dennis Scott <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Tue, 6 Oct 2009 10:28:49 +0400

Hello Dennis,

> if i find a way to get the Process OR processId then i can map this
> process OR processId to SessionID.

For example, you could obtain a pointer to PsGetCurrentProcessId,
using MmGetSystemRoutineAddress. Then call PsGetCurrentProcessId at
every request from higher layers (Port driver and/or IOCTLs). In most
cases, you will get either 0 (a DPC-level call) or 4 (a system
process). But sometimes you can get a valid user-mode process ID.

Regards,
Eugene

******************

WDMAUDIODEV addresses:
Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx
Subscribe:    mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe
Unsubscribe:  mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=unsubscribe
Moderator:    mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx

URL to WDMAUDIODEV page:
http://www.wdmaudiodev.com/

Other related posts: