diff options
author | Guy Harris <guy@alum.mit.edu> | 2013-04-26 04:42:20 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2013-04-26 04:42:20 +0000 |
commit | edfe2fc28c736df464e727c4b6191621a45d593e (patch) | |
tree | cc3e3524a342f884ca459e03c285c691cb055c92 /ui/win32 | |
parent | 889e2d6e5e24cd6197bc97bffd2b470922483013 (diff) |
Work around a bug in a Microsoft security fix.
svn path=/trunk/; revision=49046
Diffstat (limited to 'ui/win32')
-rw-r--r-- | ui/win32/console_win32.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/ui/win32/console_win32.c b/ui/win32/console_win32.c index 3c50980c6d..7f93a1a742 100644 --- a/ui/win32/console_win32.c +++ b/ui/win32/console_win32.c @@ -160,7 +160,25 @@ create_console(void) */ if (!AttachConsole(ATTACH_PARENT_PROCESS)) { /* Probably not, as we couldn't attach to the parent process's console. - Try to create a console. */ + Try to create a console. + + According to a comment on + + http://msdn.microsoft.com/en-us/library/windows/desktop/ms681952(v=vs.85).aspx + + and according to + + http://connect.microsoft.com/VisualStudio/feedback/details/689696/installing-security-update-kb2507938-prevents-console-allocation + + and + + http://answers.microsoft.com/en-us/windows/forum/windows_xp-windows_update/kb2567680-andor-kb2507938-breaks-attachconsole-api/e8191280-2d49-4be4-9918-18486fba0afa + + even a failed attempt to attach to another process's console + will cause subsequent AllocConsole() calls to fail, possibly due + to bugs introduced by a security patch. To work around this, we + do a FreeConsole() first. */ + FreeConsole(); if (AllocConsole()) { /* That succeeded. */ console_wait = TRUE; |