nullableenabled
David Hall 2023-10-17 22:25:24 -06:00
parent 4918a8f714
commit 1cba1cefe9
1 changed files with 1 additions and 4 deletions

View File

@ -52,7 +52,7 @@ public partial struct Win32Error : IEquatable<Win32Error>, IEquatable<uint>, ICo
/// <returns>The last error.</returns>
[SecurityCritical]
[System.Diagnostics.DebuggerStepThrough]
public static Win32Error GetLastError() => new(ExtGetLastError());
public static Win32Error GetLastError() => new(unchecked((uint)Marshal.GetLastWin32Error()));
/// <summary>Performs an explicit conversion from <see cref="int"/> to <see cref="Win32Error"/>.</summary>
/// <param name="value">The value.</param>
@ -250,9 +250,6 @@ public partial struct Win32Error : IEquatable<Win32Error>, IEquatable<uint>, ICo
ulong IConvertible.ToUInt64(IFormatProvider? provider) => ((IConvertible)value).ToUInt64(provider);
[DllImport(Lib.Kernel32, SetLastError = false, EntryPoint = "GetLastError")]
private static extern uint ExtGetLastError();
private static uint? ValueFromObj(object? obj)
{
if (obj == null) return null;