Author: ion
Date: Thu Sep 12 22:42:13 2013
New Revision: 60067
URL:
http://svn.reactos.org/svn/reactos?rev=60067&view=rev
Log:
[NPFS-NEW]: Fix moar bougs. pipe: 33920 tests execute (0 marked as todo, 84 failures), 0
skipped. Note that this is already better than trunk's npfs!
Modified:
trunk/reactos/drivers/filesystems/npfs_new/datasup.c
trunk/reactos/drivers/filesystems/npfs_new/flushbuf.c
trunk/reactos/drivers/filesystems/npfs_new/npfs.h
trunk/reactos/drivers/filesystems/npfs_new/readsup.c
trunk/reactos/drivers/filesystems/npfs_new/write.c
Modified: trunk/reactos/drivers/filesystems/npfs_new/datasup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs_n…
==============================================================================
--- trunk/reactos/drivers/filesystems/npfs_new/datasup.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/npfs_new/datasup.c [iso-8859-1] Thu Sep 12 22:42:13
2013
@@ -175,9 +175,9 @@
PLIST_ENTRY NextEntry;
PAGED_CODE();
- DataEntry = NULL;
-
NextEntry = DataQueue->Queue.Flink;
+ DataEntry = CONTAINING_RECORD(NextEntry, NP_DATA_QUEUE_ENTRY, QueueEntry);
+
while (NextEntry != &DataQueue->Queue)
{
DataEntry = CONTAINING_RECORD(NextEntry, NP_DATA_QUEUE_ENTRY, QueueEntry);
Modified: trunk/reactos/drivers/filesystems/npfs_new/flushbuf.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs_n…
==============================================================================
--- trunk/reactos/drivers/filesystems/npfs_new/flushbuf.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/npfs_new/flushbuf.c [iso-8859-1] Thu Sep 12 22:42:13
2013
@@ -37,11 +37,11 @@
if (NamedPipeEnd == FILE_PIPE_SERVER_END)
{
- FlushQueue = &Ccb->DataQueue[FILE_PIPE_INBOUND];
+ FlushQueue = &Ccb->DataQueue[FILE_PIPE_OUTBOUND];
}
else
{
- FlushQueue = &Ccb->DataQueue[FILE_PIPE_OUTBOUND];
+ FlushQueue = &Ccb->DataQueue[FILE_PIPE_INBOUND];
}
if (FlushQueue->QueueState == WriteEntries)
@@ -81,6 +81,12 @@
NpReleaseVcb();
FsRtlExitFileSystem();
+ if (Status != STATUS_PENDING)
+ {
+ Irp->IoStatus.Status = Status;
+ IoCompleteRequest(Irp, IO_NAMED_PIPE_INCREMENT);
+ }
+
return Status;
}
Modified: trunk/reactos/drivers/filesystems/npfs_new/npfs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs_n…
==============================================================================
--- trunk/reactos/drivers/filesystems/npfs_new/npfs.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/npfs_new/npfs.h [iso-8859-1] Thu Sep 12 22:42:13
2013
@@ -351,6 +351,8 @@
ExReleaseResourceLite(&NpVcb->Lock);
}
+
+
//
// Function to process deferred IRPs outside the VCB lock but still within the
// critical region
Modified: trunk/reactos/drivers/filesystems/npfs_new/readsup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs_n…
==============================================================================
--- trunk/reactos/drivers/filesystems/npfs_new/readsup.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/npfs_new/readsup.c [iso-8859-1] Thu Sep 12 22:42:13
2013
@@ -75,7 +75,7 @@
}
DataLength = Offset;
- if (Offset >= RemainingSize) DataLength = RemainingSize;
+ if (DataLength >= RemainingSize) DataLength = RemainingSize;
_SEH2_TRY
{
@@ -130,14 +130,17 @@
InsertTailList(List, &Irp->Tail.Overlay.ListEntry);
}
}
+
if (Mode == FILE_PIPE_MESSAGE_MODE)
{
Status.Status = STATUS_SUCCESS;
break;
}
+
ASSERT(!ReadOverflowOperation);
}
}
+
if (Peek)
{
DataEntry = CONTAINING_RECORD(DataEntry->QueueEntry.Flink,
Modified: trunk/reactos/drivers/filesystems/npfs_new/write.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs_n…
==============================================================================
--- trunk/reactos/drivers/filesystems/npfs_new/write.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/npfs_new/write.c [iso-8859-1] Thu Sep 12 22:42:13
2013
@@ -36,7 +36,7 @@
PNP_DATA_QUEUE WriteQueue;
NTSTATUS Status;
PNP_EVENT_BUFFER EventBuffer;
- ULONG BytesWritten, NamedPipeEnd;
+ ULONG BytesWritten, NamedPipeEnd, ReadMode;
PAGED_CODE();
IoStatus->Information = 0;
@@ -91,10 +91,12 @@
if (NamedPipeEnd == FILE_PIPE_SERVER_END)
{
WriteQueue = &Ccb->DataQueue[FILE_PIPE_OUTBOUND];
+ ReadMode = Ccb->ReadMode[FILE_PIPE_CLIENT_END];
}
else
{
WriteQueue = &Ccb->DataQueue[FILE_PIPE_INBOUND];
+ ReadMode = Ccb->ReadMode[FILE_PIPE_SERVER_END];
}
EventBuffer = NonPagedCcb->EventBuffer[NamedPipeEnd];
@@ -122,7 +124,7 @@
}
Status = NpWriteDataQueue(WriteQueue,
- Ccb->ReadMode[NamedPipeEnd],
+ ReadMode,
Buffer,
DataSize,
Ccb->Fcb->NamedPipeType,
@@ -136,8 +138,8 @@
if (Status == STATUS_MORE_PROCESSING_REQUIRED)
{
ASSERT(WriteQueue->QueueState != ReadEntries);
- if ((Ccb->CompletionMode[NamedPipeEnd] == FILE_PIPE_COMPLETE_OPERATION ||
!Irp)
- && WriteQueue->Quota - WriteQueue->QuotaUsed <
BytesWritten)
+ if ((Ccb->CompletionMode[NamedPipeEnd] == FILE_PIPE_COMPLETE_OPERATION ||
!Irp) &&
+ ((WriteQueue->Quota - WriteQueue->QuotaUsed) < BytesWritten))
{
IoStatus->Information = DataSize - BytesWritten;
IoStatus->Status = STATUS_SUCCESS;