mirror of
https://github.com/reactos/reactos.git
synced 2025-04-25 08:00:24 +00:00
- Do not create process data twice.
- Check message type. svn path=/trunk/; revision=27175
This commit is contained in:
parent
0743fc87cf
commit
076ca93553
3 changed files with 26 additions and 11 deletions
|
@ -107,7 +107,7 @@ PCSRSS_PROCESS_DATA STDCALL CsrCreateProcessData(HANDLE ProcessId)
|
|||
}
|
||||
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 @@ CSR_API(CsrCreateProcess)
|
|||
Status = CsrDuplicateHandleTable(ProcessData, NewProcessData);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Set default shutdown parameters */
|
||||
NewProcessData->ShutdownLevel = 0x280;
|
||||
NewProcessData->ShutdownFlags = 0;
|
||||
|
|
|
@ -33,7 +33,7 @@ CsrApiRegisterDefinitions(PCSRSS_API_DEFINITION NewDefinitions)
|
|||
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 @@ CsrpHandleConnectionRequest (PPORT_MESSAGE Request,
|
|||
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 @@ ClientConnectionThread(HANDLE ServerPort)
|
|||
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 @@ ClientConnectionThread(HANDLE ServerPort)
|
|||
|
||||
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 @@ ClientConnectionThread(HANDLE ServerPort)
|
|||
|
||||
/* Close the port and exit the thread */
|
||||
NtClose(ServerPort);
|
||||
|
||||
DPRINT("CSR: %s done\n", __FUNCTION__);
|
||||
RtlExitUserThread(STATUS_SUCCESS);
|
||||
}
|
||||
|
||||
|
|
|
@ -528,7 +528,8 @@ CsrpCreateApiPort (int argc, char ** argv, char ** envp)
|
|||
{
|
||||
DPRINT("CSR: %s called\n", __FUNCTION__);
|
||||
|
||||
CsrInitProcessData();
|
||||
CsrInitProcessData();
|
||||
|
||||
return CsrpCreateListenPort (L"\\Windows\\ApiPort",
|
||||
& hApiPort,
|
||||
#ifdef NTLPC
|
||||
|
|
Loading…
Reference in a new issue