Author: jmorlan
Date: Sun May 23 17:56:37 2010
New Revision: 47326
URL:
http://svn.reactos.org/svn/reactos?rev=47326&view=rev
Log:
[KERNEL32], [WIN32CSR] Implement the CREATE_NO_WINDOW flag which creates a console with an
invisible window.
Modified:
trunk/reactos/dll/win32/kernel32/misc/console.c
trunk/reactos/dll/win32/kernel32/misc/dllmain.c
trunk/reactos/include/reactos/subsys/csrss/csrss.h
trunk/reactos/subsystems/win32/csrss/win32csr/conio.c
trunk/reactos/subsystems/win32/csrss/win32csr/guiconsole.c
trunk/reactos/subsystems/win32/csrss/win32csr/guiconsole.h
Modified: trunk/reactos/dll/win32/kernel32/misc/console.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/co…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/misc/console.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/misc/console.c [iso-8859-1] Sun May 23 17:56:37 2010
@@ -1692,6 +1692,7 @@
Request.Data.AllocConsoleRequest.CtrlDispatcher = ConsoleControlDispatcher;
Request.Data.AllocConsoleRequest.ConsoleNeeded = TRUE;
+ Request.Data.AllocConsoleRequest.Visible = TRUE;
CsrRequest = MAKE_CSR_API(ALLOC_CONSOLE, CSR_CONSOLE);
Modified: trunk/reactos/dll/win32/kernel32/misc/dllmain.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/dl…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/misc/dllmain.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/misc/dllmain.c [iso-8859-1] Sun May 23 17:56:37 2010
@@ -150,6 +150,7 @@
{
/* Assume one is needed */
Request.Data.AllocConsoleRequest.ConsoleNeeded = TRUE;
+ Request.Data.AllocConsoleRequest.Visible = TRUE;
/* Handle the special flags given to us by BasepInitializeEnvironment */
if (Parameters->ConsoleHandle == HANDLE_DETACHED_PROCESS)
@@ -168,8 +169,9 @@
else if (Parameters->ConsoleHandle == HANDLE_CREATE_NO_WINDOW)
{
/* We'll get the real one soon */
- DPRINT1("NOT SUPPORTED: HANDLE_CREATE_NO_WINDOW\n");
+ DPRINT("Creating new invisible console\n");
Parameters->ConsoleHandle = NULL;
+ Request.Data.AllocConsoleRequest.Visible = FALSE;
}
else
{
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 May 23 17:56:37
2010
@@ -80,7 +80,8 @@
typedef struct
{
PCONTROLDISPATCHER CtrlDispatcher;
- BOOL ConsoleNeeded;
+ BOOLEAN ConsoleNeeded;
+ BOOLEAN Visible;
HANDLE Console;
HANDLE InputHandle;
HANDLE OutputHandle;
Modified: trunk/reactos/subsystems/win32/csrss/win32csr/conio.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win…
==============================================================================
--- trunk/reactos/subsystems/win32/csrss/win32csr/conio.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrss/win32csr/conio.c [iso-8859-1] Sun May 23 17:56:37
2010
@@ -142,7 +142,7 @@
}
static NTSTATUS WINAPI
-CsrInitConsole(PCSRSS_CONSOLE Console)
+CsrInitConsole(PCSRSS_CONSOLE Console, BOOL Visible)
{
NTSTATUS Status;
SECURITY_ATTRIBUTES SecurityAttributes;
@@ -210,7 +210,7 @@
}
if (GuiMode)
{
- Status = GuiInitConsole(Console);
+ Status = GuiInitConsole(Console, Visible);
if (! NT_SUCCESS(Status))
{
HeapFree(Win32CsrApiHeap,0, NewBuffer);
@@ -286,7 +286,7 @@
/* insert process data required for GUI initialization */
InsertHeadList(&Console->ProcessList, &ProcessData->ProcessEntry);
/* Initialize the Console */
- Status = CsrInitConsole(Console);
+ Status = CsrInitConsole(Console, Request->Data.AllocConsoleRequest.Visible);
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 May 23
17:56:37 2010
@@ -2070,7 +2070,10 @@
if (NULL != NewWindow)
{
SetWindowLongW(hWnd, GWL_USERDATA, GetWindowLongW(hWnd, GWL_USERDATA) + 1);
- ShowWindow(NewWindow, SW_SHOW);
+ if (wParam)
+ {
+ ShowWindow(NewWindow, SW_SHOW);
+ }
}
return (LRESULT) NewWindow;
case PM_DESTROY_CONSOLE:
@@ -2250,7 +2253,7 @@
};
NTSTATUS FASTCALL
-GuiInitConsole(PCSRSS_CONSOLE Console)
+GuiInitConsole(PCSRSS_CONSOLE Console, BOOL Visible)
{
HANDLE GraphicsStartupEvent;
HANDLE ThreadHandle;
@@ -2317,7 +2320,7 @@
*/
GuiData->hGuiInitEvent = CreateEventW(NULL, FALSE, FALSE, NULL);
/* create console */
- PostMessageW(NotifyWnd, PM_CREATE_CONSOLE, 0, (LPARAM) Console);
+ PostMessageW(NotifyWnd, PM_CREATE_CONSOLE, Visible, (LPARAM) Console);
/* wait untill initialization has finished */
WaitForSingleObject(GuiData->hGuiInitEvent, INFINITE);
Modified: trunk/reactos/subsystems/win32/csrss/win32csr/guiconsole.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win…
==============================================================================
--- trunk/reactos/subsystems/win32/csrss/win32csr/guiconsole.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrss/win32csr/guiconsole.h [iso-8859-1] Sun May 23
17:56:37 2010
@@ -13,6 +13,6 @@
#define CONGUI_UPDATE_TIME 0
#define CONGUI_UPDATE_TIMER 1
-NTSTATUS FASTCALL GuiInitConsole(PCSRSS_CONSOLE Console);
+NTSTATUS FASTCALL GuiInitConsole(PCSRSS_CONSOLE Console, BOOL Visible);
/*EOF*/