From 44e8888c47bc54117ea71431c4ea238cef10dbd6 Mon Sep 17 00:00:00 2001 From: Jeffrey Morlan Date: Wed, 16 Jul 2008 00:24:54 +0000 Subject: [PATCH] Increment a console's initial screen buffer's reference count *after* calling CsrInitConsoleScreenBuffer (which sets the reference count to 0). Fixes bug 3524. svn path=/trunk/; revision=34539 --- reactos/subsystems/win32/csrss/win32csr/conio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reactos/subsystems/win32/csrss/win32csr/conio.c b/reactos/subsystems/win32/csrss/win32csr/conio.c index eb35befe17e..e770ae970eb 100644 --- a/reactos/subsystems/win32/csrss/win32csr/conio.c +++ b/reactos/subsystems/win32/csrss/win32csr/conio.c @@ -191,9 +191,6 @@ CsrInitConsole(PCSRSS_CONSOLE Console) /* make console active, and insert into console list */ Console->ActiveBuffer = (PCSRSS_SCREEN_BUFFER) NewBuffer; Console->hActiveBuffer = INVALID_HANDLE_VALUE; - /* add a reference count because the buffer is tied to the console */ - InterlockedIncrement(&Console->ActiveBuffer->Header.ReferenceCount); - if (! GuiMode) { @@ -230,6 +227,9 @@ CsrInitConsole(PCSRSS_CONSOLE Console) return Status; } + /* add a reference count because the buffer is tied to the console */ + InterlockedIncrement(&Console->ActiveBuffer->Header.ReferenceCount); + /* copy buffer contents to screen */ ConioDrawConsole(Console);