I am currently converting my WDM+DriverWorks drivers to KMDF.
I have two drivers. The master driver(DeviceA) uses WDM+DriverWorks.
The slave (DeviceB) has been converted to KMDF.
DeviceA uses KLowerDevice (which embedds an IoGetDeviceObjectPointer
call) to establish the connection between DeviceA and DeviceB.
IoGetDeviceObjectPointer succeeds. DeviceA then builds a
IRP_MJ_DEVICE_CONTROL itp to communicate with DeviceB. DeviceB receives
the control code but WdfRequestGetFileObject returns NULL.
If I use an user application to send the same control code to DeviceB,
WdfRequestGetFileObject returns a valid WDFILEOBJECT.
According to the KMDF documentation, WdfRequestGetFileObject will fail
if
a) Your driver has not called WdfDeviceInitSetFileObjectConfig and
specified a WDF_FILEOBJECT_CLASS value that causes the framework to
create file objects.
>> I do call WdfDeviceInitSetFileObjectConfig in my EvtDriverDeviceAdd
callback and the call does not fail when the user application runs.
b) Another driver sent a read, write, or I/O control request to your
driver without first sending a request type of WdfRequestTypeCreate.
>> I have a trace statement in EvtDeviceFileCreate and the event is firing so DeviceA is sending the WdfRequestTypeCreate.
Thanks for the help!
Chris Grove