After some thoughts I remember that I have written a WDM lower disk class driver in which I used the filter read and write callbacks.
From the irp you can get the databuffer and from there you can get SRB headers.
For KMDF, you need to use the internal device IO control.
Thanks,
Rajib
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Ghosal, Rajib
Sent: Friday, January 11, 2013 4:06 PM
To: Windows System Software Devs Interest List
Subject: RE: RE:[ntdev] Storage filter driver to intercept SRBs
You want to use the second way if you are writing lower disk class filter. That is how I am writing mine.
If you are using KMDF, then the example from http://www.osronline.com/article.cfm?article=446 is extremely helpful.
In WDF, the internal device control is defined as SCSI request. In wdm.h you can get the define as follow:
//
// Make the Scsi major code the same as internal device control.
//
#define IRP_MJ_SCSI IRP_MJ_INTERNAL_DEVICE_CONTROL
As a result, you will get SCSI requests in Internal device control callback.
Thanks,
Rajib
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Friday, January 11, 2013 3:24 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Storage filter driver to intercept SRBs
Hi all,
After spending some time going through some samples I have the following question:
1.) In the driver entry, when setting up the dispatch points do I need to override the IRP_MJ_SCSI major function to capture SRBs?
2.) Do i need to override IPR_MJ_WRITE and IRP_MJ_READ as well? Or do I just use the IRP_MJ_SCSI function and read the CDBs in the SRBs to determine if its a read or write request?
Thanks,
Y
NTDEV is sponsored by OSR
OSR is HIRING!! See http://www.osr.com/careers
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
NTDEV is sponsored by OSR
OSR is HIRING!! See http://www.osr.com/careers
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer