Background
I have an existing 32 bit application which has a rather big chunk of RAM (>128 MB) allocated (via malloc/new) and populated with some image data (multiple frames worth). A read only pointer (const char *) to the start of this chunk of RAM is accessible to the application's plugins via a SDK-API call. Other API calls are available to retrieve the meta data such as width/height/bit depth and so on. I have no/little control over this application outside the SDK-API calls.
I have yet another 64 bit application (under my control) which requires the above data as input and requires significantly more RAM due to up sampling/3D volume reconstruction which warrants the 64 bit process.
The Problem
I wish to share the physical memory mapped to this existing pointer in the 32 bit process (which was not originally created via calls such as CreateFileMapping/MapViewOfFile but through malloc/new operator calls) with the 64 bit process.
Is it even possible ?
Typically I'd create a same sized shared memory in the 32 bit process, copy the contents over and use some synchronization method to signal the data is available. In my case however, the 32 bit process is also getting crowded with many plugins and therefore it is very near the limits of available free virtual space. There is a chance MapViewOfFile might fail because of the memory fragmentation. Since I only need a read only copy of the chunk of RAM, I was trying avoid additional allocation and copying.
I am targeting 64 Bit Windows 7, Visual C++ 2010/2015