Is the file kosher on the memory card a second time, but with a larger size?

In my application, one file is created on the disk and the memory with the initial size is displayed. If I applied a second memory mapping to a file with a larger size, the file will expand to a new size. Windows allows me to do this without errors, but I don’t know if it is really kosher. Are there any problems with the second memory display with a larger size?

+5
source share
1 answer

The CreateFileMapping documentation has the following:

After creating the file association object, the file size must not exceed the size of the file association object; if so, not all file contents are available for sharing.

This seems to imply (as no other flaws or prohibitions are mentioned) that the only side effect of matching the file a second time with a larger size is that the first matching will not be able to see all of this (obviously).

+1
source

Source: https://habr.com/ru/post/1205208/


All Articles