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

EntryPointNotFoundException: Unable to find an entry point named 'RtlCopyMemory' in DLL 'kernel32.dll'. #7

Closed
wimpie3 opened this issue Dec 24, 2021 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@wimpie3
Copy link

wimpie3 commented Dec 24, 2021

As soon as I'm using the function SaveAsAnimatedGif, I get this exception in VB.NET with .NET 4.8:

EntryPointNotFoundException: Unable to find an entry point named 'RtlCopyMemory' in DLL 'kernel32.dll'.

@koszeggy
Copy link
Owner

koszeggy commented Dec 24, 2021

Thank you for the report.

Ahh, this is a nasty one. There are some P/Invoke functions that use dirty inner hacks by the framework. These are just macros in WinAPI instead of real exported functions and unfortunately the mocked entry points are named differently in .NET Core and .NET Framework.

Firstly I used specific names on each platforms but that wasn't good either because sometimes the .NET Framework binaries needed to be executed on .NET Core (when using debugger visualizers, for example), so in the end I switched to the unified RtlCopyMemory name, which appeared to work everywhere... well, it seems I was just (un)lucky that it was working everywhere for me...

Could you please share some more environmental details, such as Windows version?

But in the end I will maybe switch to my ultimate fallback implementation even on Windows. This is now used by Mono/Linux, for example, if an older framework version is targeted where Buffer.MemoryCopy is not available.

Until then, you can try to target .NET Core 3.0 or later instead (eg. .NET 6) if you can switch to it in your project.

@koszeggy koszeggy self-assigned this Dec 24, 2021
@koszeggy koszeggy added the bug Something isn't working label Dec 24, 2021
@wimpie3
Copy link
Author

wimpie3 commented Dec 25, 2021

Windows version 11. And unfortunately it's not possible to switch to .NET Core - that would require a complete rewrite of my software. I think a fallback implementation will be necessary if you don't want to lose .NET Framework developers.

@koszeggy
Copy link
Owner

koszeggy commented Dec 25, 2021

Fixed by this commit. It will be in the next release soon.

if you don't want to lose .NET Framework developers

Don't be afraid of that. Compatibility with older frameworks has always been a priority, even .NET Framework 3.5 support is still maintained, even on Windows XP. All async methods have their pre-Task versions (Begin/End methods with IAsyncResult) and I don't plan to remove them. And I'm regularly fighting against Microsoft's breaking changes in order not to lose even Linux compatibility but it's not always that obvious.

@wimpie3
Copy link
Author

wimpie3 commented Dec 26, 2021

Thank you for fixing this bug so quickly! Any idea when the next version will be out (it's currently blocking the release of my software) ;-)

@koszeggy
Copy link
Owner

Any idea when the next version will be out

Hopefully still in this year. ;)

I want to add also an improvement to animgif generation when AllowDeltaFrames is true.

@koszeggy
Copy link
Owner

Fixed in v6.2.0

@wimpie3
Copy link
Author

wimpie3 commented Jan 2, 2022

Confirmed! It's working now! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants