Uh oh!
There was an error while loading. Please reload this page.
[release/6.0] Add SetLastError to GdiPlus methods - #59151
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.
ghost
commented
Sep 15, 2021
Tagging subscribers to this area: @safern, @tarekgh |
danmoseley
commented
Sep 15, 2021
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? |
danmoseley
commented
Sep 15, 2021
restarting with wasm publish fix. |
danmoseley
commented
Sep 15, 2021
@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? |
danmoseley
commented
Sep 15, 2021
@dotnet/dnceng more mysterious cancellations. |
lukas-lansky
commented
Sep 15, 2021
Interesting! @ChadNedzlek, do you have an idea what might be the problem here? |
MattGal
commented
Sep 15, 2021
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. |
danmoseley
commented
Sep 15, 2021
@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. |
ericstj
commented
Sep 15, 2021
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.