We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello there,
This is a follow up to #240, but not related to the same missing feature.
While implementing another third party SDK different from #240, we stumbled upon an unsupported type of PInvoke.
An example goes as follow:
[DllImport("somelibrary.dll", EntryPoint = "SomeEntryPoint")] public static extern IntPtr SomeEntryPoint( [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "SomeICustomMarshaler")] string arg1, HandleRef arg2 );
I'm assuming that it is related to custom marshalers.
Cheers!
The text was updated successfully, but these errors were encountered:
This is #160 - I think we should be able to add support for this, but it's not very high up the priority list at this point.
You could work around by doing what the runtime would do manually - I think this should be equivalent:
public static IntPtr SomeEntryPoint( string arg1, HandleRef arg2 ) { ICustomMarshaler marshaler = SomeICustomMarshaler.GetInstance(null); IntPtr val = marshaler.MarshalManagedToNative(arg1); try { SomeEntryPoint(val, arg2); } finally { marshaler.CleanUpNativeData(val); } } [DllImport("somelibrary.dll", EntryPoint = "SomeEntryPoint")] public static extern IntPtr SomeEntryPoint( IntPtr arg1, HandleRef arg2 );
Sorry, something went wrong.
Ah! I should have checked the opened issues. Since it's a duplicate, I'm closing this one.
Thanks for pointing out that it's about the attribute, I'll be notifying the vendor.
No branches or pull requests
Hello there,
This is a follow up to #240, but not related to the same missing feature.
While implementing another third party SDK different from #240, we stumbled upon an unsupported type of PInvoke.
An example goes as follow:
I'm assuming that it is related to custom marshalers.
Cheers!
The text was updated successfully, but these errors were encountered: