11#define CC_API_DEBUG 0x01
17#ifdef NEW_DEBUG_SYSTEM_IMPLEMENTED
18#define CCTRACE(x, ...) \
20 DbgPrintEx("%s [%.16s] - ", \
22 PsGetCurrentProcess()->ImageFileName); \
23 DbgPrintEx(__VA_ARGS__); \
26#define CCTRACE(x, ...) \
27 if (x & CcRosTraceLevel) \
29 DbgPrint("%s [%.16s] - ", \
31 PsGetCurrentProcess()->ImageFileName); \
32 DbgPrint(__VA_ARGS__); \
36#define CCTRACE(x, fmt, ...) DPRINT(fmt, ##__VA_ARGS__)
202#define READAHEAD_DISABLED 0x1
203#define WRITEBEHIND_DISABLED 0x2
204#define SHARED_CACHE_MAP_IN_CREATION 0x4
205#define SHARED_CACHE_MAP_IN_LAZYWRITE 0x8
287#define NODE_TYPE_DEFERRED_WRITE 0x02FC
288#define NODE_TYPE_PRIVATE_MAP 0x02FE
289#define NODE_TYPE_SHARED_MAP 0x02FF
402 PVOID LazyWriterContext
470#define CcBugCheck(A, B, C) KeBugCheckEx(CACHE_MANAGER, BugCheckFileId | ((ULONG)(__LINE__)), A, B, C)
473#define CcRosVacbIncRefCount(vacb) CcRosVacbIncRefCount_(vacb,__FILE__,__LINE__)
474#define CcRosVacbDecRefCount(vacb) CcRosVacbDecRefCount_(vacb,__FILE__,__LINE__)
475#define CcRosVacbGetRefCount(vacb) CcRosVacbGetRefCount_(vacb,__FILE__,__LINE__)
478CcRosVacbIncRefCount_(
484CcRosVacbDecRefCount_(
490CcRosVacbGetRefCount_(
496#define CcRosVacbIncRefCount(vacb) InterlockedIncrement((PLONG)&(vacb)->ReferenceCount)
511#define CcRosVacbGetRefCount(vacb) InterlockedCompareExchange((PLONG)&(vacb)->ReferenceCount, 0, 0)
static CC_FILE_SIZES FileSizes
#define InterlockedDecrement
_In_ PFCB _In_ LONGLONG FileOffset
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _Outptr_ PMDL * MdlChain
_In_ ULONG _In_ ULONG Offset
_In_ ULONG _In_ ULONG _In_ ULONG Length
struct _PFSN_TRACE_DUMP * PPFSN_TRACE_DUMP
struct _PF_LOG_ENTRY * PPF_LOG_ENTRY
VOID NTAPI CcShutdownLazyWriter(VOID)
struct _ROS_VACB ROS_VACB
struct _PF_LOG_ENTRY PF_LOG_ENTRY
VOID NTAPI CcShutdownSystem(VOID)
VOID NTAPI CcWorkerThread(PVOID Parameter)
struct _PF_SECTION_INFO PF_SECTION_INFO
NPAGED_LOOKASIDE_LIST CcTwilightLookasideList
NTSTATUS CcRosInternalFreeVacb(IN PROS_VACB Vacb)
struct _PF_SCENARIO_ID PF_SCENARIO_ID
VOID CcPostDeferredWrites(VOID)
VOID NTAPI CcMdlReadComplete2(IN PFILE_OBJECT FileObject, IN PMDL MemoryDescriptorList)
struct _LAZY_WRITER * PLAZY_WRITER
VOID CcRosMarkDirtyVacb(PROS_VACB Vacb)
struct _ROS_SHARED_CACHE_MAP ROS_SHARED_CACHE_MAP
struct _LAZY_WRITER LAZY_WRITER
NTSTATUS CcRosInitializeFileCache(PFILE_OBJECT FileObject, PCC_FILE_SIZES FileSizes, BOOLEAN PinAccess, PCACHE_MANAGER_CALLBACKS CallBacks, PVOID LazyWriterContext)
BOOLEAN CcInitializeCacheManager(VOID)
KSPIN_LOCK CcDeferredWriteSpinLock
NTSTATUS CcRosReleaseVacb(PROS_SHARED_CACHE_MAP SharedCacheMap, PROS_VACB Vacb, BOOLEAN Dirty, BOOLEAN Mapped)
struct _PFSN_TRACE_HEADER PFSN_TRACE_HEADER
VOID CcScheduleLazyWriteScan(BOOLEAN NoDelay)
struct _PFSN_PREFETCHER_GLOBALS PFSN_PREFETCHER_GLOBALS
VOID NTAPI CcInitCacheZeroPage(VOID)
struct _INTERNAL_BCB * PINTERNAL_BCB
struct _PF_SECTION_INFO * PPF_SECTION_INFO
NTSTATUS CcRosFlushVacb(_In_ PROS_VACB Vacb, _Out_opt_ PIO_STATUS_BLOCK Iosb)
VOID NTAPI CcMdlWriteComplete2(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN PMDL MdlChain)
enum _WORK_QUEUE_FUNCTIONS WORK_QUEUE_FUNCTIONS
FORCEINLINE BOOLEAN IsPointInRange(_In_ LONGLONG Offset1, _In_ LONGLONG Length1, _In_ LONGLONG Point)
NTSTATUS CcRosRequestVacb(PROS_SHARED_CACHE_MAP SharedCacheMap, LONGLONG FileOffset, PROS_VACB *Vacb)
LIST_ENTRY CcDeferredWrites
LIST_ENTRY CcRegularWorkQueue
VOID CcPostWorkQueue(IN PWORK_QUEUE_ENTRY WorkItem, IN PLIST_ENTRY WorkQueue)
struct _PF_TRACE_HEADER PF_TRACE_HEADER
LARGE_INTEGER CcIdleDelay
BOOLEAN CcRosEnsureVacbResident(_In_ PROS_VACB Vacb, _In_ BOOLEAN Wait, _In_ BOOLEAN NoRead, _In_ ULONG Offset, _In_ ULONG Length)
enum _WORK_QUEUE_FUNCTIONS * PWORK_QUEUE_FUNCTIONS
LIST_ENTRY CcExpressWorkQueue
PROS_VACB CcRosLookupVacb(PROS_SHARED_CACHE_MAP SharedCacheMap, LONGLONG FileOffset)
VOID CcPerformReadAhead(IN PFILE_OBJECT FileObject)
NTSTATUS CcRosReleaseFileCache(PFILE_OBJECT FileObject)
VOID NTAPI CcInitView(VOID)
LIST_ENTRY DirtyVacbListHead
VOID CcRosDereferenceCache(PFILE_OBJECT FileObject)
LIST_ENTRY CcPostTickWorkQueue
FORCEINLINE BOOLEAN DoRangesIntersect(_In_ LONGLONG Offset1, _In_ LONGLONG Length1, _In_ LONGLONG Offset2, _In_ LONGLONG Length2)
LIST_ENTRY CcIdleWorkerThreadList
struct _PF_TRACE_HEADER * PPF_TRACE_HEADER
NTSTATUS CcRosGetVacb(PROS_SHARED_CACHE_MAP SharedCacheMap, LONGLONG FileOffset, PROS_VACB *Vacb)
VOID NTAPI CcScanDpc(PKDPC Dpc, PVOID DeferredContext, PVOID SystemArgument1, PVOID SystemArgument2)
struct _PFSN_LOG_ENTRIES PFSN_LOG_ENTRIES
BOOLEAN CcRosFreeOneUnusedVacb(VOID)
ULONG CcNumberWorkerThreads
VOID CcRosReferenceCache(PFILE_OBJECT FileObject)
struct _ROS_SHARED_CACHE_MAP * PROS_SHARED_CACHE_MAP
ULONG CcPinMappedDataCount
struct _PF_SCENARIO_ID * PPF_SCENARIO_ID
ULONG CcDirtyPageThreshold
struct _INTERNAL_BCB INTERNAL_BCB
struct _PFSN_TRACE_HEADER * PPFSN_TRACE_HEADER
struct _PFSN_PREFETCHER_GLOBALS * PPFSN_PREFETCHER_GLOBALS
struct _ROS_VACB * PROS_VACB
FORCEINLINE ULONG CcRosVacbDecRefCount(PROS_VACB vacb)
VOID CcRosUnmarkDirtyVacb(PROS_VACB Vacb, BOOLEAN LockViews)
struct _PFSN_LOG_ENTRIES * PPFSN_LOG_ENTRIES
NTSTATUS CcRosFlushDirtyPages(ULONG Target, PULONG Count, BOOLEAN Wait, BOOLEAN CalledFromLazy)
struct _PFSN_TRACE_DUMP PFSN_TRACE_DUMP
VOID NTAPI CcPfInitializePrefetcher(VOID)
struct _WORK_QUEUE_ENTRY WORK_QUEUE_ENTRY
struct _WORK_QUEUE_ENTRY * PWORK_QUEUE_ENTRY
PF_LOG_ENTRY Entries[ANYSIZE_ARRAY]
LIST_ENTRY TraceBuffersLink
PPFSN_TRACE_HEADER SystemWideTrace
PKEVENT CompletedTracesEvent
LIST_ENTRY CompletedTraces
FAST_MUTEX CompletedTracesLock
KSPIN_LOCK ActiveTracesLock
LIST_ENTRY CompletedTracesLink
LIST_ENTRY CacheMapVacbListHead
PRIVATE_CACHE_MAP PrivateCacheMap
LARGE_INTEGER ValidDataLength
PCACHE_MANAGER_CALLBACKS Callbacks
LIST_ENTRY SharedCacheMapLinks
LARGE_INTEGER SectionSize
KGUARDED_MUTEX FlushCacheLock
LIST_ENTRY CacheMapVacbListEntry
PROS_SHARED_CACHE_MAP SharedCacheMap
volatile ULONG ReferenceCount
LIST_ENTRY DirtyVacbListEntry
LIST_ENTRY VacbLruListEntry
struct _WORK_QUEUE_ENTRY::@1745::@1747 Write
union _WORK_QUEUE_ENTRY::@1745 Parameters
struct _WORK_QUEUE_ENTRY::@1745::@1746 Read
struct _WORK_QUEUE_ENTRY::@1745::@1749 Notification
LIST_ENTRY WorkQueueLinks
SHARED_CACHE_MAP * SharedCacheMap
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
_Must_inspect_result_ _In_ PWDF_DPC_CONFIG _In_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFDPC * Dpc
_In_ WDFDPC _In_ BOOLEAN Wait
_Must_inspect_result_ _In_ PWDF_WORKITEM_CONFIG _In_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWORKITEM * WorkItem
_Reserved_ PVOID Reserved
struct LOOKASIDE_ALIGN _NPAGED_LOOKASIDE_LIST NPAGED_LOOKASIDE_LIST
_In_opt_ PVOID _In_opt_ PVOID SystemArgument1
_In_opt_ PVOID DeferredContext
_In_opt_ PVOID _In_opt_ PVOID _In_opt_ PVOID SystemArgument2
_Inout_ PMDL MemoryDescriptorList
_Inout_opt_ PVOID Parameter