-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[release/6.0] Add SetLastError to GdiPlus methods #59151
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
Conversation
System.Drawing uses the last Win32 error in CheckErrorStatus to try to guess at why a GdiPlus draw method failed and ignore some failures. This was broken in .NETCore when SetLastError was removed from PINvokes. Bring back SetLastError for all PInvokes that use CheckErrorStatus.
|
Tagging subscribers to this area: @safern, @tarekgh |
|
Approved. Customer reported. Break introduced since last version. Relatively low risk. Would likely meet servicing bar. @AaronRobinsonMSFT maybe this discussion already happened, but does this suggest similar breaks may occur in pinvokes in customers code due to the original change? |
|
restarting with wasm publish fix. |
|
@dotnet/dnceng I reopened the PR to pick up another change and restart validation and lots of legs canceled themselves. I can't see info on Azdo about them. What happened and how do I get them to run? |
|
@dotnet/dnceng more mysterious cancellations. |
|
Interesting! @ChadNedzlek, do you have an idea what might be the problem here? |
Can you link the pipeline that did this? When I click through or look at everything for 59151 in AzDO I see one actively running job. |
As in, if customers were using these P/Invokes directly? I don't think that is possible because they are marked I could also be missing what you are asking. |
|
@AaronRobinsonMSFT ah, I likely misunderstood the original thread. If indeed this was simply a latent bug in Drawing unrelated to any 6.0 Interop changes, then my question does not apply. |
|
Yeah, this bug exists in 3.1 and 5.0 as well (and folks have suggested we patch it there as well). |
Backport of #59096 to release/6.0
/cc @ericstj
Fixes #58741
Customer Impact
Regression from .NETFramework and .NETCore causing a unexpected
ExternalExceptionrelated to session transitions (sleep/wake, Remote Desktop, etc)Testing
Manually verified in debugger. Unit tests.
Risk
Very low. Adds back SetLastError to only those PINvokes which require it.