Author: hbelusca
Date: Sun Nov 18 14:17:47 2012
New Revision: 57730
URL:
http://svn.reactos.org/svn/reactos?rev=57730&view=rev
Log:
[CONSRV]
Use the ConsoleGetPerProcessData macro (--> CONSOLE_PROCESS_DATA structure).
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:17:47
2012
@@ -1302,7 +1302,7 @@
return Status;
}
-CSR_API(SrvGetConsoleScreenBufferInfo) // CsrGetScreenBufferInfo
+CSR_API(SrvGetConsoleScreenBufferInfo)
{
NTSTATUS Status;
PCSRSS_SCREEN_BUFFER_INFO ScreenBufferInfoRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.ScreenBufferInfoRequest;
@@ -1312,11 +1312,9 @@
DPRINT("SrvGetConsoleScreenBufferInfo\n");
- Status = ConioLockScreenBuffer(CsrGetClientThread()->Process,
ScreenBufferInfoRequest->ConsoleHandle, &Buff, GENERIC_READ);
- if (! NT_SUCCESS(Status))
- {
- return Status;
- }
+ Status =
ConioLockScreenBuffer(ConsoleGetPerProcessData(CsrGetClientThread()->Process),
ScreenBufferInfoRequest->ConsoleHandle, &Buff, GENERIC_READ);
+ if (!NT_SUCCESS(Status)) return Status;
+
Console = Buff->Header.Console;
pInfo = &ScreenBufferInfoRequest->Info;
pInfo->dwSize.X = Buff->MaxX;
@@ -1344,11 +1342,9 @@
DPRINT("SrvSetConsoleActiveScreenBuffer\n");
- Status = ConioLockScreenBuffer(CsrGetClientThread()->Process,
SetScreenBufferRequest->OutputHandle, &Buff, GENERIC_WRITE);
- if (! NT_SUCCESS(Status))
- {
- return Status;
- }
+ Status =
ConioLockScreenBuffer(ConsoleGetPerProcessData(CsrGetClientThread()->Process),
SetScreenBufferRequest->OutputHandle, &Buff, GENERIC_WRITE);
+ if (!NT_SUCCESS(Status)) return Status;
+
Console = Buff->Header.Console;
if (Buff == Console->ActiveBuffer)
@@ -1362,8 +1358,10 @@
{
ConioDeleteScreenBuffer(Console->ActiveBuffer);
}
- /* tie console to new buffer */
+
+ /* Tie console to new buffer */
Console->ActiveBuffer = Buff;
+
/* Redraw the console */
ConioDrawConsole(Console);
@@ -1397,11 +1395,9 @@
DestinationOrigin = ScrollConsoleScreenBufferRequest->DestinationOrigin;
Fill = ScrollConsoleScreenBufferRequest->Fill;
- Status = ConioLockScreenBuffer(CsrGetClientThread()->Process, ConsoleHandle,
&Buff, GENERIC_WRITE);
- if (! NT_SUCCESS(Status))
- {
- return Status;
- }
+ Status =
ConioLockScreenBuffer(ConsoleGetPerProcessData(CsrGetClientThread()->Process),
ConsoleHandle, &Buff, GENERIC_WRITE);
+ if (!NT_SUCCESS(Status)) return Status;
+
Console = Buff->Header.Console;
ScrollRectangle = ScrollConsoleScreenBufferRequest->ScrollRectangle;
@@ -1470,17 +1466,12 @@
{
NTSTATUS Status;
PCSRSS_SET_SCREEN_BUFFER_SIZE SetScreenBufferSize =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetScreenBufferSize;
- PCSRSS_CONSOLE Console;
- PCSRSS_SCREEN_BUFFER Buff;
-
- Status = ConioLockScreenBuffer(CsrGetClientThread()->Process,
SetScreenBufferSize->OutputHandle, &Buff, GENERIC_WRITE);
- if (!NT_SUCCESS(Status))
- {
- return Status;
- }
- Console = Buff->Header.Console;
-
- Status = ConioResizeBuffer(Console, Buff, SetScreenBufferSize->Size);
+ PCSRSS_SCREEN_BUFFER Buff;
+
+ Status =
ConioLockScreenBuffer(ConsoleGetPerProcessData(CsrGetClientThread()->Process),
SetScreenBufferSize->OutputHandle, &Buff, GENERIC_WRITE);
+ if (!NT_SUCCESS(Status)) return Status;
+
+ Status = ConioResizeBuffer(Buff->Header.Console, Buff,
SetScreenBufferSize->Size);
ConioUnlockScreenBuffer(Buff);
return Status;