471,319 Members | 2,625 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,319 software developers and data experts.

Hard Drive Activity - Programmatically?

Hello all...
Please don't ask me why, but I am currently tasked to somehow discover
when the hard drive is being accessed (for reads and writes). All of
the searching I have done has been fruitless.
Is there some windows class/API/etc. that will let me know when the
hard drive is being read from or written to?
Thank you much!
--Dan

Dec 20 '05 #1
8 8335
Hello dantan98,

Try to find source for this http://www.sysinternals.com/Utilities/Diskmon.html

d> Please don't ask me why, but I am currently tasked to somehow
d> discover when the hard drive is being accessed (for reads and
d> writes). All of the searching I have done has been fruitless.
d>
d> Is there some windows class/API/etc. that will let me know when the
d> hard drive is being read from or written to?
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/members/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Dec 20 '05 #2
That's EXACTLY the kind of thing I need!! Thank you for pointing me to
this. Unfortunately, the source code isn't listed in the SC section.
I will email them to see if they can send me that basic source code
(such as when it is minimized to tray and indicates reads with green
and writes with red). That simple functionality is all I need.

Thanks again!

--Dan

Dec 20 '05 #3

"dantan98" <da******@sbcglobal.net> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
That's EXACTLY the kind of thing I need!! Thank you for pointing me to
this. Unfortunately, the source code isn't listed in the SC section.
I will email them to see if they can send me that basic source code
(such as when it is minimized to tray and indicates reads with green
and writes with red). That simple functionality is all I need.

Thanks again!

--Dan


No way they will give you the source. This kind of application is built in
top of a dynamically loaded kernel driver, even if they did, you won't be
able to build something similar using C#.
The good news is, you don't need it to watch DiskIO activity. All you have
to do is read the Disk performance counters, but remember all this
(useless?) stuff has a price, it could costs you a lot of CPU cycles just to
show you some red/green tray on the taskbar.

Willy.
Dec 20 '05 #4
It's actually for Red/Amber LEDs on hardware boards. Evidently our
hardware guys didn't think ahead far enough to realize our client may
want to have LEDs to indicate hard drive activity, so I have to
simulate the seemingly obvious connection from the motherboard to the
hard drive!

They gave me the "the source code we offer is in the source code
section" response, which I expected.

I did find two references regarding this, though: 1. Use WMI/WDM to
build "a WDM upper-filter driver for the disk class"; 2. Use the DDK
and utilize DiskPerf.

I have not used either of these, but my research has begun.

Thanks for your comments.

Any other tips/suggestions would be GREATLY appreciated. Thanks!

--Dan

Dec 20 '05 #5

"dantan98" <da******@sbcglobal.net> wrote in message
news:11*********************@g43g2000cwa.googlegro ups.com...
It's actually for Red/Amber LEDs on hardware boards. Evidently our
hardware guys didn't think ahead far enough to realize our client may
want to have LEDs to indicate hard drive activity, so I have to
simulate the seemingly obvious connection from the motherboard to the
hard drive!

They gave me the "the source code we offer is in the source code
section" response, which I expected.

I did find two references regarding this, though: 1. Use WMI/WDM to
build "a WDM upper-filter driver for the disk class"; 2. Use the DDK
and utilize DiskPerf.

I have not used either of these, but my research has begun.

Thanks for your comments.

Any other tips/suggestions would be GREATLY appreciated. Thanks!

--Dan


Ok, before you think of Filter driver development, you should take a look
at ETW (Event Tracing For Windows). ETW is great when it comes to trace
Kernel events and the system (XP or higher) comes with a high performnace
provider to (Kernel) Disk IO tracing. Search MSDN for ETW and take a look at
the DDK docs as well, both contain a detailed description of the API. Note
however that the target audience is C++.

Willy.
Dec 20 '05 #6
Excellent. Thank you!!

I will be sure to check it out. Should I have posted this into a C++
group instead?

Dec 21 '05 #7

"dantan98" <da******@sbcglobal.net> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Excellent. Thank you!!

I will be sure to check it out. Should I have posted this into a C++
group instead?


Well, honestly I don't know, probably a better place would be the WMI and
the DDK NG's. Note that you can use ETW from C#, it's just more work than if
you would use C++ or C++/CLI.

Willy.
Dec 21 '05 #8
YAY!! Our hardware guys were finally told they need to run this LED to
the motherboard!! It was stupid that they were having me do it.
SOOOOO glad it's off my back now! I think my boss finally realized how
much work this would entail and got nasty w/ them! :-D

Thanks for all the help though!! I *DO* appreciate it!

--Dan

Dec 27 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by max | last post: by
1 post views Thread by Sony Kalkan | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.