Skip to content

Conversation

@jevansaks
Copy link
Member

@jevansaks jevansaks commented Nov 10, 2025

When a function returns a pointer, like WTHelperProvDataFromStateData, we need to make sure that type is preserved in the cswin32 signature. We were losing the pointer indirection when PointerTypeHandleInfo was thinking it could use out. We can't do anything fancy to marshal pointer returns so we'll just pass along another bit in the TypeSyntaxSettings to let callees know it's a return value and force it to stay as pointer type.

I've also been diffing the outputs of the "FullGeneration" before/after changes like this but I kept getting stymied because the list of types and methods was not always in the same order. I added a step to sort those lists in the "GenerateAll" step. These methods are only called during testing so adding a sort doesn't seem too bad.

Fixes #992

@jevansaks jevansaks force-pushed the user/jevansaks/preservepointerreturn branch from 9fe8111 to 92d1c4a Compare November 10, 2025 07:41
@jevansaks jevansaks merged commit 89950cf into main Nov 11, 2025
7 checks passed
@jevansaks jevansaks deleted the user/jevansaks/preservepointerreturn branch November 11, 2025 02:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

struct* return types on extern methods generated without pointer when marshaling is allowed

3 participants