Closed roboz0r closed 1 month ago
Thanks for the excellent bug report and for sharing the solution you found. I'll research it some and (likely) apply the fix you found to the generated code.
The same bug seems to apply to IDirectDraw.EnumDisplayModes and the equivalents for the other DirectDraw versions, they need the MarshalAs attribute on the callback param.
Actual behavior
Attempting to call
IContextCallback.ContextCallback
with the automatically generated function signature results in the exception:Expected behavior
The call completes without error.
Repro steps
NativeMethods.txt
content:NativeMethods.json
content (if present):Any of your own code that should be shared?
I copied the generated interface code and added
[MarshalAs(UnmanagedType.FunctionPtr)]
to the parameter and it now seems to call successfully.Context
0.2.206-beta
46.0.5-preview
net7.0-windows