Mercurial > pidgin.yaz
comparison pidgin/win32/winpidgin.c @ 20828:db66eb25c389
Fix allocating a console for and friends on Windows Vista. Refs #3392.
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Mon, 08 Oct 2007 10:55:34 +0000 |
parents | 44b4e8bd759b |
children | 9401a46da958 |
comparison
equal
deleted
inserted
replaced
20827:6e6a870fd4f6 | 20828:db66eb25c389 |
---|---|
543 | 543 |
544 /* If debug or help or version flag used, create console for output */ | 544 /* If debug or help or version flag used, create console for output */ |
545 if (strstr(lpszCmdLine, "-d") || strstr(lpszCmdLine, "-h") || strstr(lpszCmdLine, "-v")) { | 545 if (strstr(lpszCmdLine, "-d") || strstr(lpszCmdLine, "-h") || strstr(lpszCmdLine, "-v")) { |
546 /* If stdout hasn't been redirected to a file, alloc a console | 546 /* If stdout hasn't been redirected to a file, alloc a console |
547 * (_istty() doesn't work for stuff using the GUI subsystem) */ | 547 * (_istty() doesn't work for stuff using the GUI subsystem) */ |
548 if (_fileno(stdout) == -1) { | 548 if (_fileno(stdout) == -1 || _fileno(stdout) == -2) { |
549 LPFNATTACHCONSOLE MyAttachConsole = NULL; | 549 LPFNATTACHCONSOLE MyAttachConsole = NULL; |
550 if ((hmod = GetModuleHandle("kernel32.dll"))) { | 550 if ((hmod = GetModuleHandle("kernel32.dll"))) { |
551 MyAttachConsole = | 551 MyAttachConsole = |
552 (LPFNATTACHCONSOLE) | 552 (LPFNATTACHCONSOLE) |
553 GetProcAddress(hmod, "AttachConsole"); | 553 GetProcAddress(hmod, "AttachConsole"); |