109 FastIoDispatch = RelatedDeviceObject->DriverObject->FastIoDispatch;
203 BOOLEAN WriteToEof, AcquiredShared, FileSizeChanged, Ret;
240 AcquiredShared =
FALSE;
241 FileSizeChanged =
FALSE;
247 if (!
Wait || (
Fcb->AllocationSize.HighPart != 0))
267 AcquiredShared =
TRUE;
295 if ((
Fcb->ValidDataLength.QuadPart + 0x2000 <=
WriteOffset.QuadPart) ||
297 (
Fcb->AllocationSize.QuadPart < LastOffset.
QuadPart))
306 if (AcquiredShared && LastOffset.
QuadPart >
Fcb->ValidDataLength.QuadPart)
334 if (
Fcb->AllocationSize.QuadPart < LastOffset.
QuadPart)
350 FastIoDispatch = RelatedDeviceObject->DriverObject->FastIoDispatch;
357 FALSE, &LocalIoStatus,
358 RelatedDeviceObject))
372 FileSizeChanged =
TRUE;
374 InitialValidDataLength.
QuadPart =
Fcb->ValidDataLength.QuadPart;
376 if (LastOffset.
HighPart !=
Fcb->FileSize.HighPart &&
398 if (LastOffset.
QuadPart >
Fcb->ValidDataLength.QuadPart)
426 if (LastOffset.
QuadPart >
Fcb->ValidDataLength.QuadPart)
428 if (LastOffset.
HighPart !=
Fcb->ValidDataLength.HighPart &&
432 Fcb->ValidDataLength.QuadPart = LastOffset.
QuadPart;
437 Fcb->ValidDataLength.QuadPart = LastOffset.
QuadPart;
463 Fcb->ValidDataLength.QuadPart = InitialValidDataLength.
QuadPart;
469 Fcb->ValidDataLength.QuadPart = InitialValidDataLength.
QuadPart;
492 AcquiredShared =
TRUE;
503 AboveFour = (LastOffset.
LowPart <
Fcb->FileSize.LowPart);
527 if ((
Fcb->AllocationSize.LowPart < LastOffset.
LowPart) ||
538 if (AcquiredShared && LastOffset.
LowPart >
Fcb->ValidDataLength.LowPart)
551 AboveFour = (LastOffset.
LowPart <
Fcb->FileSize.LowPart);
567 if ((
Fcb->AllocationSize.LowPart < LastOffset.
LowPart) ||
568 (
Fcb->AllocationSize.HighPart != 0) || AboveFour)
584 FastIoDispatch = RelatedDeviceObject->DriverObject->FastIoDispatch;
591 FALSE, &LocalIoStatus,
592 RelatedDeviceObject))
604 if (LastOffset.
LowPart >
Fcb->FileSize.LowPart)
606 FileSizeChanged =
TRUE;
607 InitialFileSize.
LowPart =
Fcb->FileSize.LowPart;
608 InitialValidDataLength.
LowPart =
Fcb->ValidDataLength.LowPart;
623 if (LastOffset.
LowPart >
Fcb->ValidDataLength.LowPart)
646 if (LastOffset.
LowPart >
Fcb->ValidDataLength.LowPart)
648 Fcb->ValidDataLength.LowPart = LastOffset.
LowPart;
673 Fcb->FileSize.LowPart = InitialFileSize.
LowPart;
674 Fcb->ValidDataLength.LowPart = InitialValidDataLength.
LowPart;
679 Fcb->FileSize.LowPart = InitialFileSize.
LowPart;
680 Fcb->ValidDataLength.LowPart = InitialValidDataLength.
LowPart;
NTKERNELAPI BOOLEAN NTAPI CcCopyWriteWontFlush(_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ ULONG Length)
#define CcGetFileSizePointer(FO)
_In_ PFCB _In_ LONGLONG FileOffset
_Acquires_exclusive_lock_ Resource _Acquires_shared_lock_ Resource _Inout_ PERESOURCE Resource
#define ExAcquireResourceExclusiveLite(res, wait)
#define ExAcquireResourceSharedLite(res, wait)
#define FILE_WRITE_TO_END_OF_FILE
#define BooleanFlagOn(F, SF)
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG LockKey
#define FsRtlEnterFileSystem
#define FsRtlExitFileSystem
BOOLEAN NTAPI CcZeroData(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER StartOffset, IN PLARGE_INTEGER EndOffset, IN BOOLEAN Wait)
#define EXCEPTION_EXECUTE_HANDLER
#define EXCEPTION_CONTINUE_SEARCH
CRITICAL_SECTION CriticalSection
__in UCHAR __in POWER_STATE __in_opt PVOID __in PIO_STATUS_BLOCK IoStatus
_In_ ULONG _In_ ULONG _In_ ULONG Length
VOID NTAPI CcFastCopyWrite(IN PFILE_OBJECT FileObject, IN ULONG FileOffset, IN ULONG Length, IN PVOID Buffer)
BOOLEAN NTAPI CcCopyWrite(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN BOOLEAN Wait, IN PVOID Buffer)
BOOLEAN NTAPI CcCanIWrite(IN PFILE_OBJECT FileObject, IN ULONG BytesToWrite, IN BOOLEAN Wait, IN UCHAR Retrying)
BOOLEAN NTAPI CcCopyRead(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN BOOLEAN Wait, OUT PVOID Buffer, OUT PIO_STATUS_BLOCK IoStatus)
VOID NTAPI CcFastCopyRead(IN PFILE_OBJECT FileObject, IN ULONG FileOffset, IN ULONG Length, IN ULONG PageCount, OUT PVOID Buffer, OUT PIO_STATUS_BLOCK IoStatus)
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
BOOLEAN NTAPI FsRtlIsNtstatusExpected(IN NTSTATUS NtStatus)
PDEVICE_OBJECT NTAPI IoGetRelatedDeviceObject(IN PFILE_OBJECT FileObject)
VOID NTAPI IoSetTopLevelIrp(IN PIRP Irp)
FAST_IO_DISPATCH FastIoDispatch
#define _SEH2_GetExceptionCode()
#define _SEH2_EXCEPT(...)
BOOLEAN FsRtlCopyRead2(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN BOOLEAN Wait, IN ULONG LockKey, OUT PVOID Buffer, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject, IN PVOID TopLevelContext)
BOOLEAN FsRtlCopyWrite2(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, IN PVOID TopLevelContext)
#define STATUS_END_OF_FILE
PFAST_IO_CHECK_IF_POSSIBLE FastIoCheckIfPossible
ERESOURCE PagingIoResource
_In_ PDEVICE_OBJECT DeviceObject
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
_In_ WDFDPC _In_ BOOLEAN Wait
_Must_inspect_result_ _In_ WDFUSBPIPE _In_ WDFREQUEST _In_opt_ WDFMEMORY _In_opt_ PWDFMEMORY_OFFSET WriteOffset
#define FO_FILE_FAST_IO_READ
#define FO_FILE_SIZE_CHANGED
#define ADDRESS_AND_SIZE_TO_SPAN_PAGES(_Va, _Size)