Open
Description
The extern
functions declared here are all marked as the following: (In C#)
[DllImport("dll_name")]
private static extern ret name(params object parameters);
Which is incorrect with respect to the calling convention.
The default ABI for rust extern
functions is defined as follows:
By default external blocks assume that the library they are calling uses the standard C ABI on the specific platform.
And as defined here:
// Declares an extern fn, the ABI defaults to "C" extern fn new_i32() -> i32 { 0 }
And in the MS docs pages:
The default value for the CallingConvention field is Winapi, which in turn defaults to StdCall convention.
Therefore the C#
code should change to the following:
[DllImport("dll_name", CallingConvention = CallingConvention.Cdecl)]
private static extern ret name(params object parameters);
Thank you for your time.
Metadata
Metadata
Assignees
Labels
No labels