Is it possible to write to free clusters on disk or read data from them using Windows APIs? I found Defrag API: <https://learn.microsoft.com/en-gb/windows/desktop/FileIO/defragmenting-files>

FSCTL\_GET\_VOLUME\_BITMAP can be used to obtain allocation state of each cluster, FSCTL\_MOVE\_FILE can be used to move clusters around. But I couldn't find a way of reading data from free clusters or writing data to them.

**Update:** one of the workarounds which comes to mind is creating a small new file, writing some data to it, then relocating it to desired position and deleting the file (the data will remain in freed cluster). But that still doesn't solve reading problem.

What I'm trying to do is some sort of transparent cache, so user could still use his NTFS partition as usual and still see these clusters as free space, but I could store some data in them. Data safety is not of concern, it can be overwritten by user actions and will just be regenerated / redownloaded later when clusters become free again.