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

Skip to content

Conversation

@vargaz
Copy link
Contributor

@vargaz vargaz commented May 16, 2018

Fixes #8250.

@vargaz vargaz requested a review from kumpera as a code owner May 16, 2018 09:03
@vargaz vargaz merged commit 2674424 into mono:master May 17, 2018
@vargaz vargaz deleted the fix-8250 branch May 17, 2018 00:48
lambdageek added a commit to lambdageek/mono that referenced this pull request Mar 10, 2021
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 added a commit to lambdageek/mono that referenced this pull request Mar 10, 2021
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 added a commit to lambdageek/mono that referenced this pull request Mar 10, 2021
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
monojenkins pushed a commit to monojenkins/runtime that referenced this pull request Mar 10, 2021
Partial revert of mono/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/mono#8732 and uses MONO_MARSHAL_CONV_OBJECT_STRUCT.

---

Also added tests for BSTR marshaling inside structs.  This actually works on mono master thanks to mono/mono#19701 but there was no test covering this case.
akoeplinger pushed a commit that referenced this pull request Mar 11, 2021
* [tests] Add BStr and VARIANT in structs interop tests

* [marshal] Fix reverse P/Invoke marshaling VARIANT fields

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

* [marshal] Marshal BSTR from reverse pinvokes
lambdageek added a commit that referenced this pull request Mar 12, 2021
* [tests] Add BStr and VARIANT in structs interop tests

* [marshal] Fix reverse P/Invoke marshaling VARIANT fields

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
lambdageek added a commit to dotnet/runtime that referenced this pull request Mar 12, 2021
Partial revert of mono/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/mono#8732 and uses MONO_MARSHAL_CONV_OBJECT_STRUCT.

---

Also added tests for BSTR marshaling inside structs.  This actually works on mono master thanks to mono/mono#19701 but there was no test covering this case.

Co-authored-by: lambdageek <[email protected]>
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
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.

2 participants