Uh oh!
There was an error while loading. Please reload this page.
Implement Marshal.Get(Last)PInvokeErrorMessage() APIs. - #70685
Conversation
ghost
commented
Jun 13, 2022
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
ghost
commented
Jun 13, 2022
Tagging subscribers to this area: @dotnet/interop-contrib Issue DetailsThe behavior of this API is to return the same value as Fixes #67872 /cc @danmoseley @dotnet/interop-contrib
|
Uh oh!
There was an error while loading. Please reload this page.
stephentoub
commented
Jun 13, 2022
There are other places using Interop.Kernel32.GetMessage. It'd be nice to have them changed (where possible) to just call Marshal.GetPInvokeErrorMessage, e.g. There are also places doing |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
The behavior of this API is to return the same value as new Win32Exception(error).Message, while avoiding the instantion of an exception.
Marshal implementation to handle the P/Invoke call. Consume new API in places where possible.
3464441 to
f498fccCompareMarshal.GetPInvokeErrorMessage() API.Marshal.Get(Last)PInvokeErrorMessage() APIs.Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
danmoseley
left a comment
There was a problem hiding this comment.
Nice improvement, thanks
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
The behavior of this API is to return the same value as
new Win32Exception(error).Message, while avoiding theinstantiation of an exception.
Fixes#67872
/cc @danmoseley @dotnet/interop-contrib