Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added x64 exception handling #91

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

DaLynX
Copy link

@DaLynX DaLynX commented Feb 17, 2019

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.
}

@Elmue
Copy link

Elmue commented Jul 2, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash when throwing exception inside loaded dll.
2 participants