-/* $Id: proc.c,v 1.64 2004/08/29 14:46:02 weiden Exp $
+/* $Id: proc.c,v 1.65 2004/09/13 19:10:45 gvg Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
sizeof(CSRSS_API_REPLY));
if (!NT_SUCCESS(Status) || !NT_SUCCESS(CsrReply.Status))
{
- DbgPrint("Failed to tell csrss about terminating process. "
- "Expect trouble.\n");
+ DPRINT("Failed to tell csrss about terminating process\n");
}
-/* $Id: close.c,v 1.13 2004/08/15 16:39:06 chorns Exp $
+/* $Id: close.c,v 1.14 2004/09/13 19:10:45 gvg Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
{
PEPORT Port = (PEPORT)ObjectBody;
LPC_MESSAGE Message;
-
+
+ /* FIXME Race conditions here! */
+
+ DPRINT("NiClosePort 0x%p OtherPort 0x%p State %d\n", Port, Port->OtherPort, Port->State);
+
/*
* If the client has just closed its handle then tell the server what
* happened and disconnect this port.
if (HandleCount == 0 && Port->State == EPORT_CONNECTED_CLIENT &&
ObGetObjectPointerCount(Port) == 2)
{
+ DPRINT("Informing server\n");
Message.MessageSize = sizeof(LPC_MESSAGE);
Message.DataSize = 0;
EiReplyOrRequestPort (Port->OtherPort,
* don't actually notify the client until it attempts an operation.
*/
if (HandleCount == 0 && Port->State == EPORT_CONNECTED_SERVER &&
- ObGetObjectPointerCount(Port) == 2)
+ ObGetObjectPointerCount(Port) == 1)
{
+ DPRINT("Cleaning up server\n");
Port->OtherPort->OtherPort = NULL;
Port->OtherPort->State = EPORT_DISCONNECTED;
ObDereferenceObject(Port->OtherPort);
-/* $Id: reply.c,v 1.21 2004/08/15 16:39:06 chorns Exp $
+/* $Id: reply.c,v 1.22 2004/09/13 19:10:45 gvg Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
DPRINT("NtReplyPort() = %x\n", Status);
return(Status);
}
+
+ if (EPORT_DISCONNECTED == Port->State)
+ {
+ ObDereferenceObject(Port);
+ return STATUS_PORT_DISCONNECTED;
+ }
Status = EiReplyOrRequestPort(Port->OtherPort,
LpcReply,
-/* $Id: send.c,v 1.17 2004/08/31 20:17:18 hbirr Exp $
+/* $Id: send.c,v 1.18 2004/09/13 19:10:45 gvg Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
return(Status);
}
+ if (EPORT_DISCONNECTED == Port->State)
+ {
+ ObDereferenceObject(Port);
+ return STATUS_PORT_DISCONNECTED;
+ }
+
/* win32k sometimes needs to KeAttach() the CSRSS process in order to make
the PortHandle valid. Now that we've got the EPORT structure from the
handle we can undo this, so everything is normal again. Need to