GetLastError

[DllImport("kernel32.dll")]
public static extern uint GetLastError(
   
);

Microsoft documentation: Link

Last updated