-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[runtime] Fix the marshalling of class types using MarshalAs(UnmanagedType.Struct). #8732
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…dType.Struct). Fixes mono#8250.
lewurm
approved these changes
May 16, 2018
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
This was referenced Mar 10, 2021
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
…dType.Struct). (mono/mono#8732) Fixes mono/mono#8250. Commit migrated from mono/mono@2674424
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #8250.