Author: rharabien
Date: Sun Nov 20 14:35:41 2011
New Revision: 54456
URL:
http://svn.reactos.org/svn/reactos?rev=54456&view=rev
Log:
[KERNEL32/WIN32CSR] - Use ShowCmd from STARTUPINFO when creating console window
Modified:
trunk/reactos/dll/win32/kernel32/client/dllmain.c
trunk/reactos/dll/win32/kernel32/client/file/console.c
trunk/reactos/include/reactos/subsys/csrss/csrss.h
trunk/reactos/subsystems/win32/csrss/win32csr/console.c
trunk/reactos/subsystems/win32/csrss/win32csr/guiconsole.c
Modified: trunk/reactos/dll/win32/kernel32/client/dllmain.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/dllmain.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/dllmain.c [iso-8859-1] Sun Nov 20 14:35:41
2011
@@ -67,6 +67,7 @@
BOOLEAN NotConsole = FALSE;
PRTL_USER_PROCESS_PARAMETERS Parameters = NtCurrentPeb()->ProcessParameters;
LPCWSTR ExeName;
+ STARTUPINFO si;
WCHAR lpTest[MAX_PATH];
GetModuleFileNameW(NULL, lpTest, MAX_PATH);
@@ -86,8 +87,9 @@
else
{
/* Assume one is needed */
+ GetStartupInfo(&si);
Request.Data.AllocConsoleRequest.ConsoleNeeded = TRUE;
- Request.Data.AllocConsoleRequest.Visible = TRUE;
+ Request.Data.AllocConsoleRequest.ShowCmd = si.wShowWindow;
/* Handle the special flags given to us by BasepInitializeEnvironment */
if (Parameters->ConsoleHandle == HANDLE_DETACHED_PROCESS)
@@ -108,7 +110,7 @@
/* We'll get the real one soon */
DPRINT("Creating new invisible console\n");
Parameters->ConsoleHandle = NULL;
- Request.Data.AllocConsoleRequest.Visible = FALSE;
+ Request.Data.AllocConsoleRequest.ShowCmd = SW_HIDE;
}
else
{
Modified: trunk/reactos/dll/win32/kernel32/client/file/console.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/file/console.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/file/console.c [iso-8859-1] Sun Nov 20
14:35:41 2011
@@ -1823,6 +1823,7 @@
ULONG CsrRequest;
NTSTATUS Status;
HANDLE hStdError;
+ STARTUPINFO si;
if (NtCurrentPeb()->ProcessParameters->ConsoleHandle)
{
@@ -1831,9 +1832,11 @@
return FALSE;
}
+ GetStartupInfo(&si);
+
Request.Data.AllocConsoleRequest.CtrlDispatcher = ConsoleControlDispatcher;
Request.Data.AllocConsoleRequest.ConsoleNeeded = TRUE;
- Request.Data.AllocConsoleRequest.Visible = TRUE;
+ Request.Data.AllocConsoleRequest.ShowCmd = si.wShowWindow;
CsrRequest = MAKE_CSR_API(ALLOC_CONSOLE, CSR_CONSOLE);
Modified: trunk/reactos/include/reactos/subsys/csrss/csrss.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/subsys/csr…
==============================================================================
--- trunk/reactos/include/reactos/subsys/csrss/csrss.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/subsys/csrss/csrss.h [iso-8859-1] Sun Nov 20 14:35:41
2011
@@ -83,7 +83,7 @@
{
PCONTROLDISPATCHER CtrlDispatcher;
BOOLEAN ConsoleNeeded;
- BOOLEAN Visible;
+ INT ShowCmd;
HANDLE Console;
HANDLE InputHandle;
HANDLE OutputHandle;
Modified: trunk/reactos/subsystems/win32/csrss/win32csr/console.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win…
==============================================================================
--- trunk/reactos/subsystems/win32/csrss/win32csr/console.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrss/win32csr/console.c [iso-8859-1] Sun Nov 20
14:35:41 2011
@@ -67,7 +67,7 @@
}
static NTSTATUS WINAPI
-CsrInitConsole(PCSRSS_CONSOLE Console, BOOL Visible)
+CsrInitConsole(PCSRSS_CONSOLE Console, int ShowCmd)
{
NTSTATUS Status;
SECURITY_ATTRIBUTES SecurityAttributes;
@@ -142,7 +142,7 @@
}
if (GuiMode)
{
- Status = GuiInitConsole(Console, Visible);
+ Status = GuiInitConsole(Console, ShowCmd);
if (! NT_SUCCESS(Status))
{
HeapFree(Win32CsrApiHeap,0, NewBuffer);
@@ -217,7 +217,7 @@
/* insert process data required for GUI initialization */
InsertHeadList(&Console->ProcessList, &ProcessData->ProcessEntry);
/* Initialize the Console */
- Status = CsrInitConsole(Console, Request->Data.AllocConsoleRequest.Visible);
+ Status = CsrInitConsole(Console, Request->Data.AllocConsoleRequest.ShowCmd);
if (!NT_SUCCESS(Status))
{
DPRINT1("Console init failed\n");
Modified: trunk/reactos/subsystems/win32/csrss/win32csr/guiconsole.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win…
==============================================================================
--- trunk/reactos/subsystems/win32/csrss/win32csr/guiconsole.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrss/win32csr/guiconsole.c [iso-8859-1] Sun Nov 20
14:35:41 2011
@@ -2097,10 +2097,7 @@
if (NULL != NewWindow)
{
SetWindowLongW(hWnd, GWL_USERDATA, GetWindowLongW(hWnd, GWL_USERDATA) + 1);
- if (wParam)
- {
- ShowWindow(NewWindow, SW_SHOW);
- }
+ ShowWindow(NewWindow, (int)wParam);
}
return (LRESULT) NewWindow;
case PM_DESTROY_CONSOLE:
@@ -2280,7 +2277,7 @@
};
NTSTATUS FASTCALL
-GuiInitConsole(PCSRSS_CONSOLE Console, BOOL Visible)
+GuiInitConsole(PCSRSS_CONSOLE Console, int ShowCmd)
{
HANDLE GraphicsStartupEvent;
HANDLE ThreadHandle;
@@ -2347,7 +2344,7 @@
*/
GuiData->hGuiInitEvent = CreateEventW(NULL, FALSE, FALSE, NULL);
/* create console */
- PostMessageW(NotifyWnd, PM_CREATE_CONSOLE, Visible, (LPARAM) Console);
+ PostMessageW(NotifyWnd, PM_CREATE_CONSOLE, ShowCmd, (LPARAM) Console);
/* wait untill initialization has finished */
WaitForSingleObject(GuiData->hGuiInitEvent, INFINITE);