News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Drive access notification

Started by John, March 07, 2006, 03:18:22 AM

Previous topic - Next topic

John

I wasn't sure where I should put this so my apologies if it is in the wrong place.

Does anyone know how to detect when a specific drive is being read from or written to? Like when the light on the case starts lighting up.

I'd like to develop a program that sits in the system tray and blinks at the same time the led on the case does. The reason is that the case is not always in the same location as the keyboard and monitor and I like to visually see when the drive is active. I assume I'll need some type of windows hook but I'm not really sure where to start.

Any pointers in the right direction would be appreciated.

asmfan

HDD as ATA/SCSI devices has own port-map to access to, as minimum you need to reach the 0-ring to read them and to find out if the device is in busy state (it transacts). write a driver for 0-ring... i cant say any more sensable
Russia is a weird place

farrier

John,

A few weeks ago I wrote a backup program using FindFirstChangeNotification.  I just wrote a new one using ReadDirectoryChangesW, which gives access to all changes due to:

FILE_NOTIFY_CHANGE_SECURITY
FILE_NOTIFY_CHANGE_CREATION
FILE_NOTIFY_CHANGE_LAST_ACCESS
FILE_NOTIFY_CHANGE_LAST_WRITE
FILE_NOTIFY_CHANGE_SIZE
FILE_NOTIFY_CHANGE_DIR_NAME
FILE_NOTIFY_CHANGE_FILE_NAME


The attached program changes the Title Bar Text with the old fashioned rotating cursor :dance:

The program is in FASM syntax, but should be easy to follow.

hth,

farrier


[attachment deleted by admin]
It is a GOOD day to code!
Some assembly required!
ASM me!
With every mistake, we must surely be learning. (George...Bush)

John

That seems to work pretty well. Thanks farrier!

farrier

John,

Glad to help!

When you get your--blinking in the system tray--version working, post it here!!

farrier
It is a GOOD day to code!
Some assembly required!
ASM me!
With every mistake, we must surely be learning. (George...Bush)

John

It might be a while as I'm just starting to get back into learning ASM after a few months break. I'll be sure to post it here though if/when I get it going.

Thanks again for your help :)

MichaelW

I posted an app that I think matches the original description here:

http://www.masmforum.com/simple/index.php?topic=4163.0

eschew obfuscation