-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Closed
Description
In the example below, the widths and length parameter will be used for marshalling the array, but they are not guaranteed to be set before the method is called. This would lead to a zero length array being marshalled.
[LibraryImport("Doesn't Exist")]
public static partial void Method(
[MarshalUsing(CountElementName = nameof(length)),
MarshalUsing(ElementIndirectionDepth = 1, CountElementName = nameof(widths))]
int[][] array,
[MarshalUsing(CountElementName = nameof(length))]
out int[] widths,
out int length);The behavior of the generators should be the following:
| Array parameter refKind / attribute | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Length(s) parameter refKind / attribute | |||||||||
| (nothing) | ref | in | out | [In, Out] | [In] | [Out] | |||
| (nothing) | Ok | Ok | Ok | Ok | Ok | Ok | Ok | ||
| ref | Ok | Ok | Ok | Ok | Ok | Ok | Ok | ||
| in | Ok | Ok | Ok | Ok | Ok | Ok | Ok | ||
| out | Warn | Warn | Warn | Ok | Warn | Warn | Ok | ||
| [In, Out] | Ok | Ok | Ok | Ok | Ok | Ok | Ok | ||
| [In] | Ok | Ok | Ok | Ok | Ok | Ok | Ok | ||
| [Out] | Warn | Warn | Warn | Ok | Warn | Warn | Ok | ||
Reactions are currently unavailable
Metadata
Metadata
Assignees
Type
Projects
Status
No status