Re: [AD] patch to prevent CTRL-ALT-DEL from killing allegro under windows

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Fri, 2005-12-02 at 02:00 -0600, Matthew Leverton wrote:
> See <http://www.allegro.cc/forums/thread/547778> for the discussion.
> 
> Under Windows XP (probably 2000 as well) pressing CTRL-ALT-DEL will
> (usually) terminate an Allegro application. Attached is a patch to
> prevent that from happening.
> 
> As explained in the thread, when pressing CTRL-ALT-DEL, Allegro
> receives 255 scancodes ranging from 0 to 255. In other words, to
> Allegro it looks like:
> 
> CTRL-ALT-DEL
> CTRL-ALT-0x00
> (I think 0x01 is skipped)
> CTRL-ALT-0x02
> CTRL-ALT-0x03
> ...
> CTRL-ALT-0xff

Hm, very odd. Is this behavior documented somewhere? Else, I hope it's
not a bug somewhere in Allegro which triggers this.

> Obviously this means the CTRL-ALT-END sequence gets triggered which
> causes Allegro to exit, assuming three_finger_flag is TRUE. I don't
> know the purpose of all these codes being sent and I don't know why it
> happens or if Allegro can tell Windows not to do it. Instead, the
> patch simply instructs Allegro to ignore them.
> 
> So with this patch, Allegro will behave like this:
> 
> If three_finger_flag is TRUE, then CTRL-ALT-END abort()s the app
> If three_finger_flag is FALSE, then CTRL-ALT-END does nothing
> 
> Regardless of the three_finger_flag setting, CTRL-ALT-DEL will always
> bring up the Task Manager, as it should.
> 
> I tested on Windows XP and 98 and noticed no problems with the patch
> applied. A few other people tested successfully as well.
> 

Thanks, applied it to HEAD.

Peter: Why is the wkeybdnu.c different? E.g. it uses ExitProcess(0)
instead of abort(). So not sure I can simply replace it with the version
from HEAD..

Oh, and where is todo.txt in new_api_branch?

Am I right in thinking that new_api_branch is now the default target for
patches, and will get SVN HEAD if SF provide SVN any time soon? And
there won't be merges later anymore, just important bugfixes (like this
one) are applied to both branches simultanously..

-- 
Elias Pschernig





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/