NTSTATUS NTAPI NpFsdQueryVolumeInformation(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) { NTSTATUS Status; PAGED_CODE(); TRACE("Entered\n"); FsRtlEnterFileSystem(); NpAcquireSharedVcb(); Status = NpCommonQueryVolumeInformation(DeviceObject, Irp); NpReleaseVcb(); FsRtlExitFileSystem(); if (Status != STATUS_PENDING) { Irp->IoStatus.Status = Status; IoCompleteRequest(Irp, IO_NAMED_PIPE_INCREMENT); } TRACE("Leaving, Status = %lx\n", Status); return Status; }
_IRQL_requires_same_ BOOLEAN NTAPI NpFastWrite( _In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ ULONG Length, _In_ BOOLEAN Wait, _In_ ULONG LockKey, _In_ PVOID Buffer, _Out_ PIO_STATUS_BLOCK IoStatus, _In_ PDEVICE_OBJECT DeviceObject) { LIST_ENTRY DeferredList; BOOLEAN Result; PAGED_CODE(); InitializeListHead(&DeferredList); FsRtlEnterFileSystem(); NpAcquireSharedVcb(); Result = NpCommonWrite(FileObject, Buffer, Length, PsGetCurrentThread(), IoStatus, NULL, &DeferredList); if (Result) ++NpFastWriteTrue; else ++NpFastWriteFalse; NpReleaseVcb(); NpCompleteDeferredIrps(&DeferredList); FsRtlExitFileSystem(); return Result; }
NTSTATUS NTAPI NpFsdWrite(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) { PIO_STACK_LOCATION IoStack; IO_STATUS_BLOCK IoStatus; LIST_ENTRY DeferredList; PAGED_CODE(); NpSlowWriteCalls++; InitializeListHead(&DeferredList); IoStack = IoGetCurrentIrpStackLocation(Irp); FsRtlEnterFileSystem(); NpAcquireSharedVcb(); NpCommonWrite(IoStack->FileObject, Irp->UserBuffer, IoStack->Parameters.Write.Length, Irp->Tail.Overlay.Thread, &IoStatus, Irp, &DeferredList); NpReleaseVcb(); NpCompleteDeferredIrps(&DeferredList); FsRtlExitFileSystem(); if (IoStatus.Status != STATUS_PENDING) { Irp->IoStatus.Information = IoStatus.Information; Irp->IoStatus.Status = IoStatus.Status; IoCompleteRequest(Irp, IO_NAMED_PIPE_INCREMENT); } return IoStatus.Status; }
NTSTATUS NTAPI NpFsdFlushBuffers(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) { NTSTATUS Status; PAGED_CODE(); FsRtlEnterFileSystem(); NpAcquireSharedVcb(); Status = NpCommonFlushBuffers(DeviceObject, Irp); NpReleaseVcb(); FsRtlExitFileSystem(); if (Status != STATUS_PENDING) { Irp->IoStatus.Status = Status; IoCompleteRequest(Irp, IO_NAMED_PIPE_INCREMENT); } return Status; }
NTSTATUS NpFsdQueryInformation ( IN PNPFS_DEVICE_OBJECT NpfsDeviceObject, IN PIRP Irp ) /*++ Routine Description: This routine implements the FSD part of the NtQueryInformationFile API calls. Arguments: NpfsDeviceObject - Supplies the device object to use. Irp - Supplies the Irp being processed Return Value: NTSTATUS - The Fsd status for the Irp --*/ { NTSTATUS Status; PAGED_CODE(); DebugTrace(+1, Dbg, "NpFsdQueryInformation\n", 0); // // Call the common Query Information routine. // FsRtlEnterFileSystem(); NpAcquireSharedVcb(); try { Status = NpCommonQueryInformation( NpfsDeviceObject, Irp ); } except(NpExceptionFilter( GetExceptionCode() )) { // // We had some trouble trying to perform the requested // operation, so we'll abort the I/O request with // the error status that we get back from the // execption code // Status = NpProcessException( NpfsDeviceObject, Irp, GetExceptionCode() ); } NpReleaseVcb(); FsRtlExitFileSystem(); // // And return to our caller // DebugTrace(-1, Dbg, "NpFsdQueryInformation -> %08lx\n", Status ); return Status; }