mirror of
https://github.com/reactos/reactos.git
synced 2025-07-27 07:41:51 +00:00
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:
parent
88c78cbdd8
commit
292272eff4
3 changed files with 10 additions and 7 deletions
|
@ -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
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -157,6 +157,7 @@ NpfsCreate(PDEVICE_OBJECT DeviceObject,
|
||||||
return STATUS_NO_MEMORY;
|
return STATUS_NO_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ClientFcb->Thread = (struct ETHREAD *)Irp->Tail.Overlay.Thread;
|
||||||
ClientFcb->Pipe = Pipe;
|
ClientFcb->Pipe = Pipe;
|
||||||
ClientFcb->PipeEnd = FILE_PIPE_CLIENT_END;
|
ClientFcb->PipeEnd = FILE_PIPE_CLIENT_END;
|
||||||
ClientFcb->OtherSide = NULL;
|
ClientFcb->OtherSide = NULL;
|
||||||
|
@ -197,7 +198,8 @@ NpfsCreate(PDEVICE_OBJECT DeviceObject,
|
||||||
/* Add the client FCB to the pipe FCB list. */
|
/* Add the client FCB to the pipe FCB list. */
|
||||||
InsertTailList(&Pipe->ClientFcbListHead, &ClientFcb->FcbListEntry);
|
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;
|
ClientFcb->OtherSide = ServerFcb;
|
||||||
ServerFcb->OtherSide = ClientFcb;
|
ServerFcb->OtherSide = ClientFcb;
|
||||||
|
@ -254,6 +256,7 @@ NpfsCreateNamedPipe(PDEVICE_OBJECT DeviceObject,
|
||||||
return STATUS_NO_MEMORY;
|
return STATUS_NO_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Fcb->Thread = (struct ETHREAD *)Irp->Tail.Overlay.Thread;
|
||||||
KeLockMutex(&DeviceExt->PipeListLock);
|
KeLockMutex(&DeviceExt->PipeListLock);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -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
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -59,7 +59,6 @@ NpfsConnectPipe(PNPFS_FCB Fcb)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
if (ClientFcb->PipeState == FILE_PIPE_LISTENING_STATE)
|
if (ClientFcb->PipeState == FILE_PIPE_LISTENING_STATE)
|
||||||
{
|
{
|
||||||
|
|
|
@ -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
|
#ifndef __SERVICES_FS_NP_NPFS_H
|
||||||
#define __SERVICES_FS_NP_NPFS_H
|
#define __SERVICES_FS_NP_NPFS_H
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
*/
|
*/
|
||||||
#define FIN_WORKAROUND_READCLOSE
|
#define FIN_WORKAROUND_READCLOSE
|
||||||
|
|
||||||
typedef struct
|
typedef struct _NPFS_DEVICE_EXTENSION
|
||||||
{
|
{
|
||||||
LIST_ENTRY PipeListHead;
|
LIST_ENTRY PipeListHead;
|
||||||
KMUTEX PipeListLock;
|
KMUTEX PipeListLock;
|
||||||
|
@ -18,7 +18,7 @@ typedef struct
|
||||||
ULONG MaxQuota;
|
ULONG MaxQuota;
|
||||||
} NPFS_DEVICE_EXTENSION, *PNPFS_DEVICE_EXTENSION;
|
} NPFS_DEVICE_EXTENSION, *PNPFS_DEVICE_EXTENSION;
|
||||||
|
|
||||||
typedef struct
|
typedef struct _NPFS_PIPE
|
||||||
{
|
{
|
||||||
UNICODE_STRING PipeName;
|
UNICODE_STRING PipeName;
|
||||||
LIST_ENTRY PipeListEntry;
|
LIST_ENTRY PipeListEntry;
|
||||||
|
@ -41,6 +41,7 @@ typedef struct _NPFS_FCB
|
||||||
{
|
{
|
||||||
LIST_ENTRY FcbListEntry;
|
LIST_ENTRY FcbListEntry;
|
||||||
struct _NPFS_FCB* OtherSide;
|
struct _NPFS_FCB* OtherSide;
|
||||||
|
struct ETHREAD *Thread;
|
||||||
PNPFS_PIPE Pipe;
|
PNPFS_PIPE Pipe;
|
||||||
KEVENT ConnectEvent;
|
KEVENT ConnectEvent;
|
||||||
KEVENT Event;
|
KEVENT Event;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue