My application is executing another process ("update.exe"), and I would like to pass large data (a Record maybe) from my app to the update program.
Using command line to pass the data parameter(s) is not an option, because the data is too big (also Data size may vary).
How to correctly create CreateFileMapping
/MapViewOfFile
/UnmapViewOfFile
,
then Executing my update.exe,
finally Receiving the data in the update.exe program (OpenFileMapping
),
and freeing all handles (from main app and update.exe) so I don't have memory/handle leaks?
Code would be nice (No JCL
please). C++ is also fine.
Thanks.
Edit: I think my main problem is how to "signal" the main app to UnmapViewOfFile
and CloseHandle
after update.exe
done reading the data. (or maybe I need to use OpenFileMapping
with bInheritHandle
set to True
in my child process?)
Here is an Example. How can the Second process read the data if the main process calls UnmapViewOfFile
and CloseHandle
?.