-
Notifications
You must be signed in to change notification settings - Fork 84
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
Marshalled arrays should include SizeParamIndex and direction #372
Comments
In my case the [Out] is required for the call to work correctly. I don't segfault without it, but the array won't be populated if it's not included. (i.e. pceltFetched gets set to 1, but array[0] still equals null) SizeParamIndex = 0 I'm able to remove without affecting anything. I didn't look at putting together a minimal repro project for you after you linked the #269 issue. I can still do that if it would be useful. |
I don't think we need the repro any more now that we understand the fix. And thank you for helping me see the known runtime impact of omitting the |
In the In the |
The `MarshalAsAttribute` doesn't let us discern between 0 and unset. The C# compiler can tell and sets metadata based on the syntax. We have to lug around `NativeArrayInfo` in order to track a 0 vs. an unset value though till we're ready to emit syntax. Fixes #372
For #269 we fixed a bug by emitting
[MarshalAs(UnmanagedType.LPArray)]
on parameters that carry arrays of COM objects.We might further improve perf and function by adding the
[Out]
or[In]
attributes from the metadata to these same parameters so the interop marshaler can skip some work.We might also be useful to set the
SizeParamIndex
argument when the metadata includes it.@skippy10110 mentioned in #333 (comment)_ a code snippet that included these elements that seem to still be missing.
The text was updated successfully, but these errors were encountered: