ExitWindowsEx not working with Windows XP if computer is locked

Just a quick post of a problem I addressed today while finishing my current assignment.

I used the ExitWindowsEx() API call to logoff the user (with the force close flag). In Vista it worked without any problem, logging out the user whenever he was using the PC or with the computer locked. But... when I went to test it on an XP machine... surprise, the system killed the explorer.exe process but didn't close the session.

After searching for a while and doing some tests, I found it is an actual problem of Windows XP (here's the KB). It is not yet included in any service pack or Windows Update patch (I suppose because it modifies winlogon behavior), so if anyone comes across this same problem, don't go crazy trying things... just install the hotfix and it will behave correctly and logoff the user even with the computer locked.

ExitWindowsEx not working with Windows XP if computer is locked published @ . Author: