Direct Disk Access: WinAPI WriteFile seems to fail on partitions larger than 2147483647 (7FFF FFFF) sectors
问题 I wrote a small program in VB .Net to physically sort folder entries on FAT partitions (see http://www.public.bplaced.net). To do this, I use API calls to Kernel32.dll. I open the partition with CreateFileA, use the handle to lock the drive with DeviceIoControl FSCTL_LOCK_VOLUME and then read and write sectors directly with SetFilePointer / ReadFile / WriteFile (synchronous, with NO_BUFFERING). All works PERFECTLY, except when I use my program with partitions larger than 2147483647 sectors