49 for (NextEntry = SharedCacheMap->BcbList.
Flink;
50 NextEntry != &SharedCacheMap->BcbList;
51 NextEntry = NextEntry->
Flink)
55 if (
Bcb->PFCB.MappedFileOffset.QuadPart <=
FileOffset->QuadPart &&
56 (
Bcb->PFCB.MappedFileOffset.QuadPart +
Bcb->PFCB.MappedLength) >=
59 if ((Pinned &&
Bcb->PinCount > 0) || (!Pinned &&
Bcb->PinCount == 0))
80 RefCount = --
Bcb->RefCount;
128 iBcb->
PFCB.NodeTypeCode = 0x2FD;
129 iBcb->
PFCB.NodeByteSize = 0;
341 CCTRACE(
CC_API_DEBUG,
"CcMapData(FileObject 0x%p, FileOffset 0x%I64x, Length %lu, Flags 0x%lx,"
349 SharedCacheMap =
FileObject->SectionObjectPointer->SharedCacheMap;
425 CCTRACE(
CC_API_DEBUG,
"FileObject=%p FileOffset=%p Length=%lu Flags=0x%lx -> TRUE Bcb=%p, Buffer %p\n",
454 SharedCacheMap =
FileObject->SectionObjectPointer->SharedCacheMap;
458 DPRINT1(
"FIXME: Pinning a file with no pin access!\n");
497 SharedCacheMap =
FileObject->SectionObjectPointer->SharedCacheMap;
501 DPRINT1(
"FIXME: Pinning a file with no pin access!\n");
560 iBcb->
PFCB.MappedLength);
640 &iBcb->
PFCB.MappedFileOffset,
641 iBcb->
PFCB.MappedLength,
VOID NTAPI CcFlushCache(IN PSECTION_OBJECT_POINTERS SectionObjectPointer, IN OPTIONAL PLARGE_INTEGER FileOffset, IN ULONG Length, OUT OPTIONAL PIO_STATUS_BLOCK IoStatus)
_In_ PFCB _In_ LONGLONG FileOffset
#define NT_SUCCESS(StatCode)
#define RemoveEntryList(Entry)
#define InsertTailList(ListHead, Entry)
#define ExReleaseResourceForThreadLite(res, thrdID)
#define PsGetCurrentThread()
NTSTATUS ExInitializeResourceLite(PULONG res)
#define KeReleaseSpinLock(sl, irql)
#define KeAcquireSpinLock(sl, irql)
#define ExAcquireResourceExclusiveLite(res, wait)
#define ExDeleteResourceLite(res)
#define ROUND_DOWN(n, align)
#define BooleanFlagOn(F, SF)
IN PVCB IN VBO IN ULONG OUT PBCB * Bcb
IN PVCB IN VBO IN ULONG OUT PBCB OUT PVOID IN BOOLEAN IN BOOLEAN Zero
#define Add2Ptr(PTR, INC)
__in UCHAR __in POWER_STATE __in_opt PVOID __in PIO_STATUS_BLOCK IoStatus
_In_ ULONG _In_ ULONG _In_ ULONG Length
VOID NTAPI CcUnpinData(IN PVOID Bcb)
static BOOLEAN CcpPinData(IN PROS_SHARED_CACHE_MAP SharedCacheMap, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN ULONG Flags, OUT PVOID *Bcb, OUT PVOID *Buffer)
VOID NTAPI CcUnpinRepinnedBcb(IN PVOID Bcb, IN BOOLEAN WriteThrough, IN PIO_STATUS_BLOCK IoStatus)
BOOLEAN NTAPI CcMapData(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN ULONG Flags, OUT PVOID *pBcb, OUT PVOID *pBuffer)
static PVOID CcpGetAppropriateBcb(IN PROS_SHARED_CACHE_MAP SharedCacheMap, IN PROS_VACB Vacb, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN ULONG PinFlags, IN BOOLEAN ToPin)
NPAGED_LOOKASIDE_LIST iBcbLookasideList
VOID NTAPI CcSetDirtyPinnedData(IN PVOID Bcb, IN PLARGE_INTEGER Lsn)
BOOLEAN NTAPI CcPinMappedData(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN ULONG Flags, OUT PVOID *Bcb)
static VOID CcpDereferenceBcb(IN PROS_SHARED_CACHE_MAP SharedCacheMap, IN PINTERNAL_BCB Bcb)
static PINTERNAL_BCB NTAPI CcpFindBcb(IN PROS_SHARED_CACHE_MAP SharedCacheMap, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN BOOLEAN Pinned)
VOID NTAPI CcUnpinDataForThread(IN PVOID Bcb, IN ERESOURCE_THREAD ResourceThreadId)
BOOLEAN NTAPI CcPreparePinWrite(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN BOOLEAN Zero, IN ULONG Flags, OUT PVOID *Bcb, OUT PVOID *Buffer)
ULONG CcPinMappedDataCount
BOOLEAN NTAPI CcPinRead(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN ULONG Flags, OUT PVOID *Bcb, OUT PVOID *Buffer)
VOID NTAPI CcRepinBcb(IN PVOID Bcb)
VOID CcRosMarkDirtyVacb(PROS_VACB Vacb)
NTSTATUS CcRosReleaseVacb(PROS_SHARED_CACHE_MAP SharedCacheMap, PROS_VACB Vacb, BOOLEAN Dirty, BOOLEAN Mapped)
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)
BOOLEAN NTAPI ExAcquireSharedStarveExclusive(IN PERESOURCE Resource, IN BOOLEAN Wait)
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
#define CCTRACE(x, fmt,...)
NTSTATUS NTAPI MmMakePagesDirty(_In_ PEPROCESS Process, _In_ PVOID Address, _In_ ULONG Length)
struct _LIST_ENTRY * Flink
PROS_SHARED_CACHE_MAP SharedCacheMap
#define RtlZeroMemory(Destination, Length)
#define CONTAINING_RECORD(address, type, field)
#define STATUS_INSUFFICIENT_RESOURCES
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
_Must_inspect_result_ _In_ ULONG Flags
#define VACB_MAPPING_GRANULARITY
_In_ ERESOURCE_THREAD ResourceThreadId
ULONG_PTR ERESOURCE_THREAD
struct LOOKASIDE_ALIGN _NPAGED_LOOKASIDE_LIST NPAGED_LOOKASIDE_LIST
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql