Author: tfaber
Date: Thu Oct 16 16:36:17 2014
New Revision: 64761
URL:
http://svn.reactos.org/svn/reactos?rev=64761&view=rev
Log:
[NPFS]
- Use NpAcquire*Vcb/NpReleaseVcb instead of using NpVcb directly
- CaseInsensitiveIndex is integer, not boolean
- Minor fixes involving unnecessary casts and magic numbers
Modified:
trunk/reactos/drivers/filesystems/npfs/create.c
trunk/reactos/drivers/filesystems/npfs/datasup.c
trunk/reactos/drivers/filesystems/npfs/fileinfo.c
trunk/reactos/drivers/filesystems/npfs/fsctrl.c
trunk/reactos/drivers/filesystems/npfs/secursup.c
trunk/reactos/drivers/filesystems/npfs/volinfo.c
trunk/reactos/drivers/filesystems/npfs/writesup.c
Modified: trunk/reactos/drivers/filesystems/npfs/create.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs/c…
==============================================================================
--- trunk/reactos/drivers/filesystems/npfs/create.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/npfs/create.c [iso-8859-1] Thu Oct 16 16:36:17 2014
@@ -384,7 +384,7 @@
IoStatus.Information = 0;
FsRtlEnterFileSystem();
- ExAcquireResourceExclusiveLite(&NpVcb->Lock, TRUE);
+ NpAcquireExclusiveVcb();
if (RelatedFileObject)
{
@@ -462,7 +462,7 @@
goto Quickie;
}
- Fcb = NpFindPrefix(&FileName, TRUE, &Prefix);
+ Fcb = NpFindPrefix(&FileName, 1, &Prefix);
}
if (Prefix.Length)
@@ -499,7 +499,7 @@
&DeferredList);
Quickie:
- ExReleaseResourceLite(&NpVcb->Lock);
+ NpReleaseVcb();
NpCompleteDeferredIrps(&DeferredList);
FsRtlExitFileSystem();
@@ -852,7 +852,7 @@
goto Quickie;
}
- Fcb = NpFindPrefix(&FileName, TRUE, &Prefix);
+ Fcb = NpFindPrefix(&FileName, 1, &Prefix);
}
if (Prefix.Length)
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 Oct 16 16:36:17
2014
@@ -85,7 +85,7 @@
{
DataQueueEntry->Irp = NULL;
- Irp->IoStatus.Status = 0;
+ Irp->IoStatus.Status = STATUS_SUCCESS;
Irp->IoStatus.Information = DataQueueEntry->DataSize;
InsertTailList(List, &Irp->Tail.Overlay.ListEntry);
@@ -216,7 +216,7 @@
InitializeListHead(&DeferredList);
- DataQueue = (PNP_DATA_QUEUE)Irp->Tail.Overlay.DriverContext[2];
+ DataQueue = Irp->Tail.Overlay.DriverContext[2];
ClientSecurityContext = NULL;
if (DeviceObject)
Modified: trunk/reactos/drivers/filesystems/npfs/fileinfo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs/f…
==============================================================================
--- trunk/reactos/drivers/filesystems/npfs/fileinfo.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/npfs/fileinfo.c [iso-8859-1] Thu Oct 16 16:36:17
2014
@@ -27,13 +27,13 @@
NTSTATUS
NTAPI
NpSetPipeInfo(IN PNP_FCB Fcb,
- IN PNP_CCB Ccb,
+ IN PNP_CCB Ccb,
IN PFILE_PIPE_INFORMATION Buffer,
- IN ULONG NamedPipeEnd,
+ IN ULONG NamedPipeEnd,
IN PLIST_ENTRY List)
{
NTSTATUS Status;
- PNP_DATA_QUEUE ReadQueue, WriteQueue;
+ PNP_DATA_QUEUE ReadQueue, WriteQueue;
PAGED_CODE();
if (Buffer->ReadMode == FILE_PIPE_MESSAGE_MODE && Fcb->NamedPipeType ==
FILE_PIPE_BYTE_STREAM_TYPE)
@@ -103,7 +103,7 @@
Buffer = Irp->AssociatedIrp.SystemBuffer;
if (InfoClass == FileBasicInformation) return NpSetBasicInfo(Ccb, Buffer);
-
+
if (InfoClass != FilePipeInformation) return STATUS_INVALID_PARAMETER;
return NpSetPipeInfo(Fcb, Ccb, Buffer, NamedPipeEnd, List);
Modified: trunk/reactos/drivers/filesystems/npfs/fsctrl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs/f…
==============================================================================
--- trunk/reactos/drivers/filesystems/npfs/fsctrl.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/npfs/fsctrl.c [iso-8859-1] Thu Oct 16 16:36:17 2014
@@ -369,7 +369,7 @@
return STATUS_INVALID_PARAMETER;
}
- PeekBuffer = (PFILE_PIPE_PEEK_BUFFER)Irp->AssociatedIrp.SystemBuffer;
+ PeekBuffer = Irp->AssociatedIrp.SystemBuffer;
if (NamedPipeEnd != FILE_PIPE_CLIENT_END)
{
if (NamedPipeEnd != FILE_PIPE_SERVER_END)
@@ -714,7 +714,7 @@
//Status = NpTranslateAlias(&SourceString);
if (!NT_SUCCESS(Status)) goto Quickie;
- Fcb = NpFindPrefix(&SourceString, TRUE, &Prefix);
+ Fcb = NpFindPrefix(&SourceString, 1, &Prefix);
Fcb = (PNP_FCB)((ULONG_PTR)Fcb & ~1);
NodeTypeCode = Fcb ? Fcb->NodeType : 0;
Modified: trunk/reactos/drivers/filesystems/npfs/secursup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs/s…
==============================================================================
--- trunk/reactos/drivers/filesystems/npfs/secursup.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/npfs/secursup.c [iso-8859-1] Thu Oct 16 16:36:17
2014
@@ -127,7 +127,6 @@
IN PETHREAD Thread,
IN PSECURITY_CLIENT_CONTEXT *Context)
{
-
PSECURITY_CLIENT_CONTEXT NewContext;
NTSTATUS Status;
PAGED_CODE();
Modified: trunk/reactos/drivers/filesystems/npfs/volinfo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs/v…
==============================================================================
--- trunk/reactos/drivers/filesystems/npfs/volinfo.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/npfs/volinfo.c [iso-8859-1] Thu Oct 16 16:36:17
2014
@@ -191,11 +191,11 @@
TRACE("Entered\n");
FsRtlEnterFileSystem();
- ExAcquireResourceSharedLite(&NpVcb->Lock, TRUE);
+ NpAcquireSharedVcb();
Status = NpCommonQueryVolumeInformation(DeviceObject, Irp);
- ExReleaseResourceLite(&NpVcb->Lock);
+ NpReleaseVcb();
FsRtlExitFileSystem();
if (Status != STATUS_PENDING)
Modified: trunk/reactos/drivers/filesystems/npfs/writesup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs/w…
==============================================================================
--- trunk/reactos/drivers/filesystems/npfs/writesup.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/npfs/writesup.c [iso-8859-1] Thu Oct 16 16:36:17
2014
@@ -15,7 +15,7 @@
/* FUNCTIONS ******************************************************************/
-NTSTATUS
+NTSTATUS
NTAPI
NpWriteDataQueue(IN PNP_DATA_QUEUE WriteQueue,
IN ULONG Mode,
@@ -57,9 +57,9 @@
{
DataSize = DataEntry->DataSize;
- IoStack = IoGetCurrentIrpStackLocation( DataEntry->Irp);
+ IoStack = IoGetCurrentIrpStackLocation(DataEntry->Irp);
- if (IoStack->MajorFunction == IRP_MJ_FILE_SYSTEM_CONTROL &&
+ if (IoStack->MajorFunction == IRP_MJ_FILE_SYSTEM_CONTROL &&
IoStack->Parameters.FileSystemControl.FsControlCode ==
FSCTL_PIPE_INTERNAL_READ_OVFLOW &&
(DataSize < OutBufferSize || MoreProcessing))
{
@@ -76,7 +76,7 @@
{
DataEntry->Irp->Overlay.AllocationSize.QuadPart = 0;
}
-
+
BufferSize = *BytesNotWritten;
if (BufferSize >= DataSize) BufferSize = DataSize;