[CSRSS]: Fix broken logic.

svn path=/trunk/; revision=53042
This commit is contained in:
Alex Ionescu 2011-08-03 03:57:30 +00:00
parent 326dbd577b
commit a2c84355ef
2 changed files with 22 additions and 4 deletions

View file

@ -148,7 +148,11 @@ NtAcceptConnectPort(OUT PHANDLE PortHandle,
RtlCopyMemory(ConnectMessage + 1, ReplyMessage + 1, ConnectionInfoLength);
/* At this point, if the caller refused the connection, go to cleanup */
if (!AcceptConnection) goto Cleanup;
if (!AcceptConnection)
{
DPRINT1("LPC connection was refused\n");
goto Cleanup;
}
/* Otherwise, create the actual port */
Status = ObCreateObject(PreviousMode,
@ -222,6 +226,11 @@ NtAcceptConnectPort(OUT PHANDLE PortHandle,
{
/* Otherwise, quit */
ObDereferenceObject(ServerPort);
DPRINT1("Client section mapping failed: %lx\n", Status);
DPRINT1("View base, offset, size: %lx %lx %lx\n",
ServerPort->ClientSectionBase,
ConnectMessage->ClientView.ViewSize,
SectionOffset);
goto Cleanup;
}
}

View file

@ -437,11 +437,20 @@ CsrpHandleConnectionRequest (PPORT_MESSAGE Request,
DPRINT1("Unable to allocate or find data for process 0x%x\n",
Request->ClientId.UniqueProcess);
}
}
if (ProcessData)
{
/* Attach the Shared Section */
Status = CsrSrvAttachSharedSection(ProcessData, ConnectInfo);
if (NT_SUCCESS(Status))
{
DPRINT1("Connection ok\n");
AllowConnection = TRUE;
}
else
{
/* Attach the Shared Section */
Status = CsrSrvAttachSharedSection(ProcessData, ConnectInfo);
if (NT_SUCCESS(Status)) AllowConnection = TRUE;
DPRINT1("Shared section map failed: %lx\n", Status);
}
}