From f5431ba0ec8336254aa2dc9b337879e0e573bdaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sat, 12 Apr 2014 15:02:02 +0000 Subject: [PATCH] [CONSOLE.CPL] Fix setting default parameters. svn path=/trunk/; revision=62720 --- reactos/dll/cpl/console/console.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/reactos/dll/cpl/console/console.c b/reactos/dll/cpl/console/console.c index b69467be2de..bd4950f39ae 100644 --- a/reactos/dll/cpl/console/console.c +++ b/reactos/dll/cpl/console/console.c @@ -296,22 +296,6 @@ InitApplet(HWND hWnd, UINT uMsg, LPARAM wParam, LPARAM lParam) return 0; } - /* Check that we are really going to modify GUI terminal information... */ - if (pSharedInfo->TerminalInfo.Size != sizeof(GUI_CONSOLE_INFO) || - pSharedInfo->TerminalInfo.TermInfo == 0) - { - /* ... it's not the case, bail out */ - - /* Cleanup */ - HeapFree(GetProcessHeap(), 0, pConInfo); - - /* Close the section */ - UnmapViewOfFile(pSharedInfo); - CloseHandle(hSection); - - return 0; - } - /* Find the console window and whether we set the default parameters */ pConInfo->hConsoleWindow = pSharedInfo->hConsoleWindow; pConInfo->ShowDefaultParams = pSharedInfo->ShowDefaultParams; @@ -333,6 +317,13 @@ InitApplet(HWND hWnd, UINT uMsg, LPARAM wParam, LPARAM lParam) * Copy the shared data into our allocated buffer, and * de-offsetize the address of terminal-specific information. */ + + /* Check that we are really going to modify GUI terminal information */ + // FIXME: Do something clever, for example copy the UI-independent part + // and init the UI-dependent part to some default values... + ASSERT(pSharedInfo->TerminalInfo.Size == sizeof(GUI_CONSOLE_INFO)); + ASSERT(pSharedInfo->TerminalInfo.TermInfo); + RtlCopyMemory(pConInfo, pSharedInfo, sizeof(CONSOLE_PROPS) + sizeof(GUI_CONSOLE_INFO)); pConInfo->TerminalInfo.TermInfo = (PVOID)((ULONG_PTR)pConInfo + (ULONG_PTR)pConInfo->TerminalInfo.TermInfo); }