Hello @zihming ,
Thank you for sharing your C++ testing approach. I'd like to share a few thoughts that might help address your questions.
Regarding whether FSCTL_GET_VOLUME_BITMAP is officially supported, while the API doesn't throw an explicit error, its use for determining physical cluster allocation doesn't appear to be practically functional or officially intended for ReFS.
If you are wondering how to interpret the returned bitmap, it helps to look at how ReFS organizes its underlying storage. As mentioned in the ReFS Block Cloning documentation, ReFS manages data using an allocate-on-write mechanism and tracks files through logical metadata mapping. To support this gracefully, ReFS utilizes a much larger, sparse virtual address space. It seems that when querying the volume bitmap on ReFS, the API actually returns the map of this massive virtual space rather than the physical disk clusters themselves. This abstract mapping would explain why the returned bitmap size drastically exceeds the physical limits reported by GetDiskFreeSpace. Because of this, trying to interpret this specific volume bitmap to locate absolute physical data likely won't yield meaningful results.
As for finding a documented API or alternative method to obtain actual volume allocation information, there currently doesn't appear to be a supported method that returns a simple 1:1 physical volume allocation bitmap for ReFS like NTFS does. However, if your overarching goal involves building a backup, replication, or block-tracking solution, you might want to explore the Volume Shadow Copy Service (VSS). Current Windows Server environments typically track volume-level block changes safely through VSS integrations rather than using bare-metal IOCTL volume bitmaps.
I hope this provides some helpful context on the allocation mechanics and points you toward a workable approach! If you found my response helpful or informative, I would greatly appreciate it if you could follow this guide for your confirmation.
Thank you.