TechTalkz.com Logo Ask the Experts!

Go Back   TechTalkz.com Technology & Computer Troubleshooting Forums > Tech Support Archives > Microsoft > Microsoft Device Drivers

upper filter driver for disk.sys

Microsoft Device Drivers

 
 
Thread Tools Display Modes
Unread 04-12-2007, 07:12 AM   #1
Nidhi Malik
Guest
 
Posts: n/a
upper filter driver for disk.sys

Hi all,

I have a sample filter driver . I want it to attach as upper filter driver
for disk.sys. Also i have to control that driver from my user application.
So that i can attach and remove that driver in stack from my application
only.Can anybody help me as I am very new to driver development .

Thanks in advance
Nidhi

 
Unread 04-12-2007, 07:12 AM   #2
Maxim S. Shatskih
Guest
 
Posts: n/a
Re: upper filter driver for disk.sys

You cannot remove from there without disabling (and re-enabling) the disk
stack, which will usually require a reboot.

You can only switch the filter to "do-nothing" mode.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com

"Nidhi Malik" <nidhi.malik@stellarinfo.com> wrote in message
news:ebqES6g7HHA.5184@TK2MSFTNGP03.phx.gbl...
> Hi all,
>
> I have a sample filter driver . I want it to attach as upper filter driver
> for disk.sys. Also i have to control that driver from my user application.
> So that i can attach and remove that driver in stack from my application
> only.Can anybody help me as I am very new to driver development .
>
> Thanks in advance
> Nidhi
>


 
Unread 04-12-2007, 07:13 AM   #3
Maruf Maniruzzaman
Guest
 
Posts: n/a
Re: upper filter driver for disk.sys


Is it possible to re-assign the contents of pDriverObject->MajorFunction[]
long after DriverEntry is called? What happens if I do that?

--
Sincerely,
Maruf Maniruzzaman,
Software Engineer,
KAZ Software Limited,
Dhaka, Bangladesh.
http://kaz.com.bd
http://kuashaonline.com

This posting is provided "AS IS", and confers no rights.



"Maxim S. Shatskih" wrote:

> You cannot remove from there without disabling (and re-enabling) the disk
> stack, which will usually require a reboot.
>
> You can only switch the filter to "do-nothing" mode.
>
> --
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> maxim@storagecraft.com
> http://www.storagecraft.com
>
> "Nidhi Malik" <nidhi.malik@stellarinfo.com> wrote in message
> news:ebqES6g7HHA.5184@TK2MSFTNGP03.phx.gbl...
> > Hi all,
> >
> > I have a sample filter driver . I want it to attach as upper filter driver
> > for disk.sys. Also i have to control that driver from my user application.
> > So that i can attach and remove that driver in stack from my application
> > only.Can anybody help me as I am very new to driver development .
> >
> > Thanks in advance
> > Nidhi
> >

>
>

 
Unread 04-12-2007, 07:13 AM   #4
Don Burn
Guest
 
Posts: n/a
Re: upper filter driver for disk.sys


"Maruf Maniruzzaman" <MarufManiruzzaman@discussions.microsoft.com> wrote in
message news:36B0CADD-AAAD-4C92-813E-BE2A743996E7@microsoft.com...
>
> Is it possible to re-assign the contents of
> pDriverObject->MajorFunction[]
> long after DriverEntry is called? What happens if I do that?
>


While it is possible, there are unfortunately enought poorly written
drivers (some of the major anti-virus firms come to mind) that will dip
into the structure to cause problems. Instead it is better to have a
wrapper function that redirects the calls to where you want them, this is
safe and clean.


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply


 
Unread 04-12-2007, 07:13 AM   #5
Vladimir Zinin
Guest
 
Posts: n/a
Re: upper filter driver for disk.sys

The reassigning is not needed and it cannot be made, as there is not
opportunity to synchronize access to the DriverObject->MajorFunction[]
array.
In a case when a driver should not do anything, it can simply forward
irps down in the stack.

--
Best regards,
Vladimir Zinin
mailto:vzinin***********
 
Unread 04-12-2007, 07:14 AM   #6
Maruf Maniruzzaman
Guest
 
Posts: n/a
Re: upper filter driver for disk.sys

Why do I need to synchronize? Can't I assign the function pointer in an
atomic step?

--
Sincerely,
Maruf Maniruzzaman,
Software Engineer,
KAZ Software Limited,
Dhaka, Bangladesh.
http://kaz.com.bd
http://kuashaonline.com

This posting is provided "AS IS", and confers no rights.



"Vladimir Zinin" wrote:

> The reassigning is not needed and it cannot be made, as there is not
> opportunity to synchronize access to the DriverObject->MajorFunction[]
> array.
> In a case when a driver should not do anything, it can simply forward
> irps down in the stack.
>
> --
> Best regards,
> Vladimir Zinin
> mailto:vzinin***********
>

 
Unread 04-12-2007, 07:14 AM   #7
Don Burn
Guest
 
Posts: n/a
Re: upper filter driver for disk.sys


"Maruf Maniruzzaman" <MarufManiruzzaman@discussions.microsoft.com> wrote in
message news:509CE94E-B38D-4586-8307-DE2E009A1316@microsoft.com...
> Why do I need to synchronize? Can't I assign the function pointer in an
> atomic step?
>

Yes theoretically, though Vladimir is basically correct. Even if you do it
atomically, you have to worry about about potentially the need to have two
functions swapped at the same time. That does not even count, the fact I
mentioned in my earlier post that there are idiots who reach into the
device object and save the pointers and do other really stupid things.

If there was some great advantage of doing the vectoring at the device
object array this might make sense, but there is not and the safety you
gain by a few instruction wrapper function makes a question like this
stupid.


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply


 
Unread 04-12-2007, 07:14 AM   #8
Vladimir Zinin
Guest
 
Posts: n/a
Re: upper filter driver for disk.sys

But if any MajorFunction pointer is cached by some system component? If
you want to reassign this functions then it's better, as Don Burn said,
to use a wrapper function.

--
Best regards,
Vladimir Zinin
mailto:vzinin***********

Maruf Maniruzzaman wrote:
> Why do I need to synchronize? Can't I assign the function pointer in an
> atomic step?
>

 
 

Thread Tools
Display Modes



< Home - Windows Help - MS Office Help - Hardware Support >


New To Site? Need Help?

All times are GMT. The time now is 12:38 AM.


vBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO
Copyright © 2005-2013, TechTalkz.com. All Rights Reserved - Privacy Policy
Valid XHTML 1.0 Transitional