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

Implement proper interop to PInvoke for structs contataining an object ref #4679

Closed
LLITCHEV opened this issue Nov 17, 2015 · 3 comments
Closed

Comments

@LLITCHEV
Copy link
Contributor

Currently on Windows the CLR uses a VARIANT type to pass the object ref to the native PInvoke.
For non Windows systems it throws a TypeInitializationException.

After discussing with interop team a work is underway to either throw UnsupportedException or to properly marshal the obj ref.

@AaronRobinsonMSFT
Copy link
Member

@jkoritzinsky We throw NotSupportedException right? I think this issue can finally be closed.

@jkoritzinsky
Copy link
Member

I believe we throw a MarshalDirectiveException, but I need to check.

@jkotas
Copy link
Member

jkotas commented Mar 5, 2021

We throw System.Runtime.InteropServices.MarshalDirectiveException: Cannot marshal 'parameter #1': Invalid managed/unmanaged type combination (Marshaling to and from COM VARIANTs isn't supported).. I do not see anything to fix here.

@jkotas jkotas closed this as completed Mar 5, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Apr 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants