pub fn get_last_error() -> u32
Read TEB.LastErrorValue (gs:[0x68] x64 / fs:[0x34] x86).
TEB.LastErrorValue
gs:[0x68]
fs:[0x34]
Source: Geoff Chappell TEB layout, LastErrorValue at 0x68 (x64) / 0x34 (x86).