21#define MAX_ZERO_LENGTH (256 * 1024)
66 DbgPrint(
"Can't allocate CcZeroPage.\n");
98 if (DeferredWrite->
Event)
144 SharedCacheMap =
FileObject->SectionObjectPointer->SharedCacheMap;
153 PrivateCacheMap =
FileObject->PrivateCacheMap;
155 if (PrivateCacheMap ==
NULL)
198 if (PartialLength != 0)
231 CurrentOffset += PartialLength;
267 CurrentOffset += PartialLength;
273 PrivateCacheMap =
FileObject->PrivateCacheMap;
274 if (PrivateCacheMap !=
NULL)
324 TryContext = Retrying;
341 PerFileDefer =
FALSE;
357 SharedCacheMap =
FileObject->SectionObjectPointer->SharedCacheMap;
420 Context.BytesToWrite = BytesToWrite;
477 if ((ExceptionAddress >= BeginAddress) && (ExceptionAddress < EndAddress))
506 DPRINT(
"CcCopyRead(FileObject 0x%p, FileOffset %I64x, "
507 "Length %lu, Wait %u, Buffer 0x%p, IoStatus 0x%p)\n",
518 while(CurrentOffset < ReadEnd)
531 SIZE_T CopyLength = VacbLength;
549 CurrentOffset += VacbLength;
609 DPRINT(
"CcCopyWrite(FileObject 0x%p, FileOffset %I64x, "
610 "Length %lu, Wait %u, Buffer 0x%p)\n",
620 ASSERT(WriteEnd <= SharedCacheMap->SectionSize.QuadPart);
623 while(CurrentOffset < WriteEnd)
653 CurrentOffset += VacbLength;
694 CCTRACE(
CC_API_DEBUG,
"FileObject=%p PostRoutine=%p Context1=%p Context2=%p BytesToWrite=%lu Retrying=%d\n",
713 Context->PostRoutine = PostRoutine;
716 Context->BytesToWrite = BytesToWrite;
824 DPRINT(
"CcZeroData(FileObject 0x%p, StartOffset %I64x, EndOffset %I64x, "
825 "Wait %u)\n",
FileObject, StartOffset->QuadPart, EndOffset->QuadPart,
828 Length = EndOffset->QuadPart - StartOffset->QuadPart;
856 Mdl->ByteCount = CurrentLength;
DECLSPEC_NORETURN VOID NTAPI KeBugCheck(ULONG BugCheckCode)
VOID NTAPI CcFlushCache(IN PSECTION_OBJECT_POINTERS SectionObjectPointer, IN OPTIONAL PLARGE_INTEGER FileOffset, IN ULONG Length, OUT OPTIONAL PIO_STATUS_BLOCK IoStatus)
VOID NTAPI CcScheduleReadAhead(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length)
_In_ PFCB _In_ LONGLONG FileOffset
#define NT_SUCCESS(StatCode)
#define InsertHeadList(ListHead, Entry)
#define ExAllocatePoolWithTag(hernya, size, tag)
#define IsListEmpty(ListHead)
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
#define KeInitializeEvent(pEvt, foo, foo2)
#define KeSetEvent(pEvt, foo, foo2)
#define RemoveTailList(ListHead)
#define InitializeListHead(ListHead)
#define ROUND_DOWN(n, align)
#define BooleanFlagOn(F, SF)
#define FSRTL_FLAG_LIMIT_MODIFIED_PAGES
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
VOID FASTCALL KeReleaseQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber, IN KIRQL OldIrql)
KIRQL FASTCALL KeAcquireQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber)
#define EXCEPTION_EXECUTE_HANDLER
#define EXCEPTION_CONTINUE_SEARCH
PLIST_ENTRY NTAPI ExInterlockedInsertHeadList(IN OUT PLIST_ENTRY ListHead, IN OUT PLIST_ENTRY ListEntry, IN OUT PKSPIN_LOCK Lock)
PLIST_ENTRY NTAPI ExInterlockedInsertTailList(IN OUT PLIST_ENTRY ListHead, IN OUT PLIST_ENTRY ListEntry, IN OUT PKSPIN_LOCK Lock)
PLIST_ENTRY NTAPI ExInterlockedRemoveHeadList(IN OUT PLIST_ENTRY ListHead, IN OUT PKSPIN_LOCK Lock)
NTSTATUS NTAPI IoSynchronousPageWrite(IN PFILE_OBJECT FileObject, IN PMDL Mdl, IN PLARGE_INTEGER Offset, IN PKEVENT Event, IN PIO_STATUS_BLOCK StatusBlock)
LARGE_INTEGER CcIdleDelay
VOID CcScheduleLazyWriteScan(IN BOOLEAN NoDelay)
VOID NTAPI MmUnmapLockedPages(IN PVOID BaseAddress, IN PMDL Mdl)
#define ExFreePoolWithTag(_P, _T)
__in UCHAR __in POWER_STATE __in_opt PVOID __in PIO_STATUS_BLOCK IoStatus
#define PRIVATE_CACHE_MAP_READ_AHEAD_ACTIVE
struct _DEFERRED_WRITE DEFERRED_WRITE
_In_ PMEMORY_AREA _In_ PVOID _In_ BOOLEAN Locked
#define DBG_UNREFERENCED_PARAMETER(P)
_In_ ULONG _In_ ULONG _In_ ULONG Length
VOID NTAPI CcFastCopyWrite(IN PFILE_OBJECT FileObject, IN ULONG FileOffset, IN ULONG Length, IN PVOID Buffer)
ULONG CcFastMdlReadNotPossible
ULONG CcFastReadResourceMiss
VOID CcPostDeferredWrites(VOID)
static int CcpCheckInvalidUserBuffer(PEXCEPTION_POINTERS Except, PVOID Buffer, ULONG Length)
VOID NTAPI MiZeroPhysicalPage(IN PFN_NUMBER PageFrameIndex)
BOOLEAN NTAPI CcCopyWrite(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN BOOLEAN Wait, IN PVOID Buffer)
static PFN_NUMBER CcZeroPage
VOID NTAPI CcInitCacheZeroPage(VOID)
VOID CcPerformReadAhead(IN PFILE_OBJECT FileObject)
BOOLEAN NTAPI CcCanIWrite(IN PFILE_OBJECT FileObject, IN ULONG BytesToWrite, IN BOOLEAN Wait, IN BOOLEAN 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)
BOOLEAN NTAPI CcZeroData(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER StartOffset, IN PLARGE_INTEGER EndOffset, IN BOOLEAN Wait)
ULONG CcFastReadNotPossible
enum _CC_CAN_WRITE_RETRY CC_CAN_WRITE_RETRY
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 NTAPI CcDeferWrite(IN PFILE_OBJECT FileObject, IN PCC_POST_DEFERRED_WRITE PostRoutine, IN PVOID Context1, IN PVOID Context2, IN ULONG BytesToWrite, IN BOOLEAN Retrying)
KSPIN_LOCK CcDeferredWriteSpinLock
NTSTATUS CcRosReleaseVacb(PROS_SHARED_CACHE_MAP SharedCacheMap, PROS_VACB Vacb, BOOLEAN Dirty, BOOLEAN Mapped)
NTSTATUS CcRosRequestVacb(PROS_SHARED_CACHE_MAP SharedCacheMap, LONGLONG FileOffset, PROS_VACB *Vacb)
LIST_ENTRY CcDeferredWrites
BOOLEAN CcRosEnsureVacbResident(_In_ PROS_VACB Vacb, _In_ BOOLEAN Wait, _In_ BOOLEAN NoRead, _In_ ULONG Offset, _In_ ULONG Length)
NTSTATUS CcRosGetVacb(PROS_SHARED_CACHE_MAP SharedCacheMap, LONGLONG FileOffset, PROS_VACB *Vacb)
ULONG CcDirtyPageThreshold
#define NODE_TYPE_DEFERRED_WRITE
#define CCTRACE(x, fmt,...)
NTSTATUS NTAPI MmMakeSegmentDirty(_In_ PSECTION_OBJECT_POINTERS SectionObjectPointer, _In_ LONGLONG Offset, _In_ ULONG Length)
MMPFNLIST MmModifiedPageListHead
PFN_NUMBER MmAvailablePages
NTSTATUS NTAPI MmRequestPageMemoryConsumer(ULONG Consumer, BOOLEAN MyWait, PPFN_NUMBER AllocatedPage)
BOOLEAN NTAPI IoIsFileOriginRemote(IN PFILE_OBJECT FileObject)
#define STATUS_ACCESS_VIOLATION
#define _SEH2_AbnormalTermination()
#define _SEH2_EXCEPT(...)
#define _SEH2_GetExceptionInformation()
#define KeAcquireSpinLockAtDpcLevel(SpinLock)
#define KeReleaseSpinLockFromDpcLevel(SpinLock)
PACQUIRE_FOR_READ_AHEAD AcquireForReadAhead
PRELEASE_FROM_READ_AHEAD ReleaseFromReadAhead
PCC_POST_DEFERRED_WRITE PostRoutine
BOOLEAN LimitModifiedPages
LIST_ENTRY DeferredWriteLinks
PEXCEPTION_RECORD ExceptionRecord
ULONG_PTR ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS]
LARGE_INTEGER BeyondLastByte1
LARGE_INTEGER FileOffset2
LARGE_INTEGER FileOffset1
LARGE_INTEGER ReadAheadOffset[2]
KSPIN_LOCK ReadAheadSpinLock
LARGE_INTEGER BeyondLastByte2
LARGE_INTEGER ValidDataLength
PCACHE_MANAGER_CALLBACKS Callbacks
LARGE_INTEGER SectionSize
_In_ PNET_PNP_EVENT _In_ PTDI_PNP_CONTEXT Context1
_In_ PNET_PNP_EVENT _In_ PTDI_PNP_CONTEXT _In_ PTDI_PNP_CONTEXT Context2
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define CONTAINING_RECORD(address, type, field)
#define STATUS_INVALID_USER_BUFFER
#define STATUS_INSUFFICIENT_RESOURCES
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl
_In_ WDFDPC _In_ BOOLEAN Wait
_Must_inspect_result_ _In_ WDFUSBPIPE _In_ WDFREQUEST _In_opt_ WDFMEMORY _In_opt_ PWDFMEMORY_OFFSET WriteOffset
#define VACB_MAPPING_GRANULARITY
VOID(NTAPI * PCC_POST_DEFERRED_WRITE)(_In_ PVOID Context1, _In_ PVOID Context2)
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
#define BYTES_TO_PAGES(Size)
#define MmGetMdlPfnArray(_Mdl)
#define MDL_MAPPED_TO_SYSTEM_VA
#define ObDereferenceObject