I have a code that writes to file using MapViewOfFile and FlushViewOfFile before remapping.
And I have a second code, that reads from the same file (on disk, not HANDLE/mapping object) using MapViewOfFile in other thread of the same process.
The flags of views are PAGE_READONLY/FILE_READ and PAGE_READWRITE/FILE_WRITE.
On my PC everything works totally fine. But when the same build runs as service on other PC, it have one strange bug: when I remap reader (this means UnmapViewOfFile + MapViewOfFile) with offset == 0 (to read some file header), it doesn't return any error, but the reading itself returns some old values, that were already changed by other thread.
When I open ProcessMonitor, it shows, that there were no reading from offset = 0, only the writing.
So, the problem is that new call CreateFileMapping/MapViewOfFile returns sucessfully, but maps some old cached page, and doesn't read new data from the file.
Once again, same build fine works on my PC.
Can anybody suggest something? Thanks.