Okay. ExitWithLastError() is still the thing to use here. Basically, ExitWithLastError() is used anywhere Win32 returns BOOL and says check ::GetLastError().