Write-behind disk caching

Is there a way to disable the write-behind disk caching on Windows XP and 2000 systems from an application program?

Such a facility would be provided by the disk driver, not the OS. You need to contact the appropriate vendor to see if they’ve included APIs that cover that into their driver. Frankly, I’d doubt it.

I think, rather than caching performed by the drive’s onboard hard/firmware, we’re talking about caching performed by the OS in RAM - the equivalent of SmartDrv back in the old days - I think XP just does this transparently and by default; I suspect turning it off (if even possible) is going to make everything perform really badly.

Would I be right in guessing that you’re writing a piece of software that needs to guarantee that certain data has been committed to disk? If so, I think your best bet is going to be looking at API calls that will perform cache flushing and call them at key points in the code.

:smack: …of course that doesn’t solve the problem of what happens when the data hits the drive - where it may still be cached.

The problem is pretty much explained here:

http://support.microsoft.com/default.aspx?scid=kb;en-us;328504

I see, so you are referring to the OS’s write caching, not that done in the disk controller hardware. Sorry.

Does that article answer your OP?