Author: ion
Date: Thu Sep 12 23:54:59 2013
New Revision: 60068
URL:
http://svn.reactos.org/svn/reactos?rev=60068&view=rev
Log:
[NPFS-NEW]: Fix a bug in NpRemoveDataQueueEntry.
[NPFS-NEW]: Fix busted up NpGetNextRealDataQueueEntry and fix its usage.
These changes don't appear to "fix" any tests, but they were real bugs.
Thanks to ThFabba.
Modified:
trunk/reactos/drivers/filesystems/npfs_new/datasup.c
trunk/reactos/drivers/filesystems/npfs_new/npfs.h
trunk/reactos/drivers/filesystems/npfs_new/readsup.c
trunk/reactos/drivers/filesystems/npfs_new/writesup.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 23:54:59
2013
@@ -126,7 +126,9 @@
--DataQueue->EntriesInQueue;
HasWrites = 1;
- if (!DataQueue->QueueState != WriteEntries || DataQueue->QuotaUsed <
DataQueue->Quota || !QueueEntry->QuotaInEntry)
+ if (DataQueue->QueueState != WriteEntries ||
+ DataQueue->QuotaUsed < DataQueue->Quota ||
+ !QueueEntry->QuotaInEntry)
{
HasWrites = 0;
}
@@ -164,7 +166,7 @@
return Irp;
}
-PNP_DATA_QUEUE_ENTRY
+PLIST_ENTRY
NTAPI
NpGetNextRealDataQueueEntry(IN PNP_DATA_QUEUE DataQueue,
IN PLIST_ENTRY List)
@@ -175,10 +177,9 @@
PLIST_ENTRY NextEntry;
PAGED_CODE();
- NextEntry = DataQueue->Queue.Flink;
- DataEntry = CONTAINING_RECORD(NextEntry, NP_DATA_QUEUE_ENTRY, QueueEntry);
-
- while (NextEntry != &DataQueue->Queue)
+ for (NextEntry = DataQueue->Queue.Flink;
+ NextEntry != &DataQueue->Queue;
+ NextEntry = DataQueue->Queue.Flink)
{
DataEntry = CONTAINING_RECORD(NextEntry, NP_DATA_QUEUE_ENTRY, QueueEntry);
@@ -193,7 +194,7 @@
}
}
- return DataEntry;
+ return NextEntry;
}
VOID
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 23:54:59
2013
@@ -394,7 +394,7 @@
NTAPI
NpUninitializeDataQueue(IN PNP_DATA_QUEUE DataQueue);
-PNP_DATA_QUEUE_ENTRY
+PLIST_ENTRY
NTAPI
NpGetNextRealDataQueueEntry(IN PNP_DATA_QUEUE DataQueue,
IN PLIST_ENTRY List);
@@ -524,6 +524,10 @@
VOID
NTAPI
NpFreeClientSecurityContext(IN PSECURITY_CLIENT_CONTEXT ClientContext);
+
+NTSTATUS
+NTAPI
+NpImpersonateClientContext(IN PNP_CCB Ccb);
VOID
NTAPI
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 23:54:59
2013
@@ -48,7 +48,9 @@
}
else
{
- DataEntry = NpGetNextRealDataQueueEntry(DataQueue, List);
+ DataEntry = CONTAINING_RECORD(NpGetNextRealDataQueueEntry(DataQueue, List),
+ NP_DATA_QUEUE_ENTRY,
+ QueueEntry);
}
while ((&DataEntry->QueueEntry != &DataQueue->Queue) &&
(RemainingSize))
@@ -118,7 +120,9 @@
{
if (ReadOverflowOperation)
{
- TempDataEntry = NpGetNextRealDataQueueEntry(DataQueue, List);
+ TempDataEntry =
CONTAINING_RECORD(NpGetNextRealDataQueueEntry(DataQueue, List),
+ NP_DATA_QUEUE_ENTRY,
+ QueueEntry);
ASSERT(TempDataEntry == DataEntry);
}
@@ -149,7 +153,9 @@
}
else
{
- DataEntry = NpGetNextRealDataQueueEntry(DataQueue, List);
+ DataEntry = CONTAINING_RECORD(NpGetNextRealDataQueueEntry(DataQueue, List),
+ NP_DATA_QUEUE_ENTRY,
+ QueueEntry);
}
}
Modified: trunk/reactos/drivers/filesystems/npfs_new/writesup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs_n…
==============================================================================
--- trunk/reactos/drivers/filesystems/npfs_new/writesup.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/npfs_new/writesup.c [iso-8859-1] Thu Sep 12 23:54:59
2013
@@ -46,10 +46,14 @@
MoreProcessing = FALSE;
}
- for (DataEntry = NpGetNextRealDataQueueEntry(WriteQueue, List);
+ for (DataEntry = CONTAINING_RECORD(NpGetNextRealDataQueueEntry(WriteQueue, List),
+ NP_DATA_QUEUE_ENTRY,
+ QueueEntry);
((WriteQueue->QueueState == ReadEntries) &&
((*BytesNotWritten > 0) || (MoreProcessing)));
- DataEntry = NpGetNextRealDataQueueEntry(WriteQueue, List))
+ DataEntry = CONTAINING_RECORD(NpGetNextRealDataQueueEntry(WriteQueue, List),
+ NP_DATA_QUEUE_ENTRY,
+ QueueEntry))
{
DataSize = DataEntry->DataSize;