I have empirically determined that on my system a memory mapped file created for a specific size is always completely reset to zero by default. For example, using a call
HANDLE hMM =
CreateFileMapping (h,
NULL,
PAGE_READWRITE,
0,
0x01400000,
NULL);
.. and writing to the mapped view of this file always leads to a 20MB file that is completely nullified, except when I wrote non-zero data.
I am wondering if uninitialized parts of a file can be considered zeros. Is this behavior guaranteed for Windows in general?
source
share