<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><strong style="font-weight: normal;">I'm playing with user32/cursoricon.c and winex11.drv/mouse.c and have noticed that one of the TODOs is that SetCursor (and probably lots others) clear the last error when they do not do so in windows.&nbsp; I tracked down the cause and winex11.drv's primary function for retrieving its per-thread data, x11drv_thread_data() calls the public kernel32 function TlsGetValue, which must set the last error to zero by specification.<br><br>So, should we be using some internal function to get the TLS data that does not alter SetLastError or should we just save the last error in winex11.drv, call TlsGetValue and then restore the last error state?&nbsp; The later seems hack-ish, but the former sounds like a pain.<br><br>Thanks,<br>Daniel<br></strong></td></tr></table><br>