Thanks for the response and is very informative.
What we are trying to do is , do not know sure if there could be a problem here. Please comment, if someone sees a problem in this.
For our testing user/we will reserve one disk and I believe no other system process will write to a secondary disk unless specifically asked
to do it. I hope, I am correct.
In IRP_MJ_READ and IRP_MJ_WRITE we will check for if (deviceExtension && deviceExtension->DiskNumber == 3 ) and do the
IoCompleteRequest(Irp, IO_NO_INCREMENT);
This check will done based on Requested status ,which will be a global variable that will set prior to the read/write request using the DeviceIoControl request
and will be reseted after the IoCompleteRequest is done in the read/write request.
Will this be OK. Can someone comment and do I need to be cautious about something while doing this.
Thanks and Regards
Deepak
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com]On Behalf Of Mats PETERSSON
Sent: Friday, December 03, 2004 3:15 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] How to track just my read/write request in my filter driver (Unsigned Mail)
I don’t think it’s that trivial. You could try to look at the current process when looking at the IRP, but what happens if the current thread is switched out between your call to write and the IRP being processed.
Say for instance that the file-system driver decides to cache (or queue) your write so that another process is running when your IRP is being processed, for some reason. It’s highly likely that this will happen in the system. This has been discussed many times when trying to detect what application is running in a anti-virus application for instance.
Since your filter is at the SCSI-layer, it will not even have the luxury of seeing the file-system level call, but the actuall call to the SCSI IRP, which means that it’s been split up, merged and massaged by the file-system driver first, which definitely means that the single request you sent in, may have been split up, queued, re-arranged or merged with some other request. You don’t know which of these options the file-system chooses to use, but you can be almost sure that some of it will happen. Not much you can do about it either…
Unless of course, your app opens the DISK itself, rather than a file on the disk. If you’re using the disk as a RAW device, you’d probably be sending the IRP straight to the SCSI-device stack. But then you’d also need to own the device exclusively, and thus you’d KNOW that it’s your IRP when it comes in, as your app is the EXCLUSIVE owner of the device.
But I could have misunderstood this, and others may have different ideas…
–
Mats
xxxxx@lists.osr.com wrote on 12/03/2004 10:12:58 AM:
Thanks.
>>And on that level, how do you filter JUST YOUR requests ?
That is what I would like to know, is it possible and how? Some way
like idendify the
process id of my process within the filter and then tracking…Not
very sure how??..
Thanks and Regards
Deepak
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Else Kluger
Sent: Friday, December 03, 2004 1:26 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] How to track just my read/write request in my
filter driver (Unsigned Mail)
Hi,
aren’t IRPs_MJ_READ/WRITE the ones you need to monitor ?
And on that level, how do you filter JUST YOUR requests ?
Else
|---------±-------------------------------->
| | “Kotian, Deepak” |
| | > | | om> |
> | | Sent by: |
> | | bounce-195153-16691@li|
> | | sts.osr.com |
> | | |
> | | |
> | | 12/03/2004 08:28 AM |
> | | Please respond to |
> | | “Windows System |
> | | Software Devs Interest|
> | | List” |
> |---------±-------------------------------->
>
> >-----------------------------------------------------------------------------------------------------------
> |
> | |
> | To: “Windows System Software Devs Interest List”
> |
> | cc: |
> | Subject: [ntdev] How to track just my read/write request
> in my filter driver (Unsigned Mail) |
>
> >-----------------------------------------------------------------------------------------------------------
> |
>
>
>
>
> Hi,
>
> I am creating a upper filter driver for SCSI disk drive. I am doing a
> read/write call from
> the user application.
>
> I wish to track just my read/write request in my filter driver. Based on
> this read/write request,
> I need to send specific error code to the user application. Basically,
> some error condition
> that is difficult to reproduce, so this filter would serve the purpose of
> testing that
> error condition, I hope. And I need to have this filter driver only for
> many other purpose.
>
> I am able to trace IOCTLs from the DeviceIoControl in my filter driver.
> But I am not
> able to trace the Read/Write routines as there are lot of requests as I
> may not be able
> to differentiate.
>
> Is there any other method to send IOCTLs to the Read/Write routines
> handler or good
> way to achieve my goal.
> Please let me know
>
> Thanks in advance
> Deepak
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
> 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@patni.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: unknown lmsubst tag argument: ‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
> ForwardSourceID:NT000085C2 —
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com