Marshal.PtrToStructure fixes (#53360)
authorJan Kotas <jkotas@microsoft.com>
Thu, 27 May 2021 23:42:12 +0000 (16:42 -0700)
committerGitHub <noreply@github.com>
Thu, 27 May 2021 23:42:12 +0000 (16:42 -0700)
commit89313ca06932bdb69c53965ec1e37b67f920ee95
tree49f014721319fa2981d9804ac8c1fd63fd055543
parent28d3f317abe7697dcc6ccd08fd18dc417e73bde4
Marshal.PtrToStructure fixes (#53360)

- Fix reflection annotations. PtrToStructure calls private constructors.
- Move PtrToStructure overload that creates objects to shared CoreLib.
- Fix Mono implementation to call private constructor.
- Fix Mono error handling to match CoreCLR.
src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.CoreCLR.cs
src/libraries/System.Diagnostics.EventLog/src/System.Diagnostics.EventLog.csproj
src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/NativeWrapper.cs
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.cs
src/libraries/System.Runtime.InteropServices/ref/System.Runtime.InteropServices.cs
src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/PtrToStructureTests.cs
src/mono/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Mono.cs