// You should never PInvoke to GetLastError. Call Marshal.GetLastWin32Error instead!
' You should never PInvoke to GetLastError. Call Marshal.GetLastWin32Error instead!
Calling GetLastError directly via PInvoke is not guaranteed to work due to the CLR's internal interaction with the operating system. Instead, call Marshal.GetLastWin32Error.
System.Runtime.InteropServices.Marshal.GetLastWin32Error