Accessing Irp->UserBuffer from a work item.

I’m writing a HID minidriver, where I need to access Irp->UserBuffer in servicing the internal IOCTL_HID_GET_FEATURE. In addition I need to block before I can complete this request.

If I could get an assurance that I will always get called at PASSIVE_LEVEL, I’d block and that would be it. But I’m told I cannot make the assumption about IRQL.

Then, I’d have to capture the input buffer, wait for the h/w event in my work item, but then I’m out of luck accessing the output buffer in the original user thread.

Appriciate any thoughts on this.

massoud

>IOCTL_HID_GET_FEATURE

#define HID_OUT_CTL_CODE(id) \
CTL_CODE(FILE_DEVICE_KEYBOARD, (id), METHOD_OUT_DIRECT, FILE_ANY_ACCESS)

#define IOCTL_HID_GET_FEATURE HID_OUT_CTL_CODE(100)

Use ->MdlAddress or ->AssociatedIrp.SystemBuffer instead.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

Maxim,

This is great help. DDK samples are coded as if this is a METHOD_NEITHER. But if I can use
AssociatedIrp.SystemBuffer for input and MdlAddress for output in any context, that would cover all cases for me.

thanks again,
massoud