Well sure. Search the ntinsider archives for ‘roll your own irps’.
=====================
Mark Roddy
-----Original Message-----
From: Leonid Meyerovich [mailto:xxxxx@v-one.com]
Sent: Thursday, October 09, 2003 2:09 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Re: Problem manually creating IRP to submit
from one driver to anotherOf course it’s better to use IoBuildDeviceIoControlRequest,
but in case it’s necessary to preallocate IRP’s pool is there
any other way than to call
ExAllocatePoolWithTag() and then IoInitializeIrp()?
I this case IRP has to be initialized manually.Leonid
----- Original Message -----
From: “Roddy, Mark”
> To: “Windows System Software Devs Interest List”
> Sent: Thursday, October 09, 2003 12:46 PM
> Subject: [ntdev] Re: Problem manually creating IRP to submit
> from one driver to another
>
>
> > I think the cleanup is a red herring. This is just an
> artifact of how
> > IoGetDeviceObjectPointer works: it closes the handle after
> > incrementing
> the
> > reference count on the file object, thus provoking the
> cleanup but not
> > the close before he gets to do IO. This should (obviously
> or NT is way
> broken,)
> > not cause a problem, unless the target driver is doing something
> > totally wrong on a cleanup.
> >
> > His problem, AFAICT, is that he is not using
> > IoBuildDeviceIoControlRequest and has thus most likely
> screwed up the
> > construction of the IRP, causing a null pointer reference in the
> > target driver.
> >
> >
> > =====================
> > Mark Roddy
> >
> >
> > > -----Original Message-----
> > > From: James Antognini [mailto:xxxxx@mindspring.nospam.com]
> > > Sent: Thursday, October 09, 2003 12:30 PM
> > > To: Windows System Software Devs Interest List
> > > Subject: [ntdev] Re: Problem manually creating IRP to submit from
> > > one driver to another
> > >
> > >
> > > Without having tried this sort of thing myself, I would guess the
> > > “weird” thing is due to IoGetDeviceObjectPointer() doing,
> in effect,
> > > open on the called device object.
> > >
> > > As for your real problem, I suggest looking at the DDK,
> where there
> > > are lots of examples of IoGetDeviceObjectPointer. Then I
> would look
> > > at an IOCTL Irp produced by a user-space call and an Irp that you
> > > build.
> > >
> > > David West wrote:
> > >
> > > > Oh, and one other weird thing I observe about this problem.
> > > After the
> > > > calling driver calls IoGetDeviceObjectPointer, the driver
> > > being called
> > > > receives an IRP_MJ_CREATE, followed immediately by an
> > > IRP_MJ_CLEANUP.
> > > > Only later does it receive the IRP_MJ_INTERNAL_DEVICE_CONTROL
> > > > after the calling driver calls IoCallDriver. During processing
> > > of this IRP,
> > > > the called driver crashes while calling the IoCompleteRequest
> > > > function. In the user mode application, I notice the
> called driver
> > > > receives the IRPs in the different order IRP_MJ_CREATE,
> > > > IRP_MJ_INTERNAL_DEVICE_CONTROL, IRP_MJ_CLEANUP, IRP_MJ_CLOSE.
> > >
> > > –
> > > If replying by e-mail, please remove “nospam.” from the address.
> > >
> > > James Antognini
> > > Windows DDK MVP
> > >
> > >
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@stratus.com To
> > unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@v-one.com To
> > unsubscribe send a blank email to xxxxx@lists.osr.com
> >
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@stratus.com To
unsubscribe send a blank email to xxxxx@lists.osr.com