Just double-checked, that it is not my code problem. I see it on both 1.8.x and 1.9.4.
When I mount something like this as a disk:
using (var stream = new MemoryStream(checked((int)size))) using (var provider = new DevioProviderFromStream(stream, ownsStream: false)) using (var service = new DevioShmService(provider, OwnsProvider: false)) { service.StartServiceThreadAndMountImDisk(ImDiskFlags.Auto, mountPoint); wait for key... }
Then format disk, and try to write to a file on it with FILE_FLAG_NO_BUFFERING option set (file already exists, and has non-zero size by the time I do that). It always fails, complaining about something like System.ArgumentException: Handle does not support synchronous operations, which deep inside appears to be unaligned access, just like in this topic: http://reboot.pro/to...ag_no_buffering
The same test with FILE_FLAG_NO_BUFFERING works perfectly on real disks, and ImDisk-mounted disks, mounted directly (e.g. not via proxy).
This problem appears on the very first write, where I try to write 1MiB of data at file offset 0, so I assume alignment should not be a problem.
Edited by Victor Milovanov, 24 June 2015 - 02:31 AM.