Thanks Paul for the cdecl/stdcall tip.
I could have thought of that

Unfortunately that was not the solution, it's still not working.

As for C#, it's already called with stdcall (CallingConvention = CallingConvention.StdCall), I changed it to Cdecl, but no change there either.