Win32 Programming - Hook ReadFile(), WriteFile()...?

Does anyone have experience with hooking the above functions? After searching the only examples I can find involve injecting a dll into every running process to intercept these calls. This seems very problematic and down right nasty.

Specifically, I’m looking to monitor a directory, intercept any read or write to file and perform an action before the read or write can proceed.

Any ideas?

Thanks,

LarsenMTL

www.sysinternals.com are the experts on this sort of thing, and have articles and source code and links/references. They tend to create a runtime driver to hook api’s to, like regmon and filemon.

I’m sure I got some API hook example code from them some time ago (like 6 years now).

Anyhow - look there.

Simon

Thanks Simon, tons of information there.