Skip to content
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

Fix Interop.Gdi32.StartDoc p/invoke #76569

Merged
merged 1 commit into from
Oct 4, 2022
Merged

Conversation

elinor-fung
Copy link
Member

StartDoc takes a pointer to a DOCINFO struct. We had DOCINFO defined as a class on the managed side such that built-in marshalling would marshal it as a pointer. With the switch to custom marshalling via NativeMarshalling, we ended up marshalling the struct that is the native representation rather than a pointer to it.

This switches the DOCINFO to a struct and updates the parameter to StartDoc to be in, such that it should be marshalled as a pointer to the struct by both generated and built-in marshalling.

See #76538. This is the fix in main. We will need to backport to 7.0.

cc @ericstj @JeremyKuhne

@ghost
Copy link

ghost commented Oct 3, 2022

Tagging subscribers to this area: @dotnet/area-system-drawing
See info in area-owners.md if you want to be subscribed.

Issue Details

StartDoc takes a pointer to a DOCINFO struct. We had DOCINFO defined as a class on the managed side such that built-in marshalling would marshal it as a pointer. With the switch to custom marshalling via NativeMarshalling, we ended up marshalling the struct that is the native representation rather than a pointer to it.

This switches the DOCINFO to a struct and updates the parameter to StartDoc to be in, such that it should be marshalled as a pointer to the struct by both generated and built-in marshalling.

See #76538. This is the fix in main. We will need to backport to 7.0.

cc @ericstj @JeremyKuhne

Author: elinor-fung
Assignees: -
Labels:

area-System.Drawing

Milestone: -

@elinor-fung elinor-fung merged commit a6d3960 into dotnet:main Oct 4, 2022
@elinor-fung elinor-fung deleted the fixStartDoc branch October 4, 2022 02:54
@elinor-fung
Copy link
Member Author

/backport to release/7.0

@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2022

Started backporting to release/7.0: https://github.com/dotnet/runtime/actions/runs/3179059542

Copy link
Member

@ericstj ericstj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you @elinor-fung

Copy link
Member

@smasher164 smasher164 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ghost ghost locked as resolved and limited conversation to collaborators Nov 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants