mirror of
https://github.com/reactos/reactos.git
synced 2025-01-03 21:09:19 +00:00
[NPFS]
- Change the other side's to PIPE_STATUS_CLOSING_STATE in NpfsCleanup and NpfsClose so the reading/writing thread knows that the pipe is dead when we signal its event - Fixes iphlpapi_winetest hang and possibly bug #4689 svn path=/trunk/; revision=47370
This commit is contained in:
parent
5faac22844
commit
7c79933df4
2 changed files with 8 additions and 4 deletions
|
@ -619,7 +619,7 @@ NpfsCleanup(PDEVICE_OBJECT DeviceObject,
|
|||
ExAcquireFastMutex(&OtherSide->DataListLock);
|
||||
ExAcquireFastMutex(&Ccb->DataListLock);
|
||||
}
|
||||
//OtherSide->PipeState = FILE_PIPE_DISCONNECTED_STATE;
|
||||
OtherSide->PipeState = FILE_PIPE_CLOSING_STATE;
|
||||
OtherSide->OtherSide = NULL;
|
||||
/*
|
||||
* Signaling the write event. If is possible that an other
|
||||
|
@ -743,8 +743,12 @@ NpfsClose(PDEVICE_OBJECT DeviceObject,
|
|||
}
|
||||
|
||||
/* Disconnect the pipes */
|
||||
if (Ccb->OtherSide) Ccb->OtherSide->OtherSide = NULL;
|
||||
if (Ccb) Ccb->OtherSide = NULL;
|
||||
if (Ccb->OtherSide)
|
||||
{
|
||||
Ccb->OtherSide->PipeState = FILE_PIPE_CLOSING_STATE;
|
||||
Ccb->OtherSide->OtherSide = NULL;
|
||||
Ccb->OtherSide = NULL;
|
||||
}
|
||||
|
||||
ASSERT(Ccb->PipeState == FILE_PIPE_CLOSING_STATE);
|
||||
|
||||
|
|
|
@ -331,7 +331,7 @@ NpfsRead(IN PDEVICE_OBJECT DeviceObject,
|
|||
|
||||
if ((Ccb->OtherSide == NULL) && (Ccb->ReadDataAvailable == 0))
|
||||
{
|
||||
if (Ccb->PipeState == FILE_PIPE_CONNECTED_STATE)
|
||||
if (Ccb->PipeState == FILE_PIPE_CLOSING_STATE)
|
||||
{
|
||||
DPRINT("File pipe broken\n");
|
||||
Status = STATUS_PIPE_BROKEN;
|
||||
|
|
Loading…
Reference in a new issue