diff --git a/src/sys/driver.h b/src/sys/driver.h index 9789fffc..22408acb 100644 --- a/src/sys/driver.h +++ b/src/sys/driver.h @@ -389,7 +389,7 @@ PVOID FspAllocateIrpMustSucceed(CCHAR StackSize); BOOLEAN FspUnicodePathIsValid(PUNICODE_STRING Path, BOOLEAN AllowStreams); VOID FspUnicodePathSuffix(PUNICODE_STRING Path, PUNICODE_STRING Remain, PUNICODE_STRING Suffix); NTSTATUS FspCreateGuid(GUID *Guid); -NTSTATUS FspSendSetInformationIrp(PFILE_OBJECT FileObject, +NTSTATUS FspSendSetInformationIrp(PDEVICE_OBJECT DeviceObject, PFILE_OBJECT FileObject, FILE_INFORMATION_CLASS FileInformationClass, PVOID FileInformation, ULONG Length); NTSTATUS FspLockUserBuffer(PVOID UserBuffer, ULONG Length, KPROCESSOR_MODE RequestorMode, LOCK_OPERATION Operation, PMDL *PMdl); diff --git a/src/sys/util.c b/src/sys/util.c index f357034d..ecc72d78 100644 --- a/src/sys/util.c +++ b/src/sys/util.c @@ -9,7 +9,7 @@ BOOLEAN FspUnicodePathIsValid(PUNICODE_STRING Path, BOOLEAN AllowStreams); VOID FspUnicodePathSuffix(PUNICODE_STRING Path, PUNICODE_STRING Remain, PUNICODE_STRING Suffix); NTSTATUS FspCreateGuid(GUID *Guid); -NTSTATUS FspSendSetInformationIrp(PFILE_OBJECT FileObject, +NTSTATUS FspSendSetInformationIrp(PDEVICE_OBJECT DeviceObject, PFILE_OBJECT FileObject, FILE_INFORMATION_CLASS FileInformationClass, PVOID FileInformation, ULONG Length); static NTSTATUS FspSendSetInformationIrpCompletion( PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context0); @@ -196,7 +196,7 @@ typedef struct KEVENT Event; } FSP_SEND_SET_INFORMATION_IRP_CONTEXT; -NTSTATUS FspSendSetInformationIrp(PFILE_OBJECT FileObject, +NTSTATUS FspSendSetInformationIrp(PDEVICE_OBJECT DeviceObject, PFILE_OBJECT FileObject, FILE_INFORMATION_CLASS FileInformationClass, PVOID FileInformation, ULONG Length) { PAGED_CODE(); @@ -206,12 +206,12 @@ NTSTATUS FspSendSetInformationIrp(PFILE_OBJECT FileObject, FileEndOfFileInformation == FileInformationClass); NTSTATUS Result; - PDEVICE_OBJECT DeviceObject; PIRP Irp; PIO_STACK_LOCATION IrpSp; FSP_SEND_SET_INFORMATION_IRP_CONTEXT Context; - DeviceObject = IoGetRelatedDeviceObject(FileObject); + if (0 == DeviceObject) + DeviceObject = IoGetRelatedDeviceObject(FileObject); Irp = IoAllocateIrp(DeviceObject->StackSize, FALSE); if (0 == Irp) diff --git a/src/sys/write.c b/src/sys/write.c index 2d728985..ed636127 100644 --- a/src/sys/write.c +++ b/src/sys/write.c @@ -169,8 +169,8 @@ static NTSTATUS FspFsvolWriteCached( ASSERT(CanWait); EndOfFileInformation.EndOfFile.QuadPart = WriteEndOffset; - Result = FspSendSetInformationIrp(FileObject, FileEndOfFileInformation, - &EndOfFileInformation, sizeof EndOfFileInformation); + Result = FspSendSetInformationIrp(FsvolDeviceObject/* bypass filters */, FileObject, + FileEndOfFileInformation, &EndOfFileInformation, sizeof EndOfFileInformation); if (!NT_SUCCESS(Result)) { FspFileNodeRelease(FileNode, Main);