Skip to content

Add Marshal API test coverage for generics marshalling #35193

@MichalStrehovsky

Description

@MichalStrehovsky

#103 added support for marshalling generics, but we don't seem to have test coverage for the Marshal APIs with this:

  • Marshal.OffsetOf
  • Marshal.SizeOf
  • Marshal.PtrToStructure
  • Marshal.StructureToPtr
  • Others?

E.g. Marshal.OffsetOf already worked on desktop CLR because the runtime didn't do a good job of blocking it (and it also raises a question as to whether the code paths this is taking are quite different that made it so that blocking didn't take place). We don't have tests that the returned numbers are actually good.

We might as well throw in a test for marshalling as UnmanagedType.AsAny because I'm sure WinForms is keen to use that (/snark).

I'm making this a .NET 5 issue since this is a new feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions