CreateProcessAsUser fails on Windows XP with System error 233

Today I fixed one bug that was very hard to reproduce. Many hours were spent to figure out what combination caused it: It happens only on Windows XP (not on Vista, Server 2003, 2008, Win 7); It does not happens on all Windows XP, because it is Race condition; I was unable to reproduce it …