How do open a partition in Windows a la Linux style /dev/sdXY
? Currently I'm opening \\\\.\\PhysicalDrive%d
then calling DeviceIoControl(IOCTL_DISK_GET_DRIVE_LAYOUT, ...)
to get the partition
layouts, and storing the offset and size of the region containing the
filesystem. In my code I offset IO operations on the device by the offset to the partition.
Furthermore, how do I remove the apparently synchronous behaviour? Operations are very slow on the physical drive raw device on Windows, and I'd prefer the OS did caching where possible.