low-level-io

How to read individual sectors/clusters using DeviceIoControl() in Windows?

I dropped my laptop while Windows was preparing to hibernate and as a result, I got a head crash on the hard drive. (Teaches me to get a hard drive and/or laptop with a freefall sensor next time around.) Anyway, running SpinRite to try to recover the data has resulted in all the spare sectors on the disk to all be all used up for all the...

How to find if an NTFS logical cluster is free?

I would like to write a program that reads all the unused clusters on an NTFS volumne. (I'm looking to recover data from a file that was accidentally truncated). According to this page I can call SetFilePointer() and ReadFile() on the volume handle to go through each logical cluster on the volume. But how do I know which clusters ar...