Vitaliy Margolen wine-devel@kievinfo.com writes:
Sure but we call TlsGetValue() which does set LastError. So unless we can avoid that call (which I doubt) we have to do something extra to preserve the LastError.
If an app depends on it, yes.
No I don't have any games directly. But I had few tests testing several things in screen related areas and wasn't getting correct LastError. Also, looking at the fact that x11drv doesn't set LastError at all we should preserve it as much as possible. I haven't seen that many places in user32 that take care of preserving LastError either.
The thing that matters is setting the proper error codes on errors. Setting or not setting last error on success very rarely matters, and both on Windows and Wine it will usually simply be a side-effect of the functions being called internally.
If we wanted to replicate the exact Windows behavior we'd essentially need to manipulate last error in every single code path, and that would be a real nightmare; so we should only do it if there's a demonstrated need.