tags:

views:

162

answers:

3

Hi!,

I want to write a driver (in c) that can "catch" the events for reading and writing on hard disk. My problem is that I do not know how can I listen the system bus to treat these events. I use Microsoft DDK.

Thank you!

A: 

This is more complicated than you think. This can be done with a SCSI Port Driver. What are you trying to do? Get logical IO or IO on a physical disk?

Matt Davison
+1  A: 

It is much easier to monitor reads and writes of your applications than those actually happens to the physical media. In other words, it is much easier to write a upper filter driver that sits above the file system driver than playing with the actual driver that handles physical access to the hard disk.

I suggest you browse the examples that come with your version of DDK (or WDK, etc) to see if there's anything similar to what you need. If there is, it's much easier to modify from those instead of starting from scratch.

PolyThinker
+3  A: 

I think what your looking for is IoAttachDevice(), you can find more information on the routine here.

Phaedrus