Better implementation of GetLastError. (#20623)

Instead of calling the dynamically loaded kernel32.GetLastError, we can extract it from the TEB.
As shown by [Wine](https://github.com/wine-mirror/wine/blob/34b1606019982b71818780bc84b76460f650af31/include/winternl.h#L439), the last error lives at offset 0x34 of the TEB in 32-bit Windows and at offset 0x68 in 64-bit Windows.
89942ebd03Lucas Santos committed on 7/15/2024, 5:49:51 PM· committed by GitHubparentcf36d3f
9 files changedLine totals unavailable