Who is the parent? (IRP_MJ_INTERNAL_DEVICE_CONTROL)
- From: Dukkov@xxxxxxxxx
- Date: 28 Jan 2006 06:36:59 -0800
Hi All,
I am using USBBuildVendorRequest to format an URB and then send the URB
to the bus driver. In case of XP this will be generic parent driver,
for Win2K this is usbhub.sys.
I am sending these urbs successfuly if I am inside a function driver.
The parent driver for a function drivers is the generic parent/bus
driver.
It happens that I cannot modify officially the function driver code and
I have to use the driver as it is. I am implementing an upper function
filer driver. Using the same mechanism for sending urbs my code into
the filter's custom IOCTL handler looks like this:
// Create the URB
urb = (PURB)ExAllocatePool(NonPagedPool, sizeof(struct
_URB_CONTROL_VENDOR_OR_CLASS_REQUEST));
UsbBuildVendorRequest(
urb,
URB_FUNCTION_VENDOR_DEVICE, sizeof(struct
_URB_CONTROL_VENDOR_OR_CLASS_REQUEST),
0,
0,
0,
0,
0,
IoBuffer,
NULL,
InputBufferLength,
NULL);
// use the original irp as an internal device control irp
nextStack = IoGetNextIrpStackLocation(Irp);
nextStack->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL;
nextStack->Parameters.Others.Argument1 = (PVOID) urb;
nextStack->Parameters.DeviceIoControl.IoControlCode =
IOCTL_INTERNAL_USB_SUBMIT_URB;
....
ntStatus=IoCallDriver(deviceExtension->TopOfStackDeviceObject, Irp);
My question is if this internal IOCTL will ever reach the generic
parent/bus driver?
Is this a general mechanism to talk to the generic parent/bus driver
from any place in the device stack above these driver - say upper
function filter, function, lower function filter drivers?
What if I place my driver as a lower function filter driver - in this
case it will be nearer to the generic parent/bus driver?
Thanks in advance!
Dim
.
- Follow-Ups:
- Re: Who is the parent? (IRP_MJ_INTERNAL_DEVICE_CONTROL)
- From: Doron Holan [MS]
- Re: Who is the parent? (IRP_MJ_INTERNAL_DEVICE_CONTROL)
- Prev by Date: Re: How to check if a spin lock has been freed or released?
- Next by Date: Re: How to check if a spin lock has been freed or released?
- Previous by thread: Re: Is any difference between CL/LINK in SDK and that in DDK?
- Next by thread: Re: Who is the parent? (IRP_MJ_INTERNAL_DEVICE_CONTROL)
- Index(es):
Relevant Pages
|