- 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:
Cameron Gutman 2010-05-27 00:26:34 +00:00
parent 5faac22844
commit 7c79933df4
2 changed files with 8 additions and 4 deletions

View file

@ -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);

View file

@ -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;