Hi All,
I have a KMDF volume class upper filter driver (for change block tracking) that is writing some information to the volume at system shutdown time (using volume offsets of a known file). The offset is saved in registry. Now, when the system is booting, I want to read at the known offset. This approach has been suggested in some earlier discussions like this one :
http://www.osronline.com/showThread.cfm?link=270963
Although the above link also says that “I was able to read volume blockwise in EVT_WDF_DEVICE_PREPARE_HARDWARE”, I am not able to do so and further, from other responses on the same thread, it seems that is not possible anyway. (To be more elaborate, issuing reads on the volume using WdfIoTargetSendReadSynchronously() returns STATUS_NO_SUCH_DEVICE in EvtDriverDeviceAdd and returns STATUS_DEVICE_OFF_LINE in EvtDevicePrepareHardware)
So, in KMDF, since the framework handles IRP_MN_START_DEVICE with a sequence of callbacks, how do I hook my driver into the completion callback ? Do I need to call WdfDeviceInitAssignWdmIrpPreprocessCallback() and set a completion routine ?
On some other discussions for achieving what I am trying to, I also see suggestions to do the processing of persisted data when the first IO operation on the filtered device is received. This leads to queuing the work to another thread or queuing a workitem (since EvtIoWrite() is called at <= DISPATCH) and the driver has to be ready to track writes that happen before the decision on whether to continue tracking the changes on the volume across reboot can be taken
Can you please suggest if I should still pursue IRP_MN_START_DEVICE path (and if so, how) or should I switch over to the other approach as IRP_MN_START_DEVICE is not the correct way ?
Thanks,
Anand.