Connect client and server side upon client side creation only if both sides were created by the same thread.

svn path=/trunk/; revision=12704
This commit is contained in:
Eric Kohl 2005-01-01 14:54:25 +00:00
parent 88c78cbdd8
commit 292272eff4
3 changed files with 10 additions and 7 deletions

View file

@ -1,4 +1,4 @@
/* $Id: create.c,v 1.28 2004/12/30 16:15:10 ekohl Exp $
/* $Id$
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -157,6 +157,7 @@ NpfsCreate(PDEVICE_OBJECT DeviceObject,
return STATUS_NO_MEMORY;
}
ClientFcb->Thread = (struct ETHREAD *)Irp->Tail.Overlay.Thread;
ClientFcb->Pipe = Pipe;
ClientFcb->PipeEnd = FILE_PIPE_CLIENT_END;
ClientFcb->OtherSide = NULL;
@ -197,7 +198,8 @@ NpfsCreate(PDEVICE_OBJECT DeviceObject,
/* Add the client FCB to the pipe FCB list. */
InsertTailList(&Pipe->ClientFcbListHead, &ClientFcb->FcbListEntry);
if (ServerFcb)
/* Connect pipes if they were created by the same thread */
if (ServerFcb && ServerFcb->Thread == ClientFcb->Thread)
{
ClientFcb->OtherSide = ServerFcb;
ServerFcb->OtherSide = ClientFcb;
@ -254,6 +256,7 @@ NpfsCreateNamedPipe(PDEVICE_OBJECT DeviceObject,
return STATUS_NO_MEMORY;
}
Fcb->Thread = (struct ETHREAD *)Irp->Tail.Overlay.Thread;
KeLockMutex(&DeviceExt->PipeListLock);
/*

View file

@ -1,4 +1,4 @@
/* $Id: fsctrl.c,v 1.18 2004/12/30 12:34:27 ekohl Exp $
/* $Id$
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -59,7 +59,6 @@ NpfsConnectPipe(PNPFS_FCB Fcb)
break;
}
#if 0
if (ClientFcb->PipeState == FILE_PIPE_LISTENING_STATE)
{

View file

@ -1,4 +1,4 @@
/* $Id: npfs.h,v 1.17 2004/05/10 19:58:10 navaraf Exp $ */
/* $Id$ */
#ifndef __SERVICES_FS_NP_NPFS_H
#define __SERVICES_FS_NP_NPFS_H
@ -9,7 +9,7 @@
*/
#define FIN_WORKAROUND_READCLOSE
typedef struct
typedef struct _NPFS_DEVICE_EXTENSION
{
LIST_ENTRY PipeListHead;
KMUTEX PipeListLock;
@ -18,7 +18,7 @@ typedef struct
ULONG MaxQuota;
} NPFS_DEVICE_EXTENSION, *PNPFS_DEVICE_EXTENSION;
typedef struct
typedef struct _NPFS_PIPE
{
UNICODE_STRING PipeName;
LIST_ENTRY PipeListEntry;
@ -41,6 +41,7 @@ typedef struct _NPFS_FCB
{
LIST_ENTRY FcbListEntry;
struct _NPFS_FCB* OtherSide;
struct ETHREAD *Thread;
PNPFS_PIPE Pipe;
KEVENT ConnectEvent;
KEVENT Event;