ReactOS 0.4.16-dev-303-g11d5cb8
ccfuncs.h
Go to the documentation of this file.
2/* Common Cache Functions */
3
4#define CcIsFileCached(FO) ( \
5 ((FO)->SectionObjectPointer != NULL) && \
6 (((PSECTION_OBJECT_POINTERS)(FO)->SectionObjectPointer)->SharedCacheMap != NULL) \
7)
8
10
11#if (NTDDI_VERSION >= NTDDI_WIN2K)
12
14VOID
19 _In_ BOOLEAN PinAccess,
21 _In_ PVOID LazyWriteContext);
22
28 _In_opt_ PLARGE_INTEGER TruncateSize,
29 _In_opt_ PCACHE_UNINITIALIZE_EVENT UninitializeCompleteEvent);
30
32VOID
37
39VOID
43 _In_ ULONG DirtyPageThreshold);
44
46VOID
53
59 _In_ BOOLEAN BcbListHeld);
60
66 _In_ PLARGE_INTEGER StartOffset,
67 _In_ PLARGE_INTEGER EndOffset,
69
74 _In_ PVOID Bcb);
75
77VOID
80 _In_ PVOID Bcb);
81
83VOID
87 _In_ BOOLEAN WriteThrough,
89
95
100 _In_ PVOID Bcb);
101
104NTAPI
107 _In_ ULONG BytesToWrite,
109 _In_ BOOLEAN Retrying);
110
112VOID
113NTAPI
116 _In_ PCC_POST_DEFERRED_WRITE PostRoutine,
119 _In_ ULONG BytesToWrite,
120 _In_ BOOLEAN Retrying);
121
124NTAPI
132
134VOID
135NTAPI
140 _In_ ULONG PageCount,
143
146NTAPI
153
155VOID
156NTAPI
162
164VOID
165NTAPI
172
174VOID
175NTAPI
179
181VOID
182NTAPI
189
191VOID
192NTAPI
197
199VOID
200NTAPI
205
208NTAPI
210
212VOID
213NTAPI
216 _In_ ULONG Granularity);
217
220NTAPI
228
231NTAPI
237 _Inout_ PVOID *Bcb);
238
241NTAPI
250
252VOID
253NTAPI
255 _In_ PVOID BcbVoid,
257
259VOID
260NTAPI
262 _In_ PVOID Bcb);
263
265VOID
266NTAPI
268 _In_ PVOID Bcb,
270
272VOID
273NTAPI
275 _In_ PVOID Bcb,
277
279VOID
280NTAPI
283 _In_ BOOLEAN DisableReadAhead,
284 _In_ BOOLEAN DisableWriteBehind);
285
288NTAPI
290 _In_ PVPB Vpb);
291
292#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
293
294#if (NTDDI_VERSION >= NTDDI_WINXP)
295
297VOID
298NTAPI
302
304VOID
305NTAPI
309 _In_ PFLUSH_TO_LSN FlushToLsnRoutine);
310
313NTAPI
316 _In_ PDIRTY_PAGE_ROUTINE DirtyPageRoutine,
319
320#endif
321
322#if (NTDDI_VERSION >= NTDDI_WINXP)
326NTAPI
334#elif (NTDDI_VERSION >= NTDDI_WIN2K)
337NTAPI
345#endif
346
347#if (NTDDI_VERSION >= NTDDI_VISTA)
348
351NTAPI
355
358NTAPI
361
363VOID
364NTAPI
367 _In_ BOOLEAN EnableParallelFlush);
368
372 _In_ PVPB Vpb,
373 _In_opt_ PULONG NumberOfDirtyPages);
374
375#endif
376
377#if (NTDDI_VERSION >= NTDDI_WIN7)
379VOID
380NTAPI
387#endif
388
389#define CcGetFileSizePointer(FO) ( \
390 ((PLARGE_INTEGER)((FO)->SectionObjectPointer->SharedCacheMap) + 1) \
391)
392
393#if (NTDDI_VERSION >= NTDDI_VISTA)
396NTAPI
402#elif (NTDDI_VERSION >= NTDDI_WIN2K)
405NTAPI
410 _In_ BOOLEAN UninitializeCacheMaps);
411#endif
412
413#if (NTDDI_VERSION >= NTDDI_WIN7)
416NTAPI
421#else
422#define CcCopyWriteWontFlush(FO, FOFF, LEN) ((LEN) <= 0x10000)
423#endif
424
425#define CcReadAhead(FO, FOFF, LEN) ( \
426 if ((LEN) >= 256) { \
427 CcScheduleReadAhead((FO), (FOFF), (LEN)); \
428 } \
429)
static CC_FILE_SIZES FileSizes
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
const struct winhelp_callbacks Callbacks
Definition: callback.c:161
NTKERNELAPI BOOLEAN NTAPI CcCopyWriteWontFlush(_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ ULONG Length)
_In_ PLARGE_INTEGER FileOffset
Definition: ccfuncs.h:329
NTKERNELAPI BOOLEAN NTAPI CcPurgeCacheSection(_In_ PSECTION_OBJECT_POINTERS SectionObjectPointer, _In_opt_ PLARGE_INTEGER FileOffset, _In_ ULONG Length, _In_ ULONG Flags)
NTKERNELAPI PFILE_OBJECT NTAPI CcGetFileObjectFromBcb(_In_ PVOID Bcb)
NTKERNELAPI VOID NTAPI CcSetFileSizes(IN PFILE_OBJECT FileObject, IN PCC_FILE_SIZES FileSizes)
Definition: fssup.c:356
NTKERNELAPI VOID NTAPI CcUnpinData(_In_ PVOID Bcb)
NTKERNELAPI VOID NTAPI CcSetDirtyPinnedData(_In_ PVOID BcbVoid, _In_opt_ PLARGE_INTEGER Lsn)
NTKERNELAPI BOOLEAN NTAPI CcZeroData(_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER StartOffset, _In_ PLARGE_INTEGER EndOffset, _In_ BOOLEAN Wait)
NTKERNELAPI VOID NTAPI CcSetLogHandleForFile(_In_ PFILE_OBJECT FileObject, _In_ PVOID LogHandle, _In_ PFLUSH_TO_LSN FlushToLsnRoutine)
NTKERNELAPI VOID NTAPI CcMdlWriteComplete(_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ PMDL MdlChain)
NTKERNELAPI VOID NTAPI CcMdlReadComplete(_In_ PFILE_OBJECT FileObject, _In_ PMDL MdlChain)
NTKERNELAPI PFILE_OBJECT NTAPI CcGetFileObjectFromSectionPtrs(_In_ PSECTION_OBJECT_POINTERS SectionObjectPointer)
NTKERNELAPI NTSTATUS NTAPI CcSetFileSizesEx(_In_ PFILE_OBJECT FileObject, _In_ PCC_FILE_SIZES FileSizes)
NTKERNELAPI BOOLEAN NTAPI CcPreparePinWrite(_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ ULONG Length, _In_ BOOLEAN Zero, _In_ ULONG Flags, _Outptr_ PVOID *Bcb, _Outptr_result_bytebuffer_(Length) PVOID *Buffer)
NTKERNELAPI PFILE_OBJECT NTAPI CcGetFileObjectFromSectionPtrsRef(_In_ PSECTION_OBJECT_POINTERS SectionObjectPointer)
NTKERNELAPI VOID NTAPI CcFastCopyRead(_In_ PFILE_OBJECT FileObject, _In_ ULONG FileOffset, _In_ ULONG Length, _In_ ULONG PageCount, _Out_writes_bytes_(Length) PVOID Buffer, _Out_ PIO_STATUS_BLOCK IoStatus)
NTKERNELAPI VOID NTAPI CcMdlWriteAbort(_In_ PFILE_OBJECT FileObject, _In_ PMDL MdlChain)
NTKERNELAPI BOOLEAN CcIsThereDirtyDataEx(_In_ PVPB Vpb, _In_opt_ PULONG NumberOfDirtyPages)
NTKERNELAPI VOID NTAPI CcFastCopyWrite(_In_ PFILE_OBJECT FileObject, _In_ ULONG FileOffset, _In_ ULONG Length, _In_reads_bytes_(Length) PVOID Buffer)
NTKERNELAPI BOOLEAN NTAPI CcCanIWrite(_In_opt_ PFILE_OBJECT FileObject, _In_ ULONG BytesToWrite, _In_ BOOLEAN Wait, _In_ BOOLEAN Retrying)
NTKERNELAPI VOID NTAPI CcCoherencyFlushAndPurgeCache(_In_ PSECTION_OBJECT_POINTERS SectionObjectPointer, _In_opt_ PLARGE_INTEGER FileOffset, _In_ ULONG Length, _Out_ PIO_STATUS_BLOCK IoStatus, _In_opt_ ULONG Flags)
NTKERNELAPI BOOLEAN NTAPI CcUninitializeCacheMap(_In_ PFILE_OBJECT FileObject, _In_opt_ PLARGE_INTEGER TruncateSize, _In_opt_ PCACHE_UNINITIALIZE_EVENT UninitializeCompleteEvent)
NTKERNELAPI BOOLEAN NTAPI CcPinRead(_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ ULONG Length, _In_ ULONG Flags, _Outptr_ PVOID *Bcb, _Outptr_result_bytebuffer_(Length) PVOID *Buffer)
NTKERNELAPI LARGE_INTEGER NTAPI CcGetDirtyPages(_In_ PVOID LogHandle, _In_ PDIRTY_PAGE_ROUTINE DirtyPageRoutine, _In_ PVOID Context1, _In_ PVOID Context2)
NTKERNELAPI VOID NTAPI CcSetParallelFlushFile(_In_ PFILE_OBJECT FileObject, _In_ BOOLEAN EnableParallelFlush)
NTKERNELAPI VOID NTAPI CcMdlRead(_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ ULONG Length, _Out_ PMDL *MdlChain, _Out_ PIO_STATUS_BLOCK IoStatus)
NTKERNELAPI VOID NTAPI CcInitializeCacheMap(_In_ PFILE_OBJECT FileObject, _In_ PCC_FILE_SIZES FileSizes, _In_ BOOLEAN PinAccess, _In_ PCACHE_MANAGER_CALLBACKS Callbacks, _In_ PVOID LazyWriteContext)
NTKERNELAPI VOID NTAPI CcUnpinDataForThread(_In_ PVOID Bcb, _In_ ERESOURCE_THREAD ResourceThreadId)
NTKERNELAPI 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)
NTKERNELAPI BOOLEAN NTAPI CcCopyRead(_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ ULONG Length, _In_ BOOLEAN Wait, _Out_writes_bytes_(Length) PVOID Buffer, _Out_ PIO_STATUS_BLOCK IoStatus)
NTKERNELAPI VOID NTAPI CcSetReadAheadGranularity(_In_ PFILE_OBJECT FileObject, _In_ ULONG Granularity)
NTKERNELAPI VOID NTAPI CcPrepareMdlWrite(_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ ULONG Length, _Out_ PMDL *MdlChain, _Out_ PIO_STATUS_BLOCK IoStatus)
NTKERNELAPI VOID NTAPI CcRepinBcb(_In_ PVOID Bcb)
_In_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _Outptr_ PVOID * Bcb
Definition: ccfuncs.h:332
NTKERNELAPI VOID NTAPI CcFlushCache(_In_ PSECTION_OBJECT_POINTERS SectionObjectPointer, _In_opt_ PLARGE_INTEGER FileOffset, _In_ ULONG Length, _Out_opt_ PIO_STATUS_BLOCK IoStatus)
NTKERNELAPI VOID NTAPI CcUnpinRepinnedBcb(_In_ PVOID Bcb, _In_ BOOLEAN WriteThrough, _Out_ PIO_STATUS_BLOCK IoStatus)
NTKERNELAPI BOOLEAN NTAPI CcIsThereDirtyData(_In_ PVPB Vpb)
NTKERNELAPI BOOLEAN NTAPI CcPinMappedData(_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ ULONG Length, _In_ ULONG Flags, _Inout_ PVOID *Bcb)
NTKERNELAPI NTSTATUS NTAPI CcWaitForCurrentLazyWriterActivity(VOID)
Definition: lazyrite.c:30
NTKERNELAPI VOID NTAPI CcSetDirtyPageThreshold(_In_ PFILE_OBJECT FileObject, _In_ ULONG DirtyPageThreshold)
NTKERNELAPI PVOID NTAPI CcRemapBcb(_In_ PVOID Bcb)
NTKERNELAPI VOID NTAPI CcSetAdditionalCacheAttributes(_In_ PFILE_OBJECT FileObject, _In_ BOOLEAN DisableReadAhead, _In_ BOOLEAN DisableWriteBehind)
NTKERNELAPI VOID NTAPI CcSetBcbOwnerPointer(_In_ PVOID Bcb, _In_ PVOID OwnerPointer)
NTKERNELAPI BOOLEAN NTAPI CcCopyWrite(_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ ULONG Length, _In_ BOOLEAN Wait, _In_reads_bytes_(Length) PVOID Buffer)
$if(_NTIFS_) extern NTKERNELAPI ULONG CcFastMdlReadWait
Definition: cctypes.h:1
NTKERNELAPI LARGE_INTEGER NTAPI CcGetFlushedValidData(_In_ PSECTION_OBJECT_POINTERS SectionObjectPointer, _In_ BOOLEAN BcbListHeld)
NTKERNELAPI VOID NTAPI CcScheduleReadAhead(_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ ULONG Length)
Definition: bufpool.h:45
#define FALSE
Definition: types.h:117
IN OUT PVCB IN PDEVICE_OBJECT IN PVPB Vpb
Definition: fatprocs.h:1676
IN PVCB IN VBO IN ULONG OUT PBCB OUT PVOID IN BOOLEAN IN BOOLEAN Zero
Definition: fatprocs.h:419
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _Outptr_ PMDL * MdlChain
Definition: fsrtlfuncs.h:49
_Must_inspect_result_ _In_ PDEVICE_OBJECT _In_ PSECTION_OBJECT_POINTERS SectionObjectPointer
Definition: fsrtlfuncs.h:1369
#define _NTIFS_
Definition: ifssupp.h:20
__in UCHAR __in POWER_STATE __in_opt PVOID __in PIO_STATUS_BLOCK IoStatus
Definition: mxum.h:159
_In_ UINT _Out_ PNDIS_HANDLE LogHandle
Definition: ndis.h:5382
#define _In_reads_bytes_(s)
Definition: no_sal2.h:170
#define _Outptr_result_bytebuffer_(s)
Definition: no_sal2.h:288
#define _Out_opt_
Definition: no_sal2.h:214
#define _Inout_
Definition: no_sal2.h:162
#define _Success_(c)
Definition: no_sal2.h:84
#define _Outptr_
Definition: no_sal2.h:262
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
#define _Out_writes_bytes_(s)
Definition: no_sal2.h:178
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
ULONG CcFastMdlReadWait
Definition: copysup.c:19
BOOLEAN NTAPI CcMapData(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN ULONG Flags, OUT PVOID *BcbResult, OUT PVOID *Buffer)
Definition: pinsup.c:694
$endif(_WDMDDK_) $if(_NTDDK_) typedef struct _NEON128
Definition: ke.h:202
Definition: iotypes.h:189
_In_ PNET_PNP_EVENT _In_ PTDI_PNP_CONTEXT Context1
Definition: tdikrnl.h:1095
_In_ PNET_PNP_EVENT _In_ PTDI_PNP_CONTEXT _In_ PTDI_PNP_CONTEXT Context2
Definition: tdikrnl.h:1096
uint32_t * PULONG
Definition: typedefs.h:59
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:550
_In_ WDFDPC _In_ BOOLEAN Wait
Definition: wdfdpc.h:170
#define NTKERNELAPI
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
VOID(NTAPI * PCC_POST_DEFERRED_WRITE)(_In_ PVOID Context1, _In_ PVOID Context2)
Definition: cctypes.h:66
VOID(NTAPI * PDIRTY_PAGE_ROUTINE)(_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ ULONG Length, _In_ PLARGE_INTEGER OldestLsn, _In_ PLARGE_INTEGER NewestLsn, _In_ PVOID Context1, _In_ PVOID Context2)
Definition: cctypes.h:51
VOID(NTAPI * PFLUSH_TO_LSN)(_In_ PVOID LogHandle, _In_ LARGE_INTEGER Lsn)
Definition: cctypes.h:61
_In_ ERESOURCE_THREAD ResourceThreadId
Definition: exfuncs.h:1052
_In_ PVOID OwnerPointer
Definition: exfuncs.h:1070
ULONG_PTR ERESOURCE_THREAD
Definition: extypes.h:208
* PFILE_OBJECT
Definition: iotypes.h:1998