Author: dgorbachev
Date: Thu Jun 14 20:47:24 2007
New Revision: 27175
URL:
http://svn.reactos.org/svn/reactos?rev=27175&view=rev
Log:
- Do not create process data twice.
- Check message type.
Modified:
trunk/reactos/subsystems/win32/csrss/api/process.c
trunk/reactos/subsystems/win32/csrss/api/wapi.c
trunk/reactos/subsystems/win32/csrss/init.c
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 (original)
+++ trunk/reactos/subsystems/win32/csrss/api/process.c Thu Jun 14 20:47:24 2007
@@ -107,7 +107,7 @@
}
else
{
- DPRINT("Process data for pid %d already exist\n", ProcessId);
+ DPRINT1("Process data for pid %d already exist\n", ProcessId);
}
UNLOCK;
if (pProcessData == NULL)
@@ -249,7 +249,7 @@
Status = CsrDuplicateHandleTable(ProcessData, NewProcessData);
}
}
-
+
/* Set default shutdown parameters */
NewProcessData->ShutdownLevel = 0x280;
NewProcessData->ShutdownFlags = 0;
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 (original)
+++ trunk/reactos/subsystems/win32/csrss/api/wapi.c Thu Jun 14 20:47:24 2007
@@ -33,7 +33,7 @@
PCSRSS_API_DEFINITION Scan;
PCSRSS_API_DEFINITION New;
- DPRINT("CSR: %s called", __FUNCTION__);
+ DPRINT("CSR: %s called\n", __FUNCTION__);
NewCount = 0;
for (Scan = NewDefinitions; 0 != Scan->Handler; Scan++)
@@ -148,13 +148,17 @@
return Status;
}
- ProcessData = CsrCreateProcessData(Request->ClientId.UniqueProcess);
+ ProcessData = CsrGetProcessData(Request->ClientId.UniqueProcess);
if (ProcessData == NULL)
{
- DPRINT1("Unable to allocate or find data for process 0x%x\n",
- Request->ClientId.UniqueProcess);
- Status = STATUS_UNSUCCESSFUL;
- return Status;
+ ProcessData = CsrCreateProcessData(Request->ClientId.UniqueProcess);
+ if (ProcessData == NULL)
+ {
+ DPRINT1("Unable to allocate or find data for process 0x%x\n",
+ Request->ClientId.UniqueProcess);
+ Status = STATUS_UNSUCCESSFUL;
+ return Status;
+ }
}
ProcessData->CsrSectionViewBase = LpcRead.ViewBase;
@@ -203,7 +207,7 @@
PCSR_API_MESSAGE Reply;
PCSRSS_PROCESS_DATA ProcessData;
- DPRINT("CSR: %s called", __FUNCTION__);
+ DPRINT("CSR: %s called\n", __FUNCTION__);
/* Reply must be NULL at the first call to NtReplyWaitReceivePort */
Reply = NULL;
@@ -242,7 +246,15 @@
if (Request->Header.u2.s2.Type == LPC_CLIENT_DIED)
{
- DPRINT("Clietn died, oh well\n");
+ DPRINT("Client died, oh well\n");
+ Reply = NULL;
+ continue;
+ }
+
+ if ((Request->Header.u2.s2.Type != LPC_ERROR_EVENT) &&
+ (Request->Header.u2.s2.Type != LPC_REQUEST))
+ {
+ DPRINT1("CSR: received message %d\n",
Request->Header.u2.s2.Type);
Reply = NULL;
continue;
}
@@ -285,6 +297,8 @@
/* Close the port and exit the thread */
NtClose(ServerPort);
+
+ DPRINT("CSR: %s done\n", __FUNCTION__);
RtlExitUserThread(STATUS_SUCCESS);
}
Modified: trunk/reactos/subsystems/win32/csrss/init.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/ini…
==============================================================================
--- trunk/reactos/subsystems/win32/csrss/init.c (original)
+++ trunk/reactos/subsystems/win32/csrss/init.c Thu Jun 14 20:47:24 2007
@@ -528,7 +528,8 @@
{
DPRINT("CSR: %s called\n", __FUNCTION__);
- CsrInitProcessData();
+ CsrInitProcessData();
+
return CsrpCreateListenPort (L"\\Windows\\ApiPort",
& hApiPort,
#ifdef NTLPC