Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@lambdageek
Copy link
Member

Manual backport of #20917 to 2020-02 (6.12). but also new BSTR fixes


Partial revert of #8732

If a managed struct is declared as

    public struct StructWithVariant
    {
        [MarshalAs (UnmanagedType.Struct)]
        public object data;
    };

Then the data field should be marshalled as a VARIANT.

The fix checks that the field's type is object and uses VARIANT for marshaling, otherwise it continues as in #8732 and uses MONO_MARSHAL_CONV_OBJECT_STRUCT.


Also added support for marshaling BSTR in structs in reverse P/Invokes. Morally it's a piece of #19701 but just for the BSTR_STR case

Partial revert of mono#8732

If a managed struct is declared as

        public struct StructWithVariant
        {
            [MarshalAs (UnmanagedType.Struct)]
            public object data;
        };

Then the `data` field should be marshalled as a VARIANT.

The fix checks that the field's type is `object` and uses VARIANT for
marshaling, otherwise it continues as in mono#8732 and uses
MONO_MARSHAL_CONV_OBJECT_STRUCT
@lambdageek
Copy link
Member Author

@monojenkins build failed

@akoeplinger akoeplinger merged commit acb8d8e into mono:2020-02 Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants