Author: jmorlan
Date: Sat Aug 2 17:09:22 2008
New Revision: 35049
URL:
http://svn.reactos.org/svn/reactos?rev=35049&view=rev
Log:
- Remove some redundant ProcessData == NULL checks - ClientConnectionThread already checks
this for every request.
- CsrApiCallHandler: Get rid of "Found" variable and just return when the right
definition is found.
- Make CsrApiCallHandler use the return value from the function (previously unused) to set
Request->Status, and trim the now-redundant Request->Status setting from tons of
CSR_API functions.
- CsrCreateProcess: Don't set shutdown parameters again - already set in
CsrCreateProcessData.
Modified:
trunk/reactos/subsystems/win32/csrss/api/handle.c
trunk/reactos/subsystems/win32/csrss/api/process.c
trunk/reactos/subsystems/win32/csrss/api/user.c
trunk/reactos/subsystems/win32/csrss/api/wapi.c
trunk/reactos/subsystems/win32/csrss/win32csr/alias.c
trunk/reactos/subsystems/win32/csrss/win32csr/conio.c
trunk/reactos/subsystems/win32/csrss/win32csr/desktopbg.c
trunk/reactos/subsystems/win32/csrss/win32csr/exitros.c
Modified: trunk/reactos/subsystems/win32/csrss/api/handle.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/api…
==============================================================================
--- trunk/reactos/subsystems/win32/csrss/api/handle.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrss/api/handle.c [iso-8859-1] Sat Aug 2 17:09:22
2008
@@ -66,10 +66,6 @@
ULONG h = (ULONG)Handle >> 2;
DPRINT("CsrGetObject, Object: %x, %x, %x\n", Object, Handle, ProcessData ?
ProcessData->HandleTableSize : 0);
- if (ProcessData == NULL)
- {
- return STATUS_INVALID_PARAMETER;
- }
RtlEnterCriticalSection(&ProcessData->HandleTableLock);
if (!CsrIsConsoleHandle(Handle) || h >= ProcessData->HandleTableSize
|| (*Object = ProcessData->HandleTable[h].Object) == NULL
@@ -117,10 +113,6 @@
ULONG h = (ULONG)Handle >> 2;
Object_t *Object;
- if (ProcessData == NULL)
- {
- return STATUS_INVALID_PARAMETER;
- }
RtlEnterCriticalSection(&ProcessData->HandleTableLock);
if (h >= ProcessData->HandleTableSize
|| (Object = ProcessData->HandleTable[h].Object) == NULL)
@@ -142,11 +134,6 @@
{
ULONG i;
PVOID* Block;
-
- if (ProcessData == NULL)
- {
- return STATUS_INVALID_PARAMETER;
- }
RtlEnterCriticalSection(&ProcessData->HandleTableLock);
@@ -188,9 +175,7 @@
{
ULONG i;
- if (SourceProcessData == NULL ||
- TargetProcessData == NULL ||
- TargetProcessData->HandleTableSize)
+ if (TargetProcessData->HandleTableSize)
{
return STATUS_INVALID_PARAMETER;
}
@@ -225,10 +210,6 @@
{
ULONG h = (ULONG)Handle >> 2;
- if (ProcessData == NULL)
- {
- return STATUS_INVALID_PARAMETER;
- }
if (h >= ProcessData->HandleTableSize
|| ProcessData->HandleTable[h].Object == NULL)
{
Modified: trunk/reactos/subsystems/win32/csrss/api/process.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/api…
==============================================================================
--- trunk/reactos/subsystems/win32/csrss/api/process.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrss/api/process.c [iso-8859-1] Sat Aug 2 17:09:22
2008
@@ -228,7 +228,6 @@
NewProcessData =
CsrCreateProcessData(Request->Data.CreateProcessRequest.NewProcessId);
if (NewProcessData == NULL)
{
- Request->Status = STATUS_NO_MEMORY;
return(STATUS_NO_MEMORY);
}
@@ -251,11 +250,6 @@
NewProcessData->ProcessGroup = ProcessData->ProcessGroup;
}
- /* Set default shutdown parameters */
- NewProcessData->ShutdownLevel = 0x280;
- NewProcessData->ShutdownFlags = 0;
-
- Request->Status = STATUS_SUCCESS;
return(STATUS_SUCCESS);
}
@@ -264,13 +258,7 @@
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
- if (ProcessData == NULL)
- {
- return(Request->Status = STATUS_INVALID_PARAMETER);
- }
-
ProcessData->Terminated = TRUE;
- Request->Status = STATUS_SUCCESS;
return STATUS_SUCCESS;
}
@@ -278,8 +266,6 @@
{
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
-
- Request->Status = STATUS_SUCCESS;
return(STATUS_SUCCESS);
}
@@ -289,16 +275,9 @@
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
- if (ProcessData == NULL)
- {
- return(Request->Status = STATUS_INVALID_PARAMETER);
- }
-
Request->Data.GetShutdownParametersRequest.Level = ProcessData->ShutdownLevel;
Request->Data.GetShutdownParametersRequest.Flags = ProcessData->ShutdownFlags;
- Request->Status = STATUS_SUCCESS;
-
return(STATUS_SUCCESS);
}
@@ -307,16 +286,9 @@
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
- if (ProcessData == NULL)
- {
- return(Request->Status = STATUS_INVALID_PARAMETER);
- }
-
ProcessData->ShutdownLevel = Request->Data.SetShutdownParametersRequest.Level;
ProcessData->ShutdownFlags = Request->Data.SetShutdownParametersRequest.Flags;
- Request->Status = STATUS_SUCCESS;
-
return(STATUS_SUCCESS);
}
@@ -325,12 +297,7 @@
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
- if (ProcessData == NULL)
- {
- Request->Data.GetInputHandleRequest.InputHandle = INVALID_HANDLE_VALUE;
- Request->Status = STATUS_INVALID_PARAMETER;
- }
- else if (ProcessData->Console)
+ if (ProcessData->Console)
{
Request->Status = CsrInsertObject(ProcessData,
&Request->Data.GetInputHandleRequest.InputHandle,
@@ -352,12 +319,7 @@
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
- if (ProcessData == NULL)
- {
- Request->Data.GetOutputHandleRequest.OutputHandle = INVALID_HANDLE_VALUE;
- Request->Status = STATUS_INVALID_PARAMETER;
- }
- else if (ProcessData->Console)
+ if (ProcessData->Console)
{
RtlEnterCriticalSection(&ProcessDataLock);
Request->Status = CsrInsertObject(ProcessData,
@@ -381,15 +343,7 @@
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
- if (ProcessData == NULL)
- {
- Request->Status = STATUS_INVALID_PARAMETER;
- }
- else
- {
- Request->Status = CsrReleaseObject(ProcessData,
Request->Data.CloseHandleRequest.Handle);
- }
- return Request->Status;
+ return CsrReleaseObject(ProcessData, Request->Data.CloseHandleRequest.Handle);
}
CSR_API(CsrVerifyHandle)
@@ -414,13 +368,6 @@
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) -
sizeof(PORT_MESSAGE);
-
- if (NULL == ProcessData)
- {
- DPRINT1("Invalid source process\n");
- Request->Status = STATUS_INVALID_PARAMETER;
- return Request->Status;
- }
Index = (ULONG)Request->Data.DuplicateHandleRequest.Handle >> 2;
RtlEnterCriticalSection(&ProcessData->HandleTableLock);
@@ -428,9 +375,8 @@
|| (Entry = &ProcessData->HandleTable[Index])->Object == NULL)
{
DPRINT1("Couldn't dup invalid handle %p\n",
Request->Data.DuplicateHandleRequest.Handle);
- Request->Status = STATUS_INVALID_HANDLE;
RtlLeaveCriticalSection(&ProcessData->HandleTableLock);
- return Request->Status;
+ return STATUS_INVALID_HANDLE;
}
if (Request->Data.DuplicateHandleRequest.Options & DUPLICATE_SAME_ACCESS)
@@ -445,9 +391,8 @@
{
DPRINT1("Handle %p only has access %X; requested %X\n",
Request->Data.DuplicateHandleRequest.Handle, Entry->Access,
DesiredAccess);
- Request->Status = STATUS_INVALID_PARAMETER;
RtlLeaveCriticalSection(&ProcessData->HandleTableLock);
- return Request->Status;
+ return STATUS_INVALID_PARAMETER;
}
}
@@ -473,18 +418,8 @@
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
- if (ProcessData == NULL)
- {
-
- Request->Data.GetConsoleInputWaitHandle.InputWaitHandle = INVALID_HANDLE_VALUE;
- Request->Status = STATUS_INVALID_PARAMETER;
- }
- else
- {
- Request->Data.GetConsoleInputWaitHandle.InputWaitHandle =
ProcessData->ConsoleEvent;
- Request->Status = STATUS_SUCCESS;
- }
- return Request->Status;
+ Request->Data.GetConsoleInputWaitHandle.InputWaitHandle =
ProcessData->ConsoleEvent;
+ return STATUS_SUCCESS;
}
/* EOF */
Modified: trunk/reactos/subsystems/win32/csrss/api/user.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/api…
==============================================================================
--- trunk/reactos/subsystems/win32/csrss/api/user.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrss/api/user.c [iso-8859-1] Sat Aug 2 17:09:22 2008
@@ -26,26 +26,20 @@
CSR_API(CsrRegisterServicesProcess)
{
- NTSTATUS Status;
-
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
if (ServicesProcessIdValid == TRUE)
{
/* Only accept a single call */
- Status = STATUS_INVALID_PARAMETER;
+ return STATUS_INVALID_PARAMETER;
}
else
{
ServicesProcessId =
(ULONG)Request->Data.RegisterServicesProcessRequest.ProcessId;
ServicesProcessIdValid = TRUE;
- Status = STATUS_SUCCESS;
+ return STATUS_SUCCESS;
}
-
- Request->Status = Status;
-
- return(Status);
}
/* EOF */
Modified: trunk/reactos/subsystems/win32/csrss/api/wapi.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/api…
==============================================================================
--- trunk/reactos/subsystems/win32/csrss/api/wapi.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrss/api/wapi.c [iso-8859-1] Sat Aug 2 17:09:22 2008
@@ -70,7 +70,6 @@
CsrApiCallHandler(PCSRSS_PROCESS_DATA ProcessData,
PCSR_API_MESSAGE Request)
{
- BOOL Found = FALSE;
unsigned DefIndex;
ULONG Type;
@@ -79,7 +78,7 @@
DPRINT("CSR: API Number: %x ServerID: %x\n",Type, Request->Type >>
16);
/* FIXME: Extract DefIndex instead of looping */
- for (DefIndex = 0; ! Found && DefIndex < ApiDefinitionsCount; DefIndex++)
+ for (DefIndex = 0; DefIndex < ApiDefinitionsCount; DefIndex++)
{
if (ApiDefinitions[DefIndex].Type == Type)
{
@@ -92,18 +91,15 @@
}
else
{
- (ApiDefinitions[DefIndex].Handler)(ProcessData, Request);
- Found = TRUE;
+ Request->Status = (ApiDefinitions[DefIndex].Handler)(ProcessData,
Request);
}
- }
- }
- if (! Found)
- {
- DPRINT1("CSR: Unknown request type 0x%x\n", Request->Type);
- Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
- Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) -
sizeof(PORT_MESSAGE);
- Request->Status = STATUS_INVALID_SYSTEM_SERVICE;
- }
+ return;
+ }
+ }
+ DPRINT1("CSR: Unknown request type 0x%x\n", Request->Type);
+ Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
+ Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
+ Request->Status = STATUS_INVALID_SYSTEM_SERVICE;
}
BOOL
Modified: trunk/reactos/subsystems/win32/csrss/win32csr/alias.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win…
==============================================================================
--- trunk/reactos/subsystems/win32/csrss/win32csr/alias.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrss/win32csr/alias.c [iso-8859-1] Sat Aug 2 17:09:22
2008
@@ -312,8 +312,7 @@
if (lpExeName == NULL || lpSource == NULL)
{
- Request->Status = STATUS_INVALID_PARAMETER;
- return Request->Status;
+ return STATUS_INVALID_PARAMETER;
}
Request->Status = ConioConsoleFromProcessData(ProcessData, &Console);
@@ -328,9 +327,8 @@
Header = IntCreateAliasHeader(lpExeName);
if (!Header)
{
- Request->Status = STATUS_INSUFFICIENT_RESOURCES;
ConioUnlockConsole(Console);
- return Request->Status;
+ return STATUS_INSUFFICIENT_RESOURCES;
}
IntInsertAliasHeader(&Console->Aliases, Header);
}
@@ -355,15 +353,13 @@
if (!Entry)
{
- Request->Status = STATUS_INSUFFICIENT_RESOURCES;
- ConioUnlockConsole(Console);
- return Request->Status;
+ ConioUnlockConsole(Console);
+ return STATUS_INSUFFICIENT_RESOURCES;
}
IntInsertAliasEntry(Header, Entry);
- Request->Status = STATUS_SUCCESS;
ConioUnlockConsole(Console);
- return Request->Status;
+ return STATUS_SUCCESS;
}
CSR_API(CsrGetConsoleAlias)
@@ -387,8 +383,7 @@
if (Request->Data.GetConsoleAlias.ExeLength == 0 || lpTarget == NULL ||
Request->Data.GetConsoleAlias.TargetBufferLength == 0 ||
Request->Data.GetConsoleAlias.SourceLength == 0)
{
- Request->Status = STATUS_INVALID_PARAMETER;
- return Request->Status;
+ return STATUS_INVALID_PARAMETER;
}
Request->Status = ConioConsoleFromProcessData(ProcessData, &Console);
@@ -400,39 +395,34 @@
Header = IntFindAliasHeader(Console->Aliases, lpExeName);
if (!Header)
{
- Request->Status = STATUS_INVALID_PARAMETER;
- ConioUnlockConsole(Console);
- return Request->Status;
+ ConioUnlockConsole(Console);
+ return STATUS_INVALID_PARAMETER;
}
Entry = IntGetAliasEntry(Header, lpSource);
if (!Entry)
{
- Request->Status = STATUS_INVALID_PARAMETER;
- ConioUnlockConsole(Console);
- return Request->Status;
+ ConioUnlockConsole(Console);
+ return STATUS_INVALID_PARAMETER;
}
Length = (wcslen(Entry->lpTarget)+1) * sizeof(WCHAR);
if (Length > Request->Data.GetConsoleAlias.TargetBufferLength)
{
- Request->Status = STATUS_BUFFER_TOO_SMALL;
- ConioUnlockConsole(Console);
- return Request->Status;
+ ConioUnlockConsole(Console);
+ return STATUS_BUFFER_TOO_SMALL;
}
if (!ValidateBuffer(ProcessData, lpTarget,
Request->Data.GetConsoleAlias.TargetBufferLength))
{
- Request->Status = STATUS_ACCESS_VIOLATION;
- ConioUnlockConsole(Console);
- return Request->Status;
+ ConioUnlockConsole(Console);
+ return STATUS_ACCESS_VIOLATION;
}
wcscpy(lpTarget, Entry->lpTarget);
Request->Data.GetConsoleAlias.BytesWritten = Length;
- Request->Status = STATUS_SUCCESS;
ConioUnlockConsole(Console);
- return Request->Status;
+ return STATUS_SUCCESS;
}
CSR_API(CsrGetAllConsoleAliases)
@@ -443,8 +433,7 @@
if (Request->Data.GetAllConsoleAlias.lpExeName == NULL)
{
- Request->Status = STATUS_INVALID_PARAMETER;
- return Request->Status;
+ return STATUS_INVALID_PARAMETER;
}
Request->Status = ConioConsoleFromProcessData(ProcessData, &Console);
@@ -456,25 +445,22 @@
Header = IntFindAliasHeader(Console->Aliases,
Request->Data.GetAllConsoleAlias.lpExeName);
if (!Header)
{
- Request->Status = STATUS_INVALID_PARAMETER;
- ConioUnlockConsole(Console);
- return Request->Status;
+ ConioUnlockConsole(Console);
+ return STATUS_INVALID_PARAMETER;
}
if (IntGetAllConsoleAliasesLength(Header) >
Request->Data.GetAllConsoleAlias.AliasBufferLength)
{
- Request->Status = STATUS_BUFFER_OVERFLOW;
- ConioUnlockConsole(Console);
- return Request->Status;
+ ConioUnlockConsole(Console);
+ return STATUS_BUFFER_OVERFLOW;
}
if (!ValidateBuffer(ProcessData,
Request->Data.GetAllConsoleAlias.AliasBuffer,
Request->Data.GetAllConsoleAlias.AliasBufferLength))
{
- Request->Status = STATUS_ACCESS_VIOLATION;
- ConioUnlockConsole(Console);
- return Request->Status;
+ ConioUnlockConsole(Console);
+ return STATUS_ACCESS_VIOLATION;
}
BytesWritten = IntGetAllConsoleAliases(Header,
@@ -482,9 +468,8 @@
Request->Data.GetAllConsoleAlias.AliasBufferLength);
Request->Data.GetAllConsoleAlias.BytesWritten = BytesWritten;
- Request->Status = STATUS_SUCCESS;
ConioUnlockConsole(Console);
- return Request->Status;
+ return STATUS_SUCCESS;
}
CSR_API(CsrGetAllConsoleAliasesLength)
@@ -495,8 +480,7 @@
if (Request->Data.GetAllConsoleAliasesLength.lpExeName == NULL)
{
- Request->Status = STATUS_INVALID_PARAMETER;
- return Request->Status;
+ return STATUS_INVALID_PARAMETER;
}
Request->Status = ConioConsoleFromProcessData(ProcessData, &Console);
@@ -508,17 +492,14 @@
Header = IntFindAliasHeader(Console->Aliases,
Request->Data.GetAllConsoleAliasesLength.lpExeName);
if (!Header)
{
- Request->Status = STATUS_INVALID_PARAMETER;
- ConioUnlockConsole(Console);
- return Request->Status;
+ ConioUnlockConsole(Console);
+ return STATUS_INVALID_PARAMETER;
}
Length = IntGetAllConsoleAliasesLength(Header);
Request->Data.GetAllConsoleAliasesLength.Length = Length;
- Request->Status = STATUS_SUCCESS;
ConioUnlockConsole(Console);
- return Request->Status;
-
+ return STATUS_SUCCESS;
}
CSR_API(CsrGetConsoleAliasesExes)
@@ -539,25 +520,22 @@
if (ExesLength > Request->Data.GetConsoleAliasesExes.Length)
{
- Request->Status = STATUS_BUFFER_OVERFLOW;
- ConioUnlockConsole(Console);
- return Request->Status;
+ ConioUnlockConsole(Console);
+ return STATUS_BUFFER_OVERFLOW;
}
if (Request->Data.GetConsoleAliasesExes.ExeNames == NULL)
{
- Request->Status = STATUS_INVALID_PARAMETER;
- ConioUnlockConsole(Console);
- return Request->Status;
+ ConioUnlockConsole(Console);
+ return STATUS_INVALID_PARAMETER;
}
if (!ValidateBuffer(ProcessData,
Request->Data.GetConsoleAliasesExes.ExeNames,
Request->Data.GetConsoleAliasesExes.Length))
{
- Request->Status = STATUS_ACCESS_VIOLATION;
- ConioUnlockConsole(Console);
- return Request->Status;
+ ConioUnlockConsole(Console);
+ return STATUS_ACCESS_VIOLATION;
}
BytesWritten = IntGetConsoleAliasesExes(Console->Aliases,
@@ -565,9 +543,8 @@
Request->Data.GetConsoleAliasesExes.Length);
Request->Data.GetConsoleAliasesExes.BytesWritten = BytesWritten;
- Request->Status = STATUS_SUCCESS;
ConioUnlockConsole(Console);
- return Request->Status;
+ return STATUS_SUCCESS;
}
CSR_API(CsrGetConsoleAliasesExesLength)
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] Sat Aug 2 17:09:22
2008
@@ -245,21 +245,11 @@
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) -
sizeof(PORT_MESSAGE);
- if (ProcessData == NULL)
- {
- DPRINT1("No process data\n");
- return Request->Status = STATUS_INVALID_PARAMETER;
- }
-
if (ProcessData->Console)
{
DPRINT1("Process already has a console\n");
- Request->Status = STATUS_INVALID_PARAMETER;
return STATUS_INVALID_PARAMETER;
}
-
- /* Assume success */
- Request->Status = STATUS_SUCCESS;
/* If we don't need a console, then get out of here */
if (!Request->Data.AllocConsoleRequest.ConsoleNeeded)
@@ -278,7 +268,6 @@
if (NULL == Console)
{
DPRINT1("Not enough memory for console\n");
- Request->Status = STATUS_NO_MEMORY;
return STATUS_NO_MEMORY;
}
/* initialize list head */
@@ -286,12 +275,12 @@
/* insert process data required for GUI initialization */
InsertHeadList(&Console->ProcessList, &ProcessData->ProcessEntry);
/* Initialize the Console */
- Request->Status = CsrInitConsole(Console);
- if (!NT_SUCCESS(Request->Status))
+ Status = CsrInitConsole(Console);
+ if (!NT_SUCCESS(Status))
{
DPRINT1("Console init failed\n");
HeapFree(Win32CsrApiHeap, 0, Console);
- return Request->Status;
+ return Status;
}
}
else
@@ -322,7 +311,7 @@
DPRINT1("Failed to insert object\n");
ConioDeleteConsole((Object_t *) Console);
ProcessData->Console = 0;
- return Request->Status = Status;
+ return Status;
}
Status = Win32CsrInsertObject(ProcessData,
@@ -337,7 +326,7 @@
Win32CsrReleaseObject(ProcessData,
Request->Data.AllocConsoleRequest.InputHandle);
ProcessData->Console = 0;
- return Request->Status = Status;
+ return Status;
}
}
@@ -360,7 +349,7 @@
Request->Data.AllocConsoleRequest.InputHandle);
}
ProcessData->Console = 0;
- return Request->Status = Status;
+ return Status;
}
/* Set the Ctrl Dispatcher */
@@ -384,9 +373,9 @@
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
- if (ProcessData == NULL || ProcessData->Console == NULL)
- {
- return Request->Status = STATUS_INVALID_PARAMETER;
+ if (ProcessData->Console == NULL)
+ {
+ return STATUS_INVALID_PARAMETER;
}
Console = ProcessData->Console;
@@ -576,7 +565,7 @@
&Console, GENERIC_READ);
if (! NT_SUCCESS(Status))
{
- return Request->Status = Status;
+ return Status;
}
Request->Data.ReadConsoleRequest.EventHandle = ProcessData->ConsoleEvent;
for (i = 0; i < nNumberOfCharsToRead && Console->InputEvents.Flink !=
&Console->InputEvents; i++)
@@ -619,7 +608,6 @@
ConioUnlockConsole(Console);
HeapFree(Win32CsrApiHeap, 0, Input);
Request->Data.ReadConsoleRequest.NrCharactersRead = 0;
- Request->Status = STATUS_NOTIFY_CLEANUP;
return STATUS_NOTIFY_CLEANUP;
}
@@ -653,27 +641,27 @@
Request->Data.ReadConsoleRequest.NrCharactersRead = i;
if (0 == i)
{
- Request->Status = STATUS_PENDING; /* we didn't read anything */
+ Status = STATUS_PENDING; /* we didn't read anything */
}
else if (0 != (Console->Mode & ENABLE_LINE_INPUT))
{
if (0 == Console->WaitingLines ||
(Request->Data.ReadConsoleRequest.Unicode ? (L'\n' !=
UnicodeBuffer[i - 1]) : ('\n' != Buffer[i - 1])))
{
- Request->Status = STATUS_PENDING; /* line buffered, didn't get a
complete line */
+ Status = STATUS_PENDING; /* line buffered, didn't get a complete line */
}
else
{
Console->WaitingLines--;
- Request->Status = STATUS_SUCCESS; /* line buffered, did get a complete line
*/
+ Status = STATUS_SUCCESS; /* line buffered, did get a complete line */
}
}
else
{
- Request->Status = STATUS_SUCCESS; /* not line buffered, did read something */
- }
-
- if (Request->Status == STATUS_PENDING)
+ Status = STATUS_SUCCESS; /* not line buffered, did read something */
+ }
+
+ if (Status == STATUS_PENDING)
{
Console->EchoCount = nNumberOfCharsToRead - i;
}
@@ -690,7 +678,7 @@
Request->Header.u1.s1.DataLength = Request->Header.u1.s1.TotalLength -
sizeof(PORT_MESSAGE);
}
- return Request->Status;
+ return Status;
}
BOOLEAN __inline ConioGetIntersection(
@@ -846,7 +834,7 @@
DPRINT1("Invalid request size\n");
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) -
sizeof(PORT_MESSAGE);
- return Request->Status = STATUS_INVALID_PARAMETER;
+ return STATUS_INVALID_PARAMETER;
}
Status = ConioConsoleFromProcessData(ProcessData, &Console);
@@ -855,7 +843,7 @@
if (! NT_SUCCESS(Status))
{
- return Request->Status = Status;
+ return Status;
}
if(Request->Data.WriteConsoleRequest.Unicode)
@@ -887,8 +875,8 @@
Status = ConioLockScreenBuffer(ProcessData,
Request->Data.WriteConsoleRequest.ConsoleHandle, &Buff, GENERIC_WRITE);
if (NT_SUCCESS(Status))
{
- Request->Status = ConioWriteConsole(Console, Buff, Buffer,
-
Request->Data.WriteConsoleRequest.NrCharactersToWrite, TRUE);
+ Status = ConioWriteConsole(Console, Buff, Buffer,
+
Request->Data.WriteConsoleRequest.NrCharactersToWrite, TRUE);
if (NT_SUCCESS(Status))
{
Written = Request->Data.WriteConsoleRequest.NrCharactersToWrite;
@@ -904,7 +892,7 @@
Request->Data.WriteConsoleRequest.NrCharactersWritten = Written;
- return Request->Status = Status;
+ return Status;
}
VOID STDCALL
@@ -1304,13 +1292,13 @@
Status = ConioConsoleFromProcessData(ProcessData, &Console);
if (! NT_SUCCESS(Status))
{
- return Request->Status = Status;
+ return Status;
}
Status = ConioLockScreenBuffer(ProcessData,
Request->Data.ScreenBufferInfoRequest.ConsoleHandle, &Buff, GENERIC_READ);
if (! NT_SUCCESS(Status))
{
ConioUnlockConsole(Console);
- return Request->Status = Status;
+ return Status;
}
pInfo = &Request->Data.ScreenBufferInfoRequest.Info;
pInfo->dwSize.X = Buff->MaxX;
@@ -1327,9 +1315,7 @@
ConioUnlockScreenBuffer(Buff);
ConioUnlockConsole(Console);
- Request->Status = STATUS_SUCCESS;
-
- return Request->Status;
+ return STATUS_SUCCESS;
}
CSR_API(CsrSetCursor)
@@ -1345,7 +1331,7 @@
Status = ConioConsoleFromProcessData(ProcessData, &Console);
if (! NT_SUCCESS(Status))
{
- return Request->Status = Status;
+ return Status;
}
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
@@ -1355,7 +1341,7 @@
if (! NT_SUCCESS(Status))
{
ConioUnlockConsole(Console);
- return Request->Status = Status;
+ return Status;
}
NewCursorX = Request->Data.SetCursorRequest.Position.X;
@@ -1365,7 +1351,7 @@
{
ConioUnlockScreenBuffer(Buff);
ConioUnlockConsole(Console);
- return Request->Status = STATUS_INVALID_PARAMETER;
+ return STATUS_INVALID_PARAMETER;
}
OldCursorX = Buff->CurrentX;
OldCursorY = Buff->CurrentY;
@@ -1377,14 +1363,14 @@
{
ConioUnlockScreenBuffer(Buff);
ConioUnlockConsole(Console);
- return Request->Status = STATUS_UNSUCCESSFUL;
+ return STATUS_UNSUCCESSFUL;
}
}
ConioUnlockScreenBuffer(Buff);
ConioUnlockConsole(Console);
- return Request->Status = STATUS_SUCCESS;
+ return STATUS_SUCCESS;
}
static VOID FASTCALL
@@ -1435,7 +1421,7 @@
DPRINT1("Invalid request size\n");
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) -
sizeof(PORT_MESSAGE);
- return Request->Status = STATUS_INVALID_PARAMETER;
+ return STATUS_INVALID_PARAMETER;
}
Status = ConioConsoleFromProcessData(ProcessData, &Console);
@@ -1514,7 +1500,7 @@
ConioUnlockConsole(Console);
}
Request->Data.WriteConsoleOutputCharRequest.NrCharactersWritten = Written;
- return Request->Status = Status;
+ return Status;
}
CSR_API(CsrFillOutputChar)
@@ -1535,14 +1521,14 @@
Status = ConioConsoleFromProcessData(ProcessData, &Console);
if (! NT_SUCCESS(Status))
{
- return Request->Status = Status;
+ return Status;
}
Status = ConioLockScreenBuffer(ProcessData,
Request->Data.FillOutputRequest.ConsoleHandle, &Buff, GENERIC_WRITE);
if (! NT_SUCCESS(Status))
{
ConioUnlockConsole(Console);
- return Request->Status = Status;
+ return Status;
}
X = Request->Data.FillOutputRequest.Position.X;
@@ -1580,7 +1566,7 @@
ConioUnlockConsole(Console);
Length = Request->Data.FillOutputRequest.Length;
Request->Data.FillOutputRequest.NrCharactersWritten = Length;
- return Request->Status;
+ return STATUS_SUCCESS;
}
CSR_API(CsrReadInputEvent)
@@ -1600,7 +1586,7 @@
Status = ConioLockConsole(ProcessData, Request->Data.ReadInputRequest.ConsoleHandle,
&Console, GENERIC_READ);
if (! NT_SUCCESS(Status))
{
- return Request->Status = Status;
+ return Status;
}
/* only get input if there is any */
@@ -1659,7 +1645,7 @@
ConioUnlockConsole(Console);
- return Request->Status = Status;
+ return Status;
}
CSR_API(CsrWriteConsoleOutputAttrib)
@@ -1681,7 +1667,7 @@
DPRINT1("Invalid request size\n");
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) -
sizeof(PORT_MESSAGE);
- return Request->Status = STATUS_INVALID_PARAMETER;
+ return STATUS_INVALID_PARAMETER;
}
Status = ConioConsoleFromProcessData(ProcessData, &Console);
@@ -1689,7 +1675,7 @@
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
if (! NT_SUCCESS(Status))
{
- return Request->Status = Status;
+ return Status;
}
Status = ConioLockScreenBuffer(ProcessData,
@@ -1699,7 +1685,7 @@
if (! NT_SUCCESS(Status))
{
ConioUnlockConsole(Console);
- return Request->Status = Status;
+ return Status;
}
X = Request->Data.WriteConsoleOutputAttribRequest.Coord.X;
@@ -1736,7 +1722,7 @@
ConioUnlockScreenBuffer(Buff);
- return Request->Status = STATUS_SUCCESS;
+ return STATUS_SUCCESS;
}
CSR_API(CsrFillOutputAttrib)
@@ -1754,7 +1740,7 @@
Status = ConioConsoleFromProcessData(ProcessData, &Console);
if (! NT_SUCCESS(Status))
{
- return Request->Status = Status;
+ return Status;
}
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
@@ -1763,7 +1749,7 @@
if (! NT_SUCCESS(Status))
{
ConioUnlockConsole(Console);
- return Request->Status = Status;
+ return Status;
}
X = Request->Data.FillOutputAttribRequest.Coord.X;
@@ -1796,7 +1782,7 @@
ConioUnlockScreenBuffer(Buff);
ConioUnlockConsole(Console);
- return Request->Status = STATUS_SUCCESS;
+ return STATUS_SUCCESS;
}
@@ -1813,13 +1799,13 @@
Status = ConioLockScreenBuffer(ProcessData,
Request->Data.GetCursorInfoRequest.ConsoleHandle, &Buff, GENERIC_READ);
if (! NT_SUCCESS(Status))
{
- return Request->Status = Status;
+ return Status;
}
Request->Data.GetCursorInfoRequest.Info.bVisible = Buff->CursorInfo.bVisible;
Request->Data.GetCursorInfoRequest.Info.dwSize = Buff->CursorInfo.dwSize;
ConioUnlockScreenBuffer(Buff);
- return Request->Status = STATUS_SUCCESS;
+ return STATUS_SUCCESS;
}
CSR_API(CsrSetCursorInfo)
@@ -1838,14 +1824,14 @@
Status = ConioConsoleFromProcessData(ProcessData, &Console);
if (! NT_SUCCESS(Status))
{
- return Request->Status = Status;
+ return Status;
}
Status = ConioLockScreenBuffer(ProcessData,
Request->Data.SetCursorInfoRequest.ConsoleHandle, &Buff, GENERIC_WRITE);
if (! NT_SUCCESS(Status))
{
ConioUnlockConsole(Console);
- return Request->Status = Status;
+ return Status;
}
Size = Request->Data.SetCursorInfoRequest.Info.dwSize;
@@ -1869,14 +1855,14 @@
{
ConioUnlockScreenBuffer(Buff);
ConioUnlockConsole(Console);
- return Request->Status = STATUS_UNSUCCESSFUL;
+ return STATUS_UNSUCCESSFUL;
}
}
ConioUnlockScreenBuffer(Buff);
ConioUnlockConsole(Console);
- return Request->Status = STATUS_SUCCESS;
+ return STATUS_SUCCESS;
}
CSR_API(CsrSetTextAttrib)
@@ -1890,14 +1876,14 @@
Status = ConioConsoleFromProcessData(ProcessData, &Console);
if (! NT_SUCCESS(Status))
{
- return Request->Status = Status;
+ return Status;
}
Status = ConioLockScreenBuffer(ProcessData,
Request->Data.SetCursorRequest.ConsoleHandle, &Buff, GENERIC_WRITE);
if (! NT_SUCCESS(Status))
{
ConioUnlockConsole(Console);
- return Request->Status = Status;
+ return Status;
}
Buff->DefaultAttrib = Request->Data.SetAttribRequest.Attrib;
@@ -1907,14 +1893,14 @@
{
ConioUnlockScreenBuffer(Buff);
ConioUnlockConsole(Console);
- return Request->Status = STATUS_UNSUCCESSFUL;
+ return STATUS_UNSUCCESSFUL;
}
}
ConioUnlockScreenBuffer(Buff);
ConioUnlockConsole(Console);
- return Request->Status = STATUS_SUCCESS;
+ return STATUS_SUCCESS;
}
CSR_API(CsrSetConsoleMode)
@@ -1932,7 +1918,7 @@
(Object_t **) &Console, GENERIC_WRITE);
if (! NT_SUCCESS(Status))
{
- return Request->Status = Status;
+ return Status;
}
Buff = (PCSRSS_SCREEN_BUFFER)Console;
@@ -1951,7 +1937,7 @@
Win32CsrReleaseObjectByPointer((Object_t *)Console);
- return Request->Status = Status;
+ return Status;
}
CSR_API(CsrGetConsoleMode)
@@ -1968,9 +1954,9 @@
(Object_t **) &Console, GENERIC_READ);
if (! NT_SUCCESS(Status))
{
- return Request->Status = Status;
- }
- Request->Status = STATUS_SUCCESS;
+ return Status;
+ }
+ Status = STATUS_SUCCESS;
Buff = (PCSRSS_SCREEN_BUFFER) Console;
if (CONIO_CONSOLE_MAGIC == Console->Header.Type)
{
@@ -1982,11 +1968,11 @@
}
else
{
- Request->Status = STATUS_INVALID_HANDLE;
+ Status = STATUS_INVALID_HANDLE;
}
Win32CsrReleaseObjectByPointer((Object_t *)Console);
- return Request->Status;
+ return Status;
}
CSR_API(CsrCreateScreenBuffer)
@@ -1997,15 +1983,10 @@
DPRINT("CsrCreateScreenBuffer\n");
- if (ProcessData == NULL)
- {
- return Request->Status = STATUS_INVALID_PARAMETER;
- }
-
Status = ConioConsoleFromProcessData(ProcessData, &Console);
if (! NT_SUCCESS(Status))
{
- return Request->Status = Status;
+ return Status;
}
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
@@ -2039,13 +2020,9 @@
}
Status = CsrInitConsoleScreenBuffer(Console, Buff);
- if(! NT_SUCCESS(Status))
- {
- Request->Status = Status;
- }
- else
- {
- Request->Status = Win32CsrInsertObject(ProcessData,
+ if(NT_SUCCESS(Status))
+ {
+ Status = Win32CsrInsertObject(ProcessData,
&Request->Data.CreateScreenBufferRequest.OutputHandle,
&Buff->Header,
Request->Data.CreateScreenBufferRequest.Access,
@@ -2054,11 +2031,11 @@
}
else
{
- Request->Status = STATUS_INSUFFICIENT_RESOURCES;
+ Status = STATUS_INSUFFICIENT_RESOURCES;
}
ConioUnlockConsole(Console);
- return Request->Status;
+ return Status;
}
CSR_API(CsrSetScreenBuffer)
@@ -2072,7 +2049,7 @@
Status = ConioConsoleFromProcessData(ProcessData, &Console);
if (! NT_SUCCESS(Status))
{
- return Request->Status = Status;
+ return Status;
}
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
@@ -2082,14 +2059,14 @@
if (! NT_SUCCESS(Status))
{
ConioUnlockConsole(Console);
- return Request->Status = Status;
+ return Status;
}
if (Buff == Console->ActiveBuffer)
{
ConioUnlockScreenBuffer(Buff);
ConioUnlockConsole(Console);
- return Request->Status = STATUS_SUCCESS;
+ return STATUS_SUCCESS;
}
/* drop reference to old buffer, maybe delete */
@@ -2107,7 +2084,7 @@
ConioUnlockScreenBuffer(Buff);
ConioUnlockConsole(Console);
- return Request->Status = STATUS_SUCCESS;
+ return STATUS_SUCCESS;
}
CSR_API(CsrSetTitle)
@@ -2125,17 +2102,13 @@
DPRINT1("Invalid request size\n");
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) -
sizeof(PORT_MESSAGE);
- return Request->Status = STATUS_INVALID_PARAMETER;
+ return STATUS_INVALID_PARAMETER;
}
Status = ConioConsoleFromProcessData(ProcessData, &Console);
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
- if(! NT_SUCCESS(Status))
- {
- Request->Status = Status;
- }
- else
+ if(NT_SUCCESS(Status))
{
Buffer = RtlAllocateHeap(RtlGetProcessHeap(), 0,
Request->Data.SetTitleRequest.Length);
if (Buffer)
@@ -2147,21 +2120,21 @@
memcpy(Console->Title.Buffer, Request->Data.SetTitleRequest.Title,
Console->Title.Length);
if (! ConioChangeTitle(Console))
{
- Request->Status = STATUS_UNSUCCESSFUL;
+ Status = STATUS_UNSUCCESSFUL;
}
else
{
- Request->Status = STATUS_SUCCESS;
+ Status = STATUS_SUCCESS;
}
}
else
{
- Request->Status = STATUS_NO_MEMORY;
+ Status = STATUS_NO_MEMORY;
}
ConioUnlockConsole(Console);
}
- return Request->Status;
+ return Status;
}
CSR_API(CsrGetTitle)
@@ -2178,7 +2151,7 @@
if (! NT_SUCCESS(Status))
{
DPRINT1("Can't get console\n");
- return Request->Status = Status;
+ return Status;
}
/* Copy title of the console to the user title buffer */
@@ -2195,9 +2168,7 @@
Request->Header.u1.s1.TotalLength = Length;
Request->Header.u1.s1.DataLength = Length - sizeof(PORT_MESSAGE);
}
- Request->Status = STATUS_SUCCESS;
-
- return Request->Status;
+ return STATUS_SUCCESS;
}
CSR_API(CsrWriteConsoleOutput)
@@ -2220,7 +2191,7 @@
Status = ConioConsoleFromProcessData(ProcessData, &Console);
if (! NT_SUCCESS(Status))
{
- return Request->Status = Status;
+ return Status;
}
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
@@ -2232,7 +2203,7 @@
if (! NT_SUCCESS(Status))
{
ConioUnlockConsole(Console);
- return Request->Status = Status;
+ return Status;
}
BufferSize = Request->Data.WriteConsoleOutputRequest.BufferSize;
@@ -2245,7 +2216,7 @@
{
ConioUnlockScreenBuffer(Buff);
ConioUnlockConsole(Console);
- return Request->Status = STATUS_ACCESS_VIOLATION;
+ return STATUS_ACCESS_VIOLATION;
}
WriteRegion.left = Request->Data.WriteConsoleOutputRequest.WriteRegion.Left;
WriteRegion.top = Request->Data.WriteConsoleOutputRequest.WriteRegion.Top;
@@ -2266,7 +2237,7 @@
/* It is okay to have a WriteRegion completely outside the screen buffer.
No data is written then. */
- return Request->Status = STATUS_SUCCESS;
+ return STATUS_SUCCESS;
}
for (i = 0, Y = WriteRegion.top; Y <= WriteRegion.bottom; i++, Y++)
@@ -2300,7 +2271,7 @@
Request->Data.WriteConsoleOutputRequest.WriteRegion.Left = WriteRegion.left;
Request->Data.WriteConsoleOutputRequest.WriteRegion.Top = WriteRegion.top;
- return Request->Status = STATUS_SUCCESS;
+ return STATUS_SUCCESS;
}
CSR_API(CsrFlushInputBuffer)
@@ -2320,7 +2291,7 @@
GENERIC_WRITE);
if(! NT_SUCCESS(Status))
{
- return Request->Status = Status;
+ return Status;
}
/* Discard all entries in the input event queue */
@@ -2336,7 +2307,7 @@
ConioUnlockConsole(Console);
- return Request->Status = STATUS_SUCCESS;
+ return STATUS_SUCCESS;
}
CSR_API(CsrScrollConsoleScreenBuffer)
@@ -2366,7 +2337,7 @@
Status = ConioConsoleFromProcessData(ProcessData, &Console);
if (! NT_SUCCESS(Status))
{
- return Request->Status = Status;
+ return Status;
}
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
@@ -2375,7 +2346,7 @@
if (! NT_SUCCESS(Status))
{
ConioUnlockConsole(Console);
- return Request->Status = Status;
+ return Status;
}
ScrollRectangle.left =
Request->Data.ScrollConsoleScreenBufferRequest.ScrollRectangle.Left;
@@ -2389,7 +2360,7 @@
{
ConioUnlockScreenBuffer(Buff);
ConioUnlockConsole(Console);
- return Request->Status = STATUS_SUCCESS;
+ return STATUS_SUCCESS;
}
/* If the source was clipped on the left or top, adjust the destination accordingly */
@@ -2412,7 +2383,7 @@
{
ConioUnlockConsole(Console);
ConioUnlockScreenBuffer(Buff);
- return Request->Status = STATUS_SUCCESS;
+ return STATUS_SUCCESS;
}
}
else
@@ -2446,7 +2417,7 @@
ConioUnlockScreenBuffer(Buff);
ConioUnlockConsole(Console);
- return Request->Status = STATUS_SUCCESS;
+ return STATUS_SUCCESS;
}
CSR_API(CsrReadConsoleOutputChar)
@@ -2471,14 +2442,14 @@
Status = ConioConsoleFromProcessData(ProcessData, &Console);
if (! NT_SUCCESS(Status))
{
- return Request->Status = Status;
+ return Status;
}
Status = ConioLockScreenBuffer(ProcessData,
Request->Data.ReadConsoleOutputCharRequest.ConsoleHandle, &Buff, GENERIC_READ);
if (! NT_SUCCESS(Status))
{
ConioUnlockConsole(Console);
- return Request->Status = Status;
+ return Status;
}
Xpos = Request->Data.ReadConsoleOutputCharRequest.ReadCoord.X;
@@ -2511,7 +2482,6 @@
}
*ReadBuffer = 0;
- Request->Status = STATUS_SUCCESS;
Request->Data.ReadConsoleOutputCharRequest.EndCoord.X = Xpos;
Request->Data.ReadConsoleOutputCharRequest.EndCoord.Y = (Ypos - Buff->VirtualY +
Buff->MaxY) % Buff->MaxY;
@@ -2525,7 +2495,7 @@
Request->Header.u1.s1.DataLength = Request->Header.u1.s1.TotalLength -
sizeof(PORT_MESSAGE);
}
- return Request->Status;
+ return STATUS_SUCCESS;
}
@@ -2547,7 +2517,7 @@
Status = ConioLockScreenBuffer(ProcessData,
Request->Data.ReadConsoleOutputAttribRequest.ConsoleHandle, &Buff, GENERIC_READ);
if (! NT_SUCCESS(Status))
{
- return Request->Status = Status;
+ return Status;
}
Xpos = Request->Data.ReadConsoleOutputAttribRequest.ReadCoord.X;
@@ -2574,7 +2544,6 @@
*ReadBuffer = 0;
- Request->Status = STATUS_SUCCESS;
Request->Data.ReadConsoleOutputAttribRequest.EndCoord.X = Xpos;
Request->Data.ReadConsoleOutputAttribRequest.EndCoord.Y = (Ypos - Buff->VirtualY
+ Buff->MaxY) % Buff->MaxY;
@@ -2588,7 +2557,7 @@
Request->Header.u1.s1.DataLength = CurrentLength - sizeof(PORT_MESSAGE);
}
- return Request->Status;
+ return STATUS_SUCCESS;
}
@@ -2608,7 +2577,7 @@
Status = ConioLockConsole(ProcessData,
Request->Data.GetNumInputEventsRequest.ConsoleHandle, &Console, GENERIC_READ);
if (! NT_SUCCESS(Status))
{
- return Request->Status = Status;
+ return Status;
}
CurrentItem = Console->InputEvents.Flink;
@@ -2627,10 +2596,9 @@
ConioUnlockConsole(Console);
- Request->Status = STATUS_SUCCESS;
Request->Data.GetNumInputEventsRequest.NumInputEvents = NumEvents;
- return Request->Status;
+ return STATUS_SUCCESS;
}
@@ -2653,7 +2621,7 @@
Status = ConioLockConsole(ProcessData,
Request->Data.GetNumInputEventsRequest.ConsoleHandle, &Console, GENERIC_READ);
if(! NT_SUCCESS(Status))
{
- return Request->Status = Status;
+ return Status;
}
InputRecord = Request->Data.PeekConsoleInputRequest.InputRecord;
@@ -2664,8 +2632,7 @@
|| (((ULONG_PTR)InputRecord + Size) >
((ULONG_PTR)ProcessData->CsrSectionViewBase + ProcessData->CsrSectionViewSize)))
{
ConioUnlockConsole(Console);
- Request->Status = STATUS_ACCESS_VIOLATION;
- return Request->Status ;
+ return STATUS_ACCESS_VIOLATION;
}
NumItems = 0;
@@ -2699,10 +2666,9 @@
ConioUnlockConsole(Console);
- Request->Status = STATUS_SUCCESS;
Request->Data.PeekConsoleInputRequest.Length = NumItems;
- return Request->Status;
+ return STATUS_SUCCESS;
}
@@ -2732,7 +2698,7 @@
Status = ConioLockScreenBuffer(ProcessData,
Request->Data.ReadConsoleOutputRequest.ConsoleHandle, &Buff, GENERIC_READ);
if (! NT_SUCCESS(Status))
{
- return Request->Status = Status;
+ return Status;
}
CharInfo = Request->Data.ReadConsoleOutputRequest.CharInfo;
@@ -2752,8 +2718,7 @@
|| (((ULONG_PTR)CharInfo + Size) >
((ULONG_PTR)ProcessData->CsrSectionViewBase + ProcessData->CsrSectionViewSize)))
{
ConioUnlockScreenBuffer(Buff);
- Request->Status = STATUS_ACCESS_VIOLATION;
- return Request->Status ;
+ return STATUS_ACCESS_VIOLATION;
}
SizeY = min(BufferSize.Y - BufferCoord.Y, ConioRectHeight(&ReadRegion));
@@ -2765,8 +2730,7 @@
if (! ConioGetIntersection(&ReadRegion, &ScreenRect, &ReadRegion))
{
ConioUnlockScreenBuffer(Buff);
- Request->Status = STATUS_SUCCESS;
- return Request->Status;
+ return STATUS_SUCCESS;
}
for (i = 0, Y = ReadRegion.top; Y < ReadRegion.bottom; ++i, ++Y)
@@ -2793,13 +2757,12 @@
ConioUnlockScreenBuffer(Buff);
- Request->Status = STATUS_SUCCESS;
Request->Data.ReadConsoleOutputRequest.ReadRegion.Right = ReadRegion.left + SizeX -
1;
Request->Data.ReadConsoleOutputRequest.ReadRegion.Bottom = ReadRegion.top + SizeY -
1;
Request->Data.ReadConsoleOutputRequest.ReadRegion.Left = ReadRegion.left;
Request->Data.ReadConsoleOutputRequest.ReadRegion.Top = ReadRegion.top;
- return Request->Status;
+ return STATUS_SUCCESS;
}
@@ -2821,7 +2784,7 @@
Status = ConioLockConsole(ProcessData,
Request->Data.WriteConsoleInputRequest.ConsoleHandle, &Console, GENERIC_WRITE);
if (! NT_SUCCESS(Status))
{
- return Request->Status = Status;
+ return Status;
}
InputRecord = Request->Data.WriteConsoleInputRequest.InputRecord;
@@ -2832,8 +2795,7 @@
|| (((ULONG_PTR)InputRecord + Size) >
((ULONG_PTR)ProcessData->CsrSectionViewBase + ProcessData->CsrSectionViewSize)))
{
ConioUnlockConsole(Console);
- Request->Status = STATUS_ACCESS_VIOLATION;
- return Request->Status ;
+ return STATUS_ACCESS_VIOLATION;
}
for (i = 0; i < Length; i++)
@@ -2842,8 +2804,7 @@
if (NULL == Record)
{
ConioUnlockConsole(Console);
- Request->Status = STATUS_INSUFFICIENT_RESOURCES;
- return Request->Status;
+ return STATUS_INSUFFICIENT_RESOURCES;
}
Record->Echoed = FALSE;
@@ -2859,10 +2820,9 @@
ConioUnlockConsole(Console);
- Request->Status = STATUS_SUCCESS;
Request->Data.WriteConsoleInputRequest.Length = i;
- return Request->Status;
+ return STATUS_SUCCESS;
}
/**********************************************************************
@@ -2917,7 +2877,7 @@
if (! NT_SUCCESS(Status))
{
DPRINT1("Failed to get console handle in SetConsoleHardwareState\n");
- return Request->Status = Status;
+ return Status;
}
switch (Request->Data.ConsoleHardwareStateRequest.SetGet)
@@ -2928,17 +2888,17 @@
case CONSOLE_HARDWARE_STATE_SET:
DPRINT("Setting console hardware state.\n");
- Request->Status = SetConsoleHardwareState(Console,
Request->Data.ConsoleHardwareStateRequest.State);
+ Status = SetConsoleHardwareState(Console,
Request->Data.ConsoleHardwareStateRequest.State);
break;
default:
- Request->Status = STATUS_INVALID_PARAMETER_2; /* Client: (handle, [set_get],
mode) */
+ Status = STATUS_INVALID_PARAMETER_2; /* Client: (handle, [set_get], mode) */
break;
}
ConioUnlockConsole(Console);
- return Request->Status;
+ return Status;
}
CSR_API(CsrGetConsoleWindow)
@@ -2954,13 +2914,13 @@
Status = ConioConsoleFromProcessData(ProcessData, &Console);
if (! NT_SUCCESS(Status))
{
- return Request->Status = Status;
+ return Status;
}
Request->Data.GetConsoleWindowRequest.WindowHandle = Console->hWindow;
ConioUnlockConsole(Console);
- return Request->Status = STATUS_SUCCESS;
+ return STATUS_SUCCESS;
}
CSR_API(CsrSetConsoleIcon)
@@ -2976,14 +2936,14 @@
Status = ConioConsoleFromProcessData(ProcessData, &Console);
if (! NT_SUCCESS(Status))
{
- return Request->Status = Status;
- }
-
- Request->Status = (ConioChangeIcon(Console,
Request->Data.SetConsoleIconRequest.WindowIcon)
- ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL);
+ return Status;
+ }
+
+ Status = (ConioChangeIcon(Console, Request->Data.SetConsoleIconRequest.WindowIcon)
+ ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL);
ConioUnlockConsole(Console);
- return Request->Status;
+ return Status;
}
CSR_API(CsrGetConsoleCodePage)
@@ -2996,14 +2956,14 @@
Status = ConioConsoleFromProcessData(ProcessData, &Console);
if (! NT_SUCCESS(Status))
{
- return Request->Status = Status;
+ return Status;
}
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
Request->Data.GetConsoleCodePage.CodePage = Console->CodePage;
ConioUnlockConsole(Console);
- return Request->Status = STATUS_SUCCESS;
+ return STATUS_SUCCESS;
}
CSR_API(CsrSetConsoleCodePage)
@@ -3016,7 +2976,7 @@
Status = ConioConsoleFromProcessData(ProcessData, &Console);
if (! NT_SUCCESS(Status))
{
- return Request->Status = Status;
+ return Status;
}
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
@@ -3025,10 +2985,10 @@
{
Console->CodePage = Request->Data.SetConsoleCodePage.CodePage;
ConioUnlockConsole(Console);
- return Request->Status = STATUS_SUCCESS;
+ return STATUS_SUCCESS;
}
ConioUnlockConsole(Console);
- return Request->Status = STATUS_UNSUCCESSFUL;
+ return STATUS_UNSUCCESSFUL;
}
CSR_API(CsrGetConsoleOutputCodePage)
@@ -3041,14 +3001,14 @@
Status = ConioConsoleFromProcessData(ProcessData, &Console);
if (! NT_SUCCESS(Status))
{
- return Request->Status = Status;
+ return Status;
}
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
Request->Data.GetConsoleOutputCodePage.CodePage = Console->OutputCodePage;
ConioUnlockConsole(Console);
- return Request->Status = STATUS_SUCCESS;
+ return STATUS_SUCCESS;
}
CSR_API(CsrSetConsoleOutputCodePage)
@@ -3061,7 +3021,7 @@
Status = ConioConsoleFromProcessData(ProcessData, &Console);
if (! NT_SUCCESS(Status))
{
- return Request->Status = Status;
+ return Status;
}
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
@@ -3070,10 +3030,10 @@
{
Console->OutputCodePage = Request->Data.SetConsoleOutputCodePage.CodePage;
ConioUnlockConsole(Console);
- return Request->Status = STATUS_SUCCESS;
+ return STATUS_SUCCESS;
}
ConioUnlockConsole(Console);
- return Request->Status = STATUS_UNSUCCESSFUL;
+ return STATUS_UNSUCCESSFUL;
}
CSR_API(CsrGetProcessList)
@@ -3098,7 +3058,7 @@
Status = ConioConsoleFromProcessData(ProcessData, &Console);
if (! NT_SUCCESS(Status))
{
- return Request->Status = Status;
+ return Status;
}
DPRINT1("Console_Api Ctrl-C\n");
@@ -3126,7 +3086,7 @@
Request->Header.u1.s1.TotalLength = Length;
Request->Header.u1.s1.DataLength = Length - sizeof(PORT_MESSAGE);
}
- return Request->Status = STATUS_SUCCESS;
+ return STATUS_SUCCESS;
}
CSR_API(CsrGenerateCtrlEvent)
@@ -3143,7 +3103,7 @@
Status = ConioConsoleFromProcessData(ProcessData, &Console);
if (! NT_SUCCESS(Status))
{
- return Request->Status = Status;
+ return Status;
}
Group = Request->Data.GenerateCtrlEvent.ProcessGroup;
@@ -3162,7 +3122,7 @@
ConioUnlockConsole(Console);
- return Request->Status = Status;
+ return Status;
}
/* EOF */
Modified: trunk/reactos/subsystems/win32/csrss/win32csr/desktopbg.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win…
==============================================================================
--- trunk/reactos/subsystems/win32/csrss/win32csr/desktopbg.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrss/win32csr/desktopbg.c [iso-8859-1] Sat Aug 2
17:09:22 2008
@@ -209,7 +209,7 @@
BgInitialized = TRUE;
if (! DtbgInit())
{
- return Request->Status = STATUS_UNSUCCESSFUL;
+ return STATUS_UNSUCCESSFUL;
}
}
@@ -222,7 +222,7 @@
if (NULL == ThreadData.Event)
{
DPRINT1("Failed to create event (error %d)\n", GetLastError());
- return Request->Status = STATUS_UNSUCCESSFUL;
+ return STATUS_UNSUCCESSFUL;
}
ThreadHandle = CreateThread(NULL,
0,
@@ -234,16 +234,14 @@
{
CloseHandle(ThreadData.Event);
DPRINT1("Failed to create desktop window thread.\n");
- return Request->Status = STATUS_UNSUCCESSFUL;
+ return STATUS_UNSUCCESSFUL;
}
CloseHandle(ThreadHandle);
WaitForSingleObject(ThreadData.Event, INFINITE);
CloseHandle(ThreadData.Event);
- Request->Status = ThreadData.Status;
-
- return Request->Status;
+ return ThreadData.Status;
}
CSR_API(CsrShowDesktop)
@@ -261,13 +259,11 @@
nmh.ShowDesktop.Width = (int)Request->Data.ShowDesktopRequest.Width;
nmh.ShowDesktop.Height = (int)Request->Data.ShowDesktopRequest.Height;
- Request->Status = SendMessageW(Request->Data.ShowDesktopRequest.DesktopWindow,
- WM_NOTIFY,
- (WPARAM)nmh.hdr.hwndFrom,
- (LPARAM)&nmh)
- ? STATUS_UNSUCCESSFUL : STATUS_SUCCESS;
-
- return Request->Status;
+ return SendMessageW(Request->Data.ShowDesktopRequest.DesktopWindow,
+ WM_NOTIFY,
+ (WPARAM)nmh.hdr.hwndFrom,
+ (LPARAM)&nmh)
+ ? STATUS_UNSUCCESSFUL : STATUS_SUCCESS;
}
CSR_API(CsrHideDesktop)
@@ -282,13 +278,11 @@
nmh.hdr.idFrom = 0;
nmh.hdr.code = PM_HIDE_DESKTOP;
- Request->Status = SendMessageW(Request->Data.ShowDesktopRequest.DesktopWindow,
- WM_NOTIFY,
- (WPARAM)nmh.hdr.hwndFrom,
- (LPARAM)&nmh)
- ? STATUS_UNSUCCESSFUL : STATUS_SUCCESS;
-
- return Request->Status;
+ return SendMessageW(Request->Data.ShowDesktopRequest.DesktopWindow,
+ WM_NOTIFY,
+ (WPARAM)nmh.hdr.hwndFrom,
+ (LPARAM)&nmh)
+ ? STATUS_UNSUCCESSFUL : STATUS_SUCCESS;
}
BOOL FASTCALL
Modified: trunk/reactos/subsystems/win32/csrss/win32csr/exitros.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win…
==============================================================================
--- trunk/reactos/subsystems/win32/csrss/win32csr/exitros.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrss/win32csr/exitros.c [iso-8859-1] Sat Aug 2
17:09:22 2008
@@ -27,8 +27,7 @@
{
if (0 != LogonProcess)
{
- Request->Status = STATUS_LOGON_SESSION_EXISTS;
- return Request->Status;
+ return STATUS_LOGON_SESSION_EXISTS;
}
LogonProcess = Request->Data.RegisterLogonProcessRequest.ProcessId;
}
@@ -38,15 +37,12 @@
{
DPRINT1("Current logon process 0x%x, can't deregister from process
0x%x\n",
LogonProcess, Request->Header.ClientId.UniqueProcess);
- Request->Status = STATUS_NOT_LOGON_PROCESS;
- return Request->Status;
+ return STATUS_NOT_LOGON_PROCESS;
}
LogonProcess = 0;
}
- Request->Status = STATUS_SUCCESS;
-
- return Request->Status;
+ return STATUS_SUCCESS;
}
CSR_API(CsrSetLogonNotifyWindow)
@@ -61,21 +57,17 @@
&WindowCreator))
{
DPRINT1("Can't get window creator\n");
- Request->Status = STATUS_INVALID_HANDLE;
- return Request->Status;
+ return STATUS_INVALID_HANDLE;
}
if (WindowCreator != (DWORD)LogonProcess)
{
DPRINT1("Trying to register window not created by winlogon as notify
window\n");
- Request->Status = STATUS_ACCESS_DENIED;
- return Request->Status;
+ return STATUS_ACCESS_DENIED;
}
LogonNotifyWindow = Request->Data.SetLogonNotifyWindowRequest.LogonNotifyWindow;
- Request->Status = STATUS_SUCCESS;
-
- return Request->Status;
+ return STATUS_SUCCESS;
}
typedef struct tagSHUTDOWN_SETTINGS
@@ -938,17 +930,15 @@
if (0 == (Request->Data.ExitReactosRequest.Flags & EWX_INTERNAL_FLAG))
{
- Request->Status = UserExitReactos((DWORD)
Request->Header.ClientId.UniqueProcess,
- Request->Data.ExitReactosRequest.Flags);
+ return UserExitReactos((DWORD) Request->Header.ClientId.UniqueProcess,
+ Request->Data.ExitReactosRequest.Flags);
}
else
{
- Request->Status = InternalExitReactos((DWORD)
Request->Header.ClientId.UniqueProcess,
- (DWORD)
Request->Header.ClientId.UniqueThread,
- Request->Data.ExitReactosRequest.Flags);
- }
-
- return Request->Status;
+ return InternalExitReactos((DWORD) Request->Header.ClientId.UniqueProcess,
+ (DWORD) Request->Header.ClientId.UniqueThread,
+ Request->Data.ExitReactosRequest.Flags);
+ }
}
/* EOF */