-
Notifications
You must be signed in to change notification settings - Fork 206
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
Handle SetLastError=true #360
Handle SetLastError=true #360
Conversation
6808460
to
292c98d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Looks like we found the owner for proposing these new APIs :-)
I assume we need/want:
SetLastSystemError()
, even though we could P/Invoke into that ourselves - see example in PR.SetLastWin32Error()
, even though we could use reflection to get at the call - see example in PR.
Is the last error guaranteed to be left intact by all the unmarshalling code? Should |
Ahh, yeah. Good call. |
Interestingly, the built-in system today can allow writing over the error code in unmarshalling (tried this quickly with a custom marshaler does a |
Yes, the built-in system has a patch work of workarounds like this that I am sure has many holes. |
292c98d
to
bffbd87
Compare
bffbd87
to
eb1af69
Compare
Commit migrated from dotnet/runtimelab@b36b0b8
Get/SetLastSystemError
) and setting P/Inovke error (SetLastWin32Error
) toAncillary.Interop
cc @AaronRobinsonMSFT @jkoritzinsky
Examples:
SetLastError=true, blittable signature
SetLastError=true, non-blittable signature