MemoryModule icon indicating copy to clipboard operation
MemoryModule copied to clipboard

Added x64 exception handling

Open DaLynX opened this issue 6 years ago • 1 comments

Fixes #4 for x64.

Exception-handling code can be added to the loading process using Windows exceptions blocks:

__try {
    proc();
}
__except(EXCEPTION_EXECUTE_HANDLER) {
    // Exception-handling code.
}

DaLynX avatar Feb 17 '19 21:02 DaLynX

In the execption handler you should return ERROR_NOACCESS. Windows returns this error code when there was internally a crash in a function that has been caught.

Your comment // Exception-handling code. is useless. This missing code is just the important part !!

Because if you don't implement a good exception handler, your idea is not good. You are hiding the reason for the crash! If debugging in Visual Studio you will not see anymore why the exception occurred. It should be thought very well why an exception can occur at all and what to do if an exception has occurred. Hiding exceptions is generally a bad idea.

Elmue avatar Jul 02 '20 15:07 Elmue