Author: hbelusca
Date: Sat Apr 12 15:02:02 2014
New Revision: 62720

URL: http://svn.reactos.org/svn/reactos?rev=62720&view=rev
Log:
[CONSOLE.CPL]
Fix setting default parameters.

Modified:
    trunk/reactos/dll/cpl/console/console.c

Modified: trunk/reactos/dll/cpl/console/console.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/console.c?rev=62720&r1=62719&r2=62720&view=diff
==============================================================================
--- trunk/reactos/dll/cpl/console/console.c     [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/console/console.c     [iso-8859-1] Sat Apr 12 
15:02:02 2014
@@ -296,22 +296,6 @@
             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 @@
          * 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);
     }


Reply via email to