Commit graph

29 commits

Author SHA1 Message Date
Amine Khaldi
c424146e2c Create a branch for cmake bringup.
svn path=/branches/cmake-bringup/; revision=48236
2010-07-24 18:52:44 +00:00
Johannes Anderwald
ba2a17a2ef [NPFS]
- Fix 2 memory leaks when creating a pipe fails
- Fix minor style issue

svn path=/trunk/; revision=47513
2010-06-01 10:57:26 +00:00
Johannes Anderwald
e2be367887 [NPFS]
- Check if MmGetSystemAddressForMdlSafe failed

svn path=/trunk/; revision=47512
2010-06-01 09:52:16 +00:00
Cameron Gutman
85c99c26cb [NPFS]
- 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
2010-06-01 02:44:15 +00:00
Cameron Gutman
5de258d708 [NPFS]
- 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
2010-05-30 22:18:50 +00:00
Cameron Gutman
f73d8199f7 [NPFS]
- 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
2010-05-27 23:52:32 +00:00
Cameron Gutman
7c79933df4 [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
2010-05-27 00:26:34 +00:00
Michael Martin
418ee7239b - rw.c: After the write wait has been satisfied, check that the pipe is not closed before trying to acquire the mutex. Fix bug #4351.
svn path=/trunk/; revision=40432
2009-04-09 21:10:04 +00:00
Michael Martin
4ea62038a8 create.c: NpfsCleanup - Do not set the pipe's state to FILE_PIPE_DISCONNECTED_STATE, it is needed for determining broken pipes.
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
2009-03-29 11:15:10 +00:00
Michael Martin
c15c8ae183 - Fix formatting
svn path=/trunk/; revision=39477
2009-02-08 09:04:42 +00:00
Michael Martin
d5823b702a - npfs.h: The member named WriteMode is meaningless for pipes, as the write mode is the PipeType for both client and server. Change names to something more descriptive,ServerReadMode and ClientReadMode, for the members new use.
- 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
2009-01-21 07:52:45 +00:00
Michael Martin
bd30763563 - Fix calculation of WriteQuotaAvailable and WritePtr when moving memory.
- 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
2009-01-18 16:31:45 +00:00
Michael Martin
afcde1e39c - rw.c: Better implementation of read/write for pipes.
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
2009-01-17 15:21:15 +00:00
Michael Martin
9ae3084028 - Reply 38790, with fix for npfsPeekPipe which was breaking rosautotests.
svn path=/trunk/; revision=38797
2009-01-16 19:30:55 +00:00
Michael Martin
c8ed77432a - Revert 38790 as i broke autotests.
svn path=/trunk/; revision=38793
2009-01-16 15:59:03 +00:00
Michael Martin
9e097bc205 - create.c: All instances of a pipe must be the same pipe mode as when first instance was created.
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
2009-01-16 14:33:45 +00:00
Michael Martin
981645312e - Last implementation was failing to charge the QuotaAvailable for the message length proceeding the message in the buffer, causing overwriting of the pool. See bug 4018 for more info.
svn path=/trunk/; revision=38699
2009-01-11 14:28:45 +00:00
Michael Martin
8b8bf0f32a - Dont call KeWaitForSingleObject with WaitMode of KernelMode, as threads cannot be terminated if request was made from user mode. Use Ipr->RequestorMode instead.
svn path=/trunk/; revision=38662
2009-01-09 11:04:11 +00:00
Michael Martin
45661165b8 - Change and silence a debug message that made it look like npfsRead had a problem.
svn path=/trunk/; revision=38577
2009-01-05 11:52:44 +00:00
Michael Martin
85d5cc3b8e - Re-implement Message Type read/write mode as the previous implementation was incorrect.
- Fixed bug in Byte Stream mode that caused threads to not wake from a wait.
- Implemented NpfsPeekPipe.


svn path=/trunk/; revision=38573
2009-01-05 00:08:43 +00:00
Stefan Ginsberg
6bfd12deec - STDCALL -> NTAPI
svn path=/trunk/; revision=37742
2008-11-29 20:14:45 +00:00
Michael Martin
2e07ded883 - Add missing goto done in NpfsRead when setting Status as STATUS_PENDING. Fixes bug #3115 and duplicates.
svn path=/trunk/; revision=37020
2008-10-27 13:51:20 +00:00
Stefan Ginsberg
13362ee99b - Remove KEBUGCHECK and KEBUGCHECKEX macros
- Replace "KeBugCheck(0)" by ASSERT(FALSE)
- Replace deprecated "CPRINT" by DRINT1

svn path=/trunk/; revision=35600
2008-08-24 15:48:05 +00:00
Christoph von Wittich
6f2afc126e fix format strings
svn path=/trunk/; revision=30630
2007-11-21 15:55:58 +00:00
Christoph von Wittich
96cebf42c3 set DRIVER_CANCEL and DRIVER_DISPATCH where needed
svn path=/trunk/; revision=30629
2007-11-21 15:53:31 +00:00
Dmitry Gorbachev
12a24bb9e3 Do not crash on broken pipe.
svn path=/trunk/; revision=26623
2007-05-02 03:06:18 +00:00
Christoph von Wittich
a8e41c3f8f include npfs.h before debug.h - this fixes compilation with MSVC
svn path=/trunk/; revision=26388
2007-04-18 01:51:27 +00:00
Christoph von Wittich
90441d106e fix formatting (no code changes)
svn path=/trunk/; revision=26387
2007-04-18 01:25:28 +00:00
Alex Ionescu
4b795a9e2d - Add "fs" to npfs and msfs.
- Put blue in drivers\setup.
- Re-organize Audio stack in /wdm and /ksfilter directories.

svn path=/trunk/; revision=26252
2007-04-03 14:55:54 +00:00
Renamed from reactos/drivers/filesystems/np/rw.c (Browse further)