corert
corert copied to clipboard
Marshal.GetLastWin32Error in CoreLib
Number of file I/O and similar APIs will move to CoreLib as part of NetStandard2.0 work. The implementation of these APIs depend on Marshal.GetLastWin32Error that is not available in CoreLib today.
The current solution that calls Interop.mincore.GetLastError() cannot be used for this as is because of it only works for APIs with trivial marshaling that won't overwrite the last error. It is not the case of many file I/O APIs today.
To unblock, I am adding hack to src\System.Private.CoreLib\src\Interop\Interop.manual.cs. This hack should be removed once this issue is fixed.
https://github.com/dotnet/corert/pull/2452