Title: ExitWindowsEx not working with Windows XP if computer is locked
Slug: exitwindowsex-not-working-with-windows-xp-if-computer-is-locked
Date: 2007-06-06 12:18:00
Author: Kartones
Lang: en
Tags: Systems-IT, Windows, Troubleshooting
Description: A problem with ExitWindowsEx on Windows XP when computer is locked, resolved by installing a hotfix from Microsoft.

 <p>Just a quick post of a problem I addressed today while finishing my current assignment.</p> <p>I used the <a href="http://www.pinvoke.net/default.aspx/user32/ExitWindowsEx.html">ExitWindowsEx()</a> 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.</p> <p>After searching for a while and doing some tests, I found it is an actual problem of Windows XP (<a href="http://support.microsoft.com/kb/910849">here's the KB</a>). It is not yet included in any service pack or Windows Update patch (I suppose because it modifies <a href="http://en.wikipedia.org/wiki/Winlogon">winlogon</a> 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.</p>