mirror of
https://github.com/reactos/reactos.git
synced 2024-07-10 14:45:06 +00:00
[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. svn path=/trunk/; revision=60068
This commit is contained in:
parent
fb79499369
commit
6f65345379
|
@ -126,7 +126,9 @@ NpRemoveDataQueueEntry(IN PNP_DATA_QUEUE DataQueue,
|
||||||
--DataQueue->EntriesInQueue;
|
--DataQueue->EntriesInQueue;
|
||||||
|
|
||||||
HasWrites = 1;
|
HasWrites = 1;
|
||||||
if (!DataQueue->QueueState != WriteEntries || DataQueue->QuotaUsed < DataQueue->Quota || !QueueEntry->QuotaInEntry)
|
if (DataQueue->QueueState != WriteEntries ||
|
||||||
|
DataQueue->QuotaUsed < DataQueue->Quota ||
|
||||||
|
!QueueEntry->QuotaInEntry)
|
||||||
{
|
{
|
||||||
HasWrites = 0;
|
HasWrites = 0;
|
||||||
}
|
}
|
||||||
|
@ -164,7 +166,7 @@ NpRemoveDataQueueEntry(IN PNP_DATA_QUEUE DataQueue,
|
||||||
return Irp;
|
return Irp;
|
||||||
}
|
}
|
||||||
|
|
||||||
PNP_DATA_QUEUE_ENTRY
|
PLIST_ENTRY
|
||||||
NTAPI
|
NTAPI
|
||||||
NpGetNextRealDataQueueEntry(IN PNP_DATA_QUEUE DataQueue,
|
NpGetNextRealDataQueueEntry(IN PNP_DATA_QUEUE DataQueue,
|
||||||
IN PLIST_ENTRY List)
|
IN PLIST_ENTRY List)
|
||||||
|
@ -175,10 +177,9 @@ NpGetNextRealDataQueueEntry(IN PNP_DATA_QUEUE DataQueue,
|
||||||
PLIST_ENTRY NextEntry;
|
PLIST_ENTRY NextEntry;
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
NextEntry = DataQueue->Queue.Flink;
|
for (NextEntry = DataQueue->Queue.Flink;
|
||||||
DataEntry = CONTAINING_RECORD(NextEntry, NP_DATA_QUEUE_ENTRY, QueueEntry);
|
NextEntry != &DataQueue->Queue;
|
||||||
|
NextEntry = DataQueue->Queue.Flink)
|
||||||
while (NextEntry != &DataQueue->Queue)
|
|
||||||
{
|
{
|
||||||
DataEntry = CONTAINING_RECORD(NextEntry, NP_DATA_QUEUE_ENTRY, QueueEntry);
|
DataEntry = CONTAINING_RECORD(NextEntry, NP_DATA_QUEUE_ENTRY, QueueEntry);
|
||||||
|
|
||||||
|
@ -193,7 +194,7 @@ NpGetNextRealDataQueueEntry(IN PNP_DATA_QUEUE DataQueue,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return DataEntry;
|
return NextEntry;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
|
|
|
@ -394,7 +394,7 @@ NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
NpUninitializeDataQueue(IN PNP_DATA_QUEUE DataQueue);
|
NpUninitializeDataQueue(IN PNP_DATA_QUEUE DataQueue);
|
||||||
|
|
||||||
PNP_DATA_QUEUE_ENTRY
|
PLIST_ENTRY
|
||||||
NTAPI
|
NTAPI
|
||||||
NpGetNextRealDataQueueEntry(IN PNP_DATA_QUEUE DataQueue,
|
NpGetNextRealDataQueueEntry(IN PNP_DATA_QUEUE DataQueue,
|
||||||
IN PLIST_ENTRY List);
|
IN PLIST_ENTRY List);
|
||||||
|
@ -525,6 +525,10 @@ VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
NpFreeClientSecurityContext(IN PSECURITY_CLIENT_CONTEXT ClientContext);
|
NpFreeClientSecurityContext(IN PSECURITY_CLIENT_CONTEXT ClientContext);
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
NTAPI
|
||||||
|
NpImpersonateClientContext(IN PNP_CCB Ccb);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
NpCopyClientContext(IN PNP_CCB Ccb,
|
NpCopyClientContext(IN PNP_CCB Ccb,
|
||||||
|
|
|
@ -48,7 +48,9 @@ NpReadDataQueue(IN PNP_DATA_QUEUE DataQueue,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DataEntry = NpGetNextRealDataQueueEntry(DataQueue, List);
|
DataEntry = CONTAINING_RECORD(NpGetNextRealDataQueueEntry(DataQueue, List),
|
||||||
|
NP_DATA_QUEUE_ENTRY,
|
||||||
|
QueueEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
while ((&DataEntry->QueueEntry != &DataQueue->Queue) && (RemainingSize))
|
while ((&DataEntry->QueueEntry != &DataQueue->Queue) && (RemainingSize))
|
||||||
|
@ -118,7 +120,9 @@ NpReadDataQueue(IN PNP_DATA_QUEUE DataQueue,
|
||||||
{
|
{
|
||||||
if (ReadOverflowOperation)
|
if (ReadOverflowOperation)
|
||||||
{
|
{
|
||||||
TempDataEntry = NpGetNextRealDataQueueEntry(DataQueue, List);
|
TempDataEntry = CONTAINING_RECORD(NpGetNextRealDataQueueEntry(DataQueue, List),
|
||||||
|
NP_DATA_QUEUE_ENTRY,
|
||||||
|
QueueEntry);
|
||||||
ASSERT(TempDataEntry == DataEntry);
|
ASSERT(TempDataEntry == DataEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,7 +153,9 @@ NpReadDataQueue(IN PNP_DATA_QUEUE DataQueue,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DataEntry = NpGetNextRealDataQueueEntry(DataQueue, List);
|
DataEntry = CONTAINING_RECORD(NpGetNextRealDataQueueEntry(DataQueue, List),
|
||||||
|
NP_DATA_QUEUE_ENTRY,
|
||||||
|
QueueEntry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,10 +46,14 @@ NpWriteDataQueue(IN PNP_DATA_QUEUE WriteQueue,
|
||||||
MoreProcessing = FALSE;
|
MoreProcessing = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (DataEntry = NpGetNextRealDataQueueEntry(WriteQueue, List);
|
for (DataEntry = CONTAINING_RECORD(NpGetNextRealDataQueueEntry(WriteQueue, List),
|
||||||
|
NP_DATA_QUEUE_ENTRY,
|
||||||
|
QueueEntry);
|
||||||
((WriteQueue->QueueState == ReadEntries) &&
|
((WriteQueue->QueueState == ReadEntries) &&
|
||||||
((*BytesNotWritten > 0) || (MoreProcessing)));
|
((*BytesNotWritten > 0) || (MoreProcessing)));
|
||||||
DataEntry = NpGetNextRealDataQueueEntry(WriteQueue, List))
|
DataEntry = CONTAINING_RECORD(NpGetNextRealDataQueueEntry(WriteQueue, List),
|
||||||
|
NP_DATA_QUEUE_ENTRY,
|
||||||
|
QueueEntry))
|
||||||
{
|
{
|
||||||
DataSize = DataEntry->DataSize;
|
DataSize = DataEntry->DataSize;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue