mirror of
https://github.com/reactos/reactos.git
synced 2025-07-23 11:33:43 +00:00
[NPFS]
- Use NpAcquire*Vcb/NpReleaseVcb instead of using NpVcb directly - CaseInsensitiveIndex is integer, not boolean - Minor fixes involving unnecessary casts and magic numbers svn path=/trunk/; revision=64761
This commit is contained in:
parent
a28fa3fdf0
commit
c38e07c128
7 changed files with 18 additions and 19 deletions
|
@ -384,7 +384,7 @@ NpFsdCreate(IN PDEVICE_OBJECT DeviceObject,
|
|||
IoStatus.Information = 0;
|
||||
|
||||
FsRtlEnterFileSystem();
|
||||
ExAcquireResourceExclusiveLite(&NpVcb->Lock, TRUE);
|
||||
NpAcquireExclusiveVcb();
|
||||
|
||||
if (RelatedFileObject)
|
||||
{
|
||||
|
@ -462,7 +462,7 @@ NpFsdCreate(IN PDEVICE_OBJECT DeviceObject,
|
|||
goto Quickie;
|
||||
}
|
||||
|
||||
Fcb = NpFindPrefix(&FileName, TRUE, &Prefix);
|
||||
Fcb = NpFindPrefix(&FileName, 1, &Prefix);
|
||||
}
|
||||
|
||||
if (Prefix.Length)
|
||||
|
@ -499,7 +499,7 @@ NpFsdCreate(IN PDEVICE_OBJECT DeviceObject,
|
|||
&DeferredList);
|
||||
|
||||
Quickie:
|
||||
ExReleaseResourceLite(&NpVcb->Lock);
|
||||
NpReleaseVcb();
|
||||
NpCompleteDeferredIrps(&DeferredList);
|
||||
FsRtlExitFileSystem();
|
||||
|
||||
|
@ -852,7 +852,7 @@ NpFsdCreateNamedPipe(IN PDEVICE_OBJECT DeviceObject,
|
|||
goto Quickie;
|
||||
}
|
||||
|
||||
Fcb = NpFindPrefix(&FileName, TRUE, &Prefix);
|
||||
Fcb = NpFindPrefix(&FileName, 1, &Prefix);
|
||||
}
|
||||
|
||||
if (Prefix.Length)
|
||||
|
|
|
@ -85,7 +85,7 @@ NpCompleteStalledWrites(IN PNP_DATA_QUEUE DataQueue,
|
|||
{
|
||||
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 @@ NpCancelDataQueueIrp(IN PDEVICE_OBJECT DeviceObject,
|
|||
|
||||
InitializeListHead(&DeferredList);
|
||||
|
||||
DataQueue = (PNP_DATA_QUEUE)Irp->Tail.Overlay.DriverContext[2];
|
||||
DataQueue = Irp->Tail.Overlay.DriverContext[2];
|
||||
ClientSecurityContext = NULL;
|
||||
|
||||
if (DeviceObject)
|
||||
|
|
|
@ -27,13 +27,13 @@ NpSetBasicInfo(IN PNP_CCB Ccb,
|
|||
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 @@ NpCommonSetInformation(IN PDEVICE_OBJECT DeviceObject,
|
|||
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);
|
||||
|
|
|
@ -369,7 +369,7 @@ NpPeek(IN PDEVICE_OBJECT DeviceObject,
|
|||
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 @@ NpWaitForNamedPipe(IN PDEVICE_OBJECT DeviceObject,
|
|||
//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;
|
||||
|
|
|
@ -127,7 +127,6 @@ NpGetClientSecurityContext(IN ULONG NamedPipeEnd,
|
|||
IN PETHREAD Thread,
|
||||
IN PSECURITY_CLIENT_CONTEXT *Context)
|
||||
{
|
||||
|
||||
PSECURITY_CLIENT_CONTEXT NewContext;
|
||||
NTSTATUS Status;
|
||||
PAGED_CODE();
|
||||
|
|
|
@ -191,11 +191,11 @@ NpFsdQueryVolumeInformation(IN PDEVICE_OBJECT DeviceObject,
|
|||
TRACE("Entered\n");
|
||||
|
||||
FsRtlEnterFileSystem();
|
||||
ExAcquireResourceSharedLite(&NpVcb->Lock, TRUE);
|
||||
NpAcquireSharedVcb();
|
||||
|
||||
Status = NpCommonQueryVolumeInformation(DeviceObject, Irp);
|
||||
|
||||
ExReleaseResourceLite(&NpVcb->Lock);
|
||||
NpReleaseVcb();
|
||||
FsRtlExitFileSystem();
|
||||
|
||||
if (Status != STATUS_PENDING)
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
/* FUNCTIONS ******************************************************************/
|
||||
|
||||
NTSTATUS
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
NpWriteDataQueue(IN PNP_DATA_QUEUE WriteQueue,
|
||||
IN ULONG Mode,
|
||||
|
@ -57,9 +57,9 @@ NpWriteDataQueue(IN PNP_DATA_QUEUE WriteQueue,
|
|||
{
|
||||
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 @@ NpWriteDataQueue(IN PNP_DATA_QUEUE WriteQueue,
|
|||
{
|
||||
DataEntry->Irp->Overlay.AllocationSize.QuadPart = 0;
|
||||
}
|
||||
|
||||
|
||||
BufferSize = *BytesNotWritten;
|
||||
if (BufferSize >= DataSize) BufferSize = DataSize;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue