- Acquire the cancel spin lock before calling IoSetCancelRoutine
- Remove the old cancellation code
- Don't use the CCB stored in the IRP because it could be invalid depending on the state of the IRP
- Simplify thread termination
- Fixes random crash during rpcrt4:ndr_marshall test
svn path=/trunk/; revision=47506
- Fix race conditions in read IRP cancellation that resulting in random crashes and hangs
- Fixes MULTIPLE_IRP_COMPLETE_REQUESTS bug checks and failed cancellations resulting in hangs during ntdll:file test
svn path=/trunk/; revision=47470
- Partially revert r47370 and apply a better patch
- Change ReadEvent and WriteEvent to notification events because we reset those events manually when we run out of buffer space
svn path=/trunk/; revision=47375
- 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
Only set pipes otherside to NULL if it is not NULL already.
fsctrl.c: NpfsDisconnectPipe - Set return status to STATUS_PIPE_DISCONNECTED if pipe is already disconnected.
Add code to handle cases where PipeState is connected and pipes otherside has been set to NULL.
rw.c: Set return status to STATUS_BROKEN_PIPE if the other side of pipe has been set to NULL, the data available in pipe is zero and pipe state is connected.
Check that pipes otherside is valid before attempting to set the othersides read/write event.
svn path=/trunk/; revision=40281
- create.c: Use new members.
- finfo.c: Check whether the pipe side is server or client and change/return appropriate ReadMode.
- fsctrl.c: Opps. Previous implementation was pretty much correct.
- rw.c: Silence debug message and use new members.
Add multiple checks on whether pipe side is server or client and use appropriate ReadMode.
If handling the next Irp in NpfsRead, remove the cancel routine before continuing the loop. Fixes BugCheck when running ntdll_winetest for file. Thank Christoph von Wittich for pointing this out.
svn path=/trunk/; revision=38986
- Due to the new implementation, Quota is not charged for partial message retrievals. Therefore reset Quota Available to MaxDataLength when last message is read from buffer and check that Quota is greater than 0 before waking the write thread.
svn path=/trunk/; revision=38899
The ReadPtr is there so use it. Duuhh.
Only move memory to make room for more data when the buffer is full vice moving memory on every read.
Call KeSetEvent at the correct time, when reading is done.
- fsctrl.c: Correct data returned from NpfsPeekPipe when read mode is byte stream.
svn path=/trunk/; revision=38818
Clients start of in byte stream mode, regardless of the pipe's mode.
- finfo.c: NPFS does not allow changing read mode to message for byte stream mode pipes.
- rw.c: The format in which data is in the pipe's buffer is based on the pipe mode vice read mode.
Implement reads in byte stream mode for pipes using message mode.
Fixed a bug that could caused buffer data to be corrupted due to incorrect calc of WritePtr position.
- fsctrl.c: Return buffer from NpfsPeekPipe if caller requested.
Use a mutex before reading the pipe's buffer.
Return the correct length in Irp info.
svn path=/trunk/; revision=38790