Re: 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

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

— “Kotian, Deepak” wrote:
> I am creating a upper filter driver for SCSI disk
> drive.

> Some way like idendify the
> process id of my process within the filter and then
> tracking…Not very sure how??..

You have no reliable way to get the process ID at that
level (filter driver for SCSI disk drive) in order to
identify writes made by your user application.

Best regards,
Razvan

__________________________________
Do you Yahoo!?
All your favorites on one personal page – Try My Yahoo!
http://my.yahoo.com

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

Deepak,

Yes, I think that would work. It’s similar to what I said in the previous
post about “Exclusive”, with the slight difference that you’re not holding
an exclusive lock to the device.

There is no reason why (after the system has settled down after boot at
least) any access from the OS unless some application is specifically
accessing that device (or files on it).


Mats

-------- Notice --------
The information in this message is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this
message by anyone else is unauthorized. If you are not the intended
recipient, any disclosure, copying or distribution of the message, or any
action taken by you in reliance on it, is prohibited and may be unlawful.
If you have received this message in error, please delete it and contact
the sender immediately. Thank you.

xxxxx@lists.osr.com wrote on 12/03/2004 02:52:54 PM:

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
> —
> 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:NT0000862E

OK, Thanks.

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 7:01 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)

Deepak,

Yes, I think that would work. It’s similar to what I said in the previous
post about “Exclusive”, with the slight difference that you’re not holding
an exclusive lock to the device.

There is no reason why (after the system has settled down after boot at
least) any access from the OS unless some application is specifically
accessing that device (or files on it).


Mats

-------- Notice --------
The information in this message is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this
message by anyone else is unauthorized. If you are not the intended
recipient, any disclosure, copying or distribution of the message, or any
action taken by you in reliance on it, is prohibited and may be unlawful.
If you have received this message in error, please delete it and contact
the sender immediately. Thank you.

xxxxx@lists.osr.com wrote on 12/03/2004 02:52:54 PM:

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
> —
> 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:NT0000862E


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

By the time you see i/o at the disk level, any concept of user mode
process (if there was even one) is gone. It might not even be your
entire i/o request, but instead just a partial transfer for instance.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Kotian, Deepak
Sent: Friday, December 03, 2004 2:13 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)

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

So to summarize:

Re how do I track just my read/write requests to my scsi disk filter driver?

In general, you don’t. If you are filtering above disk.sys, you will see
read/write requests, but in general they will have little or no reliable
association with whatever process originally issued them. If you are
filtering below disk.sys then you will only see IRP_MJ_SCSI requests.

Per process storage read/write tracking is best done at the file system
filter level.

I think we have had this discussion about 43,000 times.

What are you really trying to do?

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Razvan Hobeanu
Sent: Friday, December 03, 2004 8:20 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)

— “Kotian, Deepak” wrote:
> > I am creating a upper filter driver for SCSI disk drive.
>
> > Some way like idendify the
> > process id of my process within the filter and then
> tracking…Not very
> > sure how??..
>
> You have no reliable way to get the process ID at that level
> (filter driver for SCSI disk drive) in order to identify
> writes made by your user application.
>
> Best regards,
> Razvan
>
>
>
>
> __________________________________
> Do you Yahoo!?
> All your favorites on one personal page Try My Yahoo!
> http://my.yahoo.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@hollistech.com To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>