Author: hbelusca
Date: Sun Nov 18 14:21:21 2012
New Revision: 57731
URL:
http://svn.reactos.org/svn/reactos?rev=57731&view=rev
Log:
[CONSRV]
- Use the ConsoleGetPerProcessData macro (--> CONSOLE_PROCESS_DATA structure).
- Do not forget to leave a critical section if we fail.
Modified:
branches/ros-csrss/win32ss/user/consrv/conoutput.c
Modified: branches/ros-csrss/win32ss/user/consrv/conoutput.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/c…
==============================================================================
--- branches/ros-csrss/win32ss/user/consrv/conoutput.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/consrv/conoutput.c [iso-8859-1] Sun Nov 18 14:21:21
2012
@@ -1239,23 +1239,24 @@
CSR_API(SrvCreateConsoleScreenBuffer)
{
+ NTSTATUS Status;
PCSRSS_CREATE_SCREEN_BUFFER CreateScreenBufferRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.CreateScreenBufferRequest;
- PCSR_PROCESS ProcessData = CsrGetClientThread()->Process;
+ PCONSOLE_PROCESS_DATA ProcessData =
ConsoleGetPerProcessData(CsrGetClientThread()->Process);
PCSRSS_CONSOLE Console;
PCSRSS_SCREEN_BUFFER Buff;
- NTSTATUS Status;
DPRINT("SrvCreateConsoleScreenBuffer\n");
RtlEnterCriticalSection(&ProcessData->HandleTableLock);
+
Status = ConioConsoleFromProcessData(ProcessData, &Console);
- if (! NT_SUCCESS(Status))
- {
+ if (!NT_SUCCESS(Status))
+ {
+ RtlLeaveCriticalSection(&ProcessData->HandleTableLock);
return Status;
}
Buff = HeapAlloc(ConSrvHeap, HEAP_ZERO_MEMORY, sizeof(CSRSS_SCREEN_BUFFER));
-
if (Buff != NULL)
{
if (Console->ActiveBuffer)
@@ -1298,7 +1299,9 @@
}
ConioUnlockConsole(Console);
+
RtlLeaveCriticalSection(&ProcessData->HandleTableLock);
+
return Status;
}