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

Change calling convention to Cdcel #22

Merged
merged 1 commit into from
Nov 14, 2024

Conversation

eXpl0it3r
Copy link
Contributor

@eXpl0it3r eXpl0it3r commented Nov 14, 2024

The default DllImport calling convention is Winapi, which defaults to Stdcall. x86 C++ libraries however use Cdecl as calling convention instead.

See also: https://learn.microsoft.com/en-us/dotnet/standard/native-interop/calling-conventions#platform-default-calling-convention

This solves pInvokeStackImbalance "exceptions" while debugging, see also: https://stackoverflow.com/a/3506938/1034248

The default DllImport calling convention is Winapi, which defaults to
Stdcall. x86 C++ libraries however use Cdecl as calling convention
instead.
@eXpl0it3r eXpl0it3r force-pushed the bugfix/calling-convention branch from e1212cb to bbaa8c3 Compare November 14, 2024 16:27
@sandrohanea
Copy link
Owner

Thank you for your contribution @eXpl0it3r !

@sandrohanea sandrohanea merged commit 4d9d34b into sandrohanea:master Nov 14, 2024
1 check passed
@eXpl0it3r eXpl0it3r deleted the bugfix/calling-convention branch November 14, 2024 16:41
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.

2 participants