how to get the FileObject by a specified DeviceObject value?

Hi,
I am writing a wdm device driver. this device is attached to a usb device
and can be enumed normally. I must allocate an irp and pass it to the lower
usb device. Maybe it is very easy. but I don’t know how to fill the
FileObject by the specified DeviceObject val. Is it possible? if I must call
iogetdeivcepointer to get the FileObject? Thanks a lot.

You only need a fileobject if the driver you are filtering requires a
fileobject in the IRP. If the driver you are filtering does expect a
fileobject, you need to open one yourself. IoGetDeviceObjectPointer
will work, you will have to open the device after start device
completes; if you know the device interface GUID for the device in
question, register for interface arrivals on that GUID and open it up in
the notification callback.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of armtech@zj.com
Sent: Friday, November 04, 2005 4:27 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] how to get the FileObject by a specified DeviceObject
value?

Hi,
I am writing a wdm device driver. this device is attached to a usb
device
and can be enumed normally. I must allocate an irp and pass it to the
lower
usb device. Maybe it is very easy. but I don’t know how to fill the
FileObject by the specified DeviceObject val. Is it possible? if I must
call
iogetdeivcepointer to get the FileObject? Thanks a lot.


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com