Author: tfaber
Date: Thu Aug 7 10:24:07 2014
New Revision: 63827
URL:
http://svn.reactos.org/svn/reactos?rev=63827&view=rev
Log:
[NPFS]
- Avoid magic values, remove a few casts and don't name an IO_STATUS_BLOCK Status. No
code changes.
Modified:
trunk/reactos/drivers/filesystems/npfs/datasup.c
trunk/reactos/drivers/filesystems/npfs/readsup.c
trunk/reactos/drivers/filesystems/npfs/waitsup.c
Modified: trunk/reactos/drivers/filesystems/npfs/datasup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs/d…
==============================================================================
--- trunk/reactos/drivers/filesystems/npfs/datasup.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/npfs/datasup.c [iso-8859-1] Thu Aug 7 10:24:07
2014
@@ -68,7 +68,7 @@
Irp = DataQueueEntry->Irp;
- if ((DataQueueEntry->DataEntryType == 0) && (Irp))
+ if ((DataQueueEntry->DataEntryType == Buffered) && (Irp))
{
DataLeft = DataQueueEntry->DataSize - ByteOffset;
@@ -127,12 +127,12 @@
DataQueue->BytesInQueue -= QueueEntry->DataSize;
--DataQueue->EntriesInQueue;
- HasWrites = 1;
+ HasWrites = TRUE;
if (DataQueue->QueueState != WriteEntries ||
DataQueue->QuotaUsed < DataQueue->Quota ||
!QueueEntry->QuotaInEntry)
{
- HasWrites = 0;
+ HasWrites = FALSE;
}
DataQueue->QuotaUsed -= QueueEntry->QuotaInEntry;
@@ -140,7 +140,7 @@
if (IsListEmpty(&DataQueue->Queue))
{
DataQueue->QueueState = Empty;
- HasWrites = 0;
+ HasWrites = FALSE;
}
Irp = QueueEntry->Irp;
@@ -183,7 +183,9 @@
NextEntry != &DataQueue->Queue;
NextEntry = DataQueue->Queue.Flink)
{
- DataEntry = CONTAINING_RECORD(NextEntry, NP_DATA_QUEUE_ENTRY, QueueEntry);
+ DataEntry = CONTAINING_RECORD(NextEntry,
+ NP_DATA_QUEUE_ENTRY,
+ QueueEntry);
Type = DataEntry->DataEntryType;
if (Type == Buffered || Type == Unbuffered) break;
@@ -223,29 +225,29 @@
NpAcquireExclusiveVcb();
}
- DataEntry = (PNP_DATA_QUEUE_ENTRY)Irp->Tail.Overlay.DriverContext[3];
+ DataEntry = Irp->Tail.Overlay.DriverContext[3];
if (DataEntry)
{
if (DataEntry->QueueEntry.Blink == &DataQueue->Queue)
{
DataQueue->ByteOffset = 0;
- FirstEntry = 1;
+ FirstEntry = TRUE;
}
else
{
- FirstEntry = 0;
+ FirstEntry = FALSE;
}
RemoveEntryList(&DataEntry->QueueEntry);
ClientSecurityContext = DataEntry->ClientSecurityContext;
- CompleteWrites = 1;
+ CompleteWrites = TRUE;
if (DataQueue->QueueState != WriteEntries ||
DataQueue->QuotaUsed < DataQueue->Quota ||
!DataEntry->QuotaInEntry)
{
- CompleteWrites = 0;
+ CompleteWrites = FALSE;
}
DataQueue->BytesInQueue -= DataEntry->DataSize;
Modified: trunk/reactos/drivers/filesystems/npfs/readsup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs/r…
==============================================================================
--- trunk/reactos/drivers/filesystems/npfs/readsup.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/npfs/readsup.c [iso-8859-1] Thu Aug 7 10:24:07
2014
@@ -17,12 +17,12 @@
IO_STATUS_BLOCK
NTAPI
-NpReadDataQueue(IN PNP_DATA_QUEUE DataQueue,
+NpReadDataQueue(IN PNP_DATA_QUEUE DataQueue,
IN BOOLEAN Peek,
IN BOOLEAN ReadOverflowOperation,
IN PVOID Buffer,
- IN ULONG BufferSize,
- IN ULONG Mode,
+ IN ULONG BufferSize,
+ IN ULONG Mode,
IN PNP_CCB Ccb,
IN PLIST_ENTRY List)
{
@@ -30,14 +30,14 @@
PVOID DataBuffer;
ULONG DataSize, DataLength, TotalBytesCopied, RemainingSize, Offset;
PIRP Irp;
- IO_STATUS_BLOCK Status;
+ IO_STATUS_BLOCK IoStatus;
BOOLEAN CompleteWrites = FALSE;
PAGED_CODE();
if (ReadOverflowOperation) Peek = TRUE;
RemainingSize = BufferSize;
- Status.Status = STATUS_SUCCESS;
+ IoStatus.Status = STATUS_SUCCESS;
TotalBytesCopied = 0;
if (Peek)
@@ -110,7 +110,7 @@
{
if (Mode == FILE_PIPE_MESSAGE_MODE)
{
- Status.Status = STATUS_BUFFER_OVERFLOW;
+ IoStatus.Status = STATUS_BUFFER_OVERFLOW;
break;
}
}
@@ -137,7 +137,7 @@
if (Mode == FILE_PIPE_MESSAGE_MODE)
{
- Status.Status = STATUS_SUCCESS;
+ IoStatus.Status = STATUS_SUCCESS;
break;
}
@@ -159,9 +159,9 @@
}
}
- Status.Information = TotalBytesCopied;
+ IoStatus.Information = TotalBytesCopied;
if (CompleteWrites) NpCompleteStalledWrites(DataQueue, List);
- return Status;
+ return IoStatus;
}
/* EOF */
Modified: trunk/reactos/drivers/filesystems/npfs/waitsup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs/w…
==============================================================================
--- trunk/reactos/drivers/filesystems/npfs/waitsup.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/npfs/waitsup.c [iso-8859-1] Thu Aug 7 10:24:07
2014
@@ -17,7 +17,7 @@
VOID
NTAPI
-NpCancelWaitQueueIrp(IN PDEVICE_OBJECT DeviceObject,
+NpCancelWaitQueueIrp(IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
KIRQL OldIrql;
@@ -53,7 +53,7 @@
Irp->IoStatus.Status = STATUS_CANCELLED;
IoCompleteRequest(Irp, IO_NAMED_PIPE_INCREMENT);
}
-
+
VOID
NTAPI
NpTimerDispatch(IN PKDPC Dpc,
@@ -243,7 +243,7 @@
WaitEntry->WaitQueue = WaitQueue;
WaitEntry->Irp = Irp;
- WaitBuffer = (PFILE_PIPE_WAIT_FOR_BUFFER)Irp->AssociatedIrp.SystemBuffer;
+ WaitBuffer = Irp->AssociatedIrp.SystemBuffer;
if (WaitBuffer->TimeoutSpecified)
{
DueTime = WaitBuffer->Timeout;
@@ -281,7 +281,6 @@
KeSetTimer(&WaitEntry->Timer, DueTime, &WaitEntry->Dpc);
WaitEntry = NULL;
-
}
KeReleaseSpinLock(&WaitQueue->WaitLock, OldIrql);