0

I'm writing a driver that listens for requests on specific devices by registering for EvtIoDeviceControl.

DF_IO_QUEUE_CONFIG_INIT_DEFAULT_QUEUE(&IoCallbacks, WdfIoQueueDispatchParallel);
IoCallbacks.PowerManaged = WdfFalse;
IoCallbacks.EvtIoDeviceControl = EvtIoDeviceControlCallback;

On Windows 10 (KMDF 1.21), I can use WdfRequestGetRequestorProcessId to get the process ID of the process that made the request in the EvtIoDeviceControlCallback, but I'm having trouble finding a way to do this one earlier versions of KMDF. Any insight?

ImDevinC
  • 508
  • 1
  • 4
  • 18

1 Answers1

1

you can use WdfRequestWdmGetIrp (Minimum KMDF version 1.0) and IoGetRequestorProcessId

so simply use

ULONG WdfRequestGetRequestorProcessId_1_0(WDFREQUEST Request)
{
    return IoGetRequestorProcessId(WdfRequestWdmGetIrp(Request));
}
RbMm
  • 31,280
  • 3
  • 35
  • 56