The short answer is no - you cannot resize the file association after it is created. The create / copy sequence that you describe is the only way I know for this, with the file associations supported by the system page file.
However, you can manage the file that supports your mapping and do it yourself. Start with your own zero-initialized file and specify valid handles for your calls to CreateFileMapping() .
When you need to resize, close your mappings, expand the file, and recreate your mappings. This will require some synchronization between growth / truncation operations - not trivial, but also should not be too complicated.
In the end, this is the same old story. Added complexity and performance.
Bukes
source share