Merge pull request #5881 from akallabeth/win_disable_console

Disable windows console attach.
This commit is contained in:
David Fort 2020-02-13 16:12:50 +01:00 committed by GitHub
commit e4ac7b98a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -60,17 +60,26 @@
static BOOL wf_create_console(void) static BOOL wf_create_console(void)
{ {
#if defined(WITH_WIN_CONSOLE)
if (!AttachConsole(ATTACH_PARENT_PROCESS)) if (!AttachConsole(ATTACH_PARENT_PROCESS))
return FALSE; return FALSE;
freopen("CONOUT$", "w", stdout); freopen("CONOUT$", "w", stdout);
freopen("CONOUT$", "w", stderr); freopen("CONOUT$", "w", stderr);
clearerr(stdout);
clearerr(stderr);
fflush(stdout);
fflush(stderr);
freopen("CONIN$", "r", stdin); freopen("CONIN$", "r", stdin);
clearerr(stdin); clearerr(stdin);
WLog_INFO(TAG, "Debug console created."); WLog_INFO(TAG, "Debug console created.");
return TRUE; return TRUE;
#else
return FALSE;
#endif
} }
static BOOL wf_end_paint(rdpContext* context) static BOOL wf_end_paint(rdpContext* context)