Add SetLastError to GdiPlus methods (#59151)
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Wed, 15 Sep 2021 18:05:47 +0000 (11:05 -0700)
committerGitHub <noreply@github.com>
Wed, 15 Sep 2021 18:05:47 +0000 (11:05 -0700)
commit18794fa034e7f518b318d74ec4475be9d17a66e0
tree073511879e371707aee9dd4bf7df7d76eb6f67d4
parentb9f273a254f02038216295f49be77faa015036b5
Add SetLastError to GdiPlus methods (#59151)

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.

Co-authored-by: Eric StJohn <ericstj@microsoft.com>
src/libraries/System.Drawing.Common/src/System/Drawing/GdiplusNative.Windows.cs
src/libraries/System.Drawing.Common/src/System/Drawing/GdiplusNative.cs