MemoryModule
MemoryModule copied to clipboard
Prevent program from exiting when calling MemoryCallEntryPoint
In the code I can see this:
/**
* Execute entry point (EXE only). The entry point can only be executed
* if the EXE has been loaded to the correct base address or it could
* be relocated (i.e. relocation information have not been stripped by
* the linker).
*
* Important: calling this function will not return, i.e. once the loaded
* EXE finished running, the process will terminate.
*
* Returns a negative value if the entry point could not be executed.
*/
int MemoryCallEntryPoint(HMEMORYMODULE);
Why does the program ends when calling MemoryCallEntryPoint? How can I prevent the program to do so? I want to call the Entry Point in a different thread and keep doing other stuff.
Thank you
As far as I know an application calls TerminateProcess() or a similiar function when it is done. Running the executable code in a thread brings the very probable risk of creating a huge memory leak. Most applications do not care about freeing their memory properly when they exit.