ReactOS  0.4.14-dev-323-g6fe6a88
ccfuncs.h
Go to the documentation of this file.
1 $if (_NTIFS_)
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 
14 VOID
15 NTAPI
19  _In_ BOOLEAN PinAccess,
21  _In_ PVOID LazyWriteContext);
22 
24 BOOLEAN
25 NTAPI
28  _In_opt_ PLARGE_INTEGER TruncateSize,
29  _In_opt_ PCACHE_UNINITIALIZE_EVENT UninitializeCompleteEvent);
30 
32 VOID
33 NTAPI
37 
39 VOID
40 NTAPI
43  _In_ ULONG DirtyPageThreshold);
44 
46 VOID
47 NTAPI
53 
56 NTAPI
59  _In_ BOOLEAN BcbListHeld);
60 
62 BOOLEAN
63 NTAPI
66  _In_ PLARGE_INTEGER StartOffset,
67  _In_ PLARGE_INTEGER EndOffset,
68  _In_ BOOLEAN Wait);
69 
71 PVOID
72 NTAPI
74  _In_ PVOID Bcb);
75 
77 VOID
78 NTAPI
80  _In_ PVOID Bcb);
81 
83 VOID
84 NTAPI
86  _In_ PVOID Bcb,
87  _In_ BOOLEAN WriteThrough,
89 
92 NTAPI
95 
98 NTAPI
100  _In_ PVOID Bcb);
101 
103 BOOLEAN
104 NTAPI
107  _In_ ULONG BytesToWrite,
108  _In_ BOOLEAN Wait,
109  _In_ BOOLEAN Retrying);
110 
112 VOID
113 NTAPI
116  _In_ PCC_POST_DEFERRED_WRITE PostRoutine,
119  _In_ ULONG BytesToWrite,
120  _In_ BOOLEAN Retrying);
121 
123 BOOLEAN
124 NTAPI
125 CcCopyRead(
128  _In_ ULONG Length,
129  _In_ BOOLEAN Wait,
132 
134 VOID
135 NTAPI
139  _In_ ULONG Length,
140  _In_ ULONG PageCount,
143 
145 BOOLEAN
146 NTAPI
150  _In_ ULONG Length,
151  _In_ BOOLEAN Wait,
153 
155 VOID
156 NTAPI
160  _In_ ULONG Length,
162 
164 VOID
165 NTAPI
166 CcMdlRead(
169  _In_ ULONG Length,
172 
174 VOID
175 NTAPI
178  _In_ PMDL MdlChain);
179 
181 VOID
182 NTAPI
186  _In_ ULONG Length,
189 
191 VOID
192 NTAPI
196  _In_ PMDL MdlChain);
197 
199 VOID
200 NTAPI
204  _In_ ULONG Length);
205 
207 NTSTATUS
208 NTAPI
210 
212 VOID
213 NTAPI
216  _In_ ULONG Granularity);
217 
219 BOOLEAN
220 NTAPI
221 CcPinRead(
224  _In_ ULONG Length,
225  _In_ ULONG Flags,
226  _Outptr_ PVOID *Bcb,
228 
230 BOOLEAN
231 NTAPI
235  _In_ ULONG Length,
236  _In_ ULONG Flags,
237  _Inout_ PVOID *Bcb);
238 
240 BOOLEAN
241 NTAPI
245  _In_ ULONG Length,
246  _In_ BOOLEAN Zero,
247  _In_ ULONG Flags,
248  _Outptr_ PVOID *Bcb,
250 
252 VOID
253 NTAPI
255  _In_ PVOID BcbVoid,
257 
259 VOID
260 NTAPI
262  _In_ PVOID Bcb);
263 
265 VOID
266 NTAPI
268  _In_ PVOID Bcb,
270 
272 VOID
273 NTAPI
275  _In_ PVOID Bcb,
277 
279 VOID
280 NTAPI
283  _In_ BOOLEAN DisableReadAhead,
284  _In_ BOOLEAN DisableWriteBehind);
285 
287 BOOLEAN
288 NTAPI
290  _In_ PVPB Vpb);
291 
292 #endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
293 
294 #if (NTDDI_VERSION >= NTDDI_WINXP)
295 
297 VOID
298 NTAPI
301  _In_ PMDL MdlChain);
302 
304 VOID
305 NTAPI
309  _In_ PFLUSH_TO_LSN FlushToLsnRoutine);
310 
313 NTAPI
316  _In_ PDIRTY_PAGE_ROUTINE DirtyPageRoutine,
319 
320 #endif
321 
322 #if (NTDDI_VERSION >= NTDDI_WINXP)
323 _Success_(return!=FALSE)
325 BOOLEAN
326 NTAPI
327 CcMapData(
330  _In_ ULONG Length,
331  _In_ ULONG Flags,
332  _Outptr_ PVOID *Bcb,
334 #elif (NTDDI_VERSION >= NTDDI_WIN2K)
336 BOOLEAN
337 NTAPI
338 CcMapData(
341  _In_ ULONG Length,
342  _In_ BOOLEAN Wait,
343  _Outptr_ PVOID *Bcb,
345 #endif
346 
347 #if (NTDDI_VERSION >= NTDDI_VISTA)
348 
350 NTSTATUS
351 NTAPI
355 
358 NTAPI
361 
363 VOID
364 NTAPI
367  _In_ BOOLEAN EnableParallelFlush);
368 
370 BOOLEAN
372  _In_ PVPB Vpb,
373  _In_opt_ PULONG NumberOfDirtyPages);
374 
375 #endif
376 
377 #if (NTDDI_VERSION >= NTDDI_WIN7)
379 VOID
380 NTAPI
384  _In_ ULONG Length,
387 #endif
388 
389 #define CcGetFileSizePointer(FO) ( \
390  ((PLARGE_INTEGER)((FO)->SectionObjectPointer->SharedCacheMap) + 1) \
391 )
392 
393 #if (NTDDI_VERSION >= NTDDI_VISTA)
395 BOOLEAN
396 NTAPI
400  _In_ ULONG Length,
401  _In_ ULONG Flags);
402 #elif (NTDDI_VERSION >= NTDDI_WIN2K)
404 BOOLEAN
405 NTAPI
409  _In_ ULONG Length,
410  _In_ BOOLEAN UninitializeCacheMaps);
411 #endif
412 
413 #if (NTDDI_VERSION >= NTDDI_WIN7)
415 BOOLEAN
416 NTAPI
420  _In_ ULONG Length);
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 )
430 $endif (_NTIFS_)
VOID(NTAPI * PFLUSH_TO_LSN)(_In_ PVOID LogHandle, _In_ LARGE_INTEGER Lsn)
Definition: cctypes.h:61
ULONG_PTR ERESOURCE_THREAD
Definition: extypes.h:208
#define IN
Definition: typedefs.h:38
NTKERNELAPI BOOLEAN NTAPI CcCanIWrite(_In_opt_ PFILE_OBJECT FileObject, _In_ ULONG BytesToWrite, _In_ BOOLEAN Wait, _In_ BOOLEAN Retrying)
NTKERNELAPI VOID NTAPI CcSetBcbOwnerPointer(_In_ PVOID Bcb, _In_ PVOID OwnerPointer)
ULONG CcFastMdlReadWait
Definition: copysup.c:19
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 BOOLEAN NTAPI CcIsThereDirtyData(_In_ PVPB Vpb)
$if(_NTIFS_) extern NTKERNELAPI ULONG CcFastMdlReadWait
Definition: cctypes.h:1
NTKERNELAPI VOID NTAPI CcRepinBcb(_In_ PVOID Bcb)
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG IN BOOLEAN OUT PIO_STATUS_BLOCK IoStatus
Definition: fatprocs.h:2650
NTKERNELAPI PFILE_OBJECT NTAPI CcGetFileObjectFromSectionPtrsRef(_In_ PSECTION_OBJECT_POINTERS SectionObjectPointer)
_In_ PVOID OwnerPointer
Definition: exfuncs.h:862
_In_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _Outptr_ PVOID _Outptr_result_bytebuffer_(Length) PVOID *Buffer)
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)
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _Outptr_ PMDL * MdlChain
Definition: fsrtlfuncs.h:46
NTKERNELAPI VOID NTAPI CcMdlWriteAbort(_In_ PFILE_OBJECT FileObject, _In_ PMDL MdlChain)
LONG NTSTATUS
Definition: precomp.h:26
#define _NTIFS_
Definition: ifssupp.h:20
#define _Outptr_
Definition: no_sal2.h:396
NTKERNELAPI BOOLEAN NTAPI CcZeroData(_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER StartOffset, _In_ PLARGE_INTEGER EndOffset, _In_ BOOLEAN Wait)
NTKERNELAPI VOID NTAPI CcSetDirtyPageThreshold(_In_ PFILE_OBJECT FileObject, _In_ ULONG DirtyPageThreshold)
_Success_(return!=FALSE) NTKERNELAPI BOOLEAN NTAPI CcMapData(_In_ PFILE_OBJECT FileObject
static CC_FILE_SIZES FileSizes
NTKERNELAPI VOID NTAPI CcFastCopyWrite(_In_ PFILE_OBJECT FileObject, _In_ ULONG FileOffset, _In_ ULONG Length, _In_reads_bytes_(Length) PVOID Buffer)
#define _In_opt_
Definition: no_sal2.h:213
_Must_inspect_result_ _In_ PDEVICE_OBJECT _In_ PSECTION_OBJECT_POINTERS SectionObjectPointer
Definition: fsrtlfuncs.h:1368
NTKERNELAPI VOID NTAPI CcScheduleReadAhead(_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ ULONG Length)
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
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
VOID(NTAPI * PCC_POST_DEFERRED_WRITE)(_In_ PVOID Context1, _In_ PVOID Context2)
Definition: cctypes.h:66
NTKERNELAPI VOID NTAPI CcUnpinData(_In_ PVOID Bcb)
NTKERNELAPI PVOID NTAPI CcRemapBcb(_In_ PVOID Bcb)
unsigned char BOOLEAN
#define _Out_writes_bytes_(size)
Definition: no_sal2.h:370
#define _Out_
Definition: no_sal2.h:323
#define NTKERNELAPI
$endif(_WDMDDK_) $if(_NTDDK_) typedef struct _NEON128
Definition: ke.h:202
Definition: bufpool.h:45
NTKERNELAPI VOID NTAPI CcSetLogHandleForFile(_In_ PFILE_OBJECT FileObject, _In_ PVOID LogHandle, _In_ PFLUSH_TO_LSN FlushToLsnRoutine)
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:593
NTKERNELAPI LARGE_INTEGER NTAPI CcGetDirtyPages(_In_ PVOID LogHandle, _In_ PDIRTY_PAGE_ROUTINE DirtyPageRoutine, _In_ PVOID Context1, _In_ PVOID Context2)
NTKERNELAPI BOOLEAN NTAPI CcPinMappedData(_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ ULONG Length, _In_ ULONG Flags, _Inout_ PVOID *Bcb)
#define _Out_opt_
Definition: no_sal2.h:339
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
NTKERNELAPI PFILE_OBJECT NTAPI CcGetFileObjectFromBcb(_In_ PVOID Bcb)
const struct winhelp_callbacks Callbacks
Definition: callback.c:161
_In_ PLARGE_INTEGER FileOffset
Definition: ccfuncs.h:329
NTKERNELAPI VOID NTAPI CcSetParallelFlushFile(_In_ PFILE_OBJECT FileObject, _In_ BOOLEAN EnableParallelFlush)
NTKERNELAPI VOID NTAPI CcSetFileSizes(IN PFILE_OBJECT FileObject, IN PCC_FILE_SIZES FileSizes)
Definition: fssup.c:354
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 CcCoherencyFlushAndPurgeCache(_In_ PSECTION_OBJECT_POINTERS SectionObjectPointer, _In_opt_ PLARGE_INTEGER FileOffset, _In_ ULONG Length, _Out_ PIO_STATUS_BLOCK IoStatus, _In_opt_ ULONG Flags)
#define _Inout_
Definition: no_sal2.h:244
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
* PFILE_OBJECT
Definition: iotypes.h:1955
_In_ ERESOURCE_THREAD ResourceThreadId
Definition: exfuncs.h:844
NTKERNELAPI BOOLEAN CcIsThereDirtyDataEx(_In_ PVPB Vpb, _In_opt_ PULONG NumberOfDirtyPages)
NTKERNELAPI PFILE_OBJECT NTAPI CcGetFileObjectFromSectionPtrs(_In_ PSECTION_OBJECT_POINTERS SectionObjectPointer)
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 CcMdlRead(_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ ULONG Length, _Out_ PMDL *MdlChain, _Out_ PIO_STATUS_BLOCK IoStatus)
NTKERNELAPI VOID NTAPI CcUnpinDataForThread(_In_ PVOID Bcb, _In_ ERESOURCE_THREAD ResourceThreadId)
NTKERNELAPI BOOLEAN NTAPI CcCopyWriteWontFlush(_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ ULONG Length)
NTKERNELAPI VOID NTAPI CcSetReadAheadGranularity(_In_ PFILE_OBJECT FileObject, _In_ ULONG Granularity)
#define _In_reads_bytes_(size)
Definition: no_sal2.h:229
NTKERNELAPI BOOLEAN NTAPI CcPurgeCacheSection(_In_ PSECTION_OBJECT_POINTERS SectionObjectPointer, _In_opt_ PLARGE_INTEGER FileOffset, _In_ ULONG Length, _In_ ULONG Flags)
_In_ PNET_PNP_EVENT _In_ PTDI_PNP_CONTEXT _In_ PTDI_PNP_CONTEXT Context2
Definition: tdikrnl.h:1094
NTKERNELAPI VOID NTAPI CcSetDirtyPinnedData(_In_ PVOID BcbVoid, _In_opt_ PLARGE_INTEGER Lsn)
NTKERNELAPI BOOLEAN NTAPI CcUninitializeCacheMap(_In_ PFILE_OBJECT FileObject, _In_opt_ PLARGE_INTEGER TruncateSize, _In_opt_ PCACHE_UNINITIALIZE_EVENT UninitializeCompleteEvent)
#define _In_
Definition: no_sal2.h:204
NTKERNELAPI VOID NTAPI CcMdlWriteComplete(_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ PMDL MdlChain)
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 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 CcInitializeCacheMap(_In_ PFILE_OBJECT FileObject, _In_ PCC_FILE_SIZES FileSizes, _In_ BOOLEAN PinAccess, _In_ PCACHE_MANAGER_CALLBACKS Callbacks, _In_ PVOID LazyWriteContext)
_In_ PNET_PNP_EVENT _In_ PTDI_PNP_CONTEXT Context1
Definition: tdikrnl.h:1094
unsigned int * PULONG
Definition: retypes.h:1
NTKERNELAPI VOID NTAPI CcUnpinRepinnedBcb(_In_ PVOID Bcb, _In_ BOOLEAN WriteThrough, _Out_ PIO_STATUS_BLOCK IoStatus)
NTKERNELAPI VOID NTAPI CcMdlReadComplete(_In_ PFILE_OBJECT FileObject, _In_ PMDL MdlChain)
IN PVCB IN VBO IN ULONG OUT PBCB OUT PVOID IN BOOLEAN IN BOOLEAN Zero
Definition: fatprocs.h:402
Definition: iotypes.h:166
unsigned int ULONG
Definition: retypes.h:1
NTKERNELAPI NTSTATUS NTAPI CcSetFileSizesEx(_In_ PFILE_OBJECT FileObject, _In_ PCC_FILE_SIZES FileSizes)
_In_ UINT _Out_ PNDIS_HANDLE LogHandle
Definition: ndis.h:5381
NTKERNELAPI BOOLEAN NTAPI CcCopyWrite(_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ ULONG Length, _In_ BOOLEAN Wait, _In_reads_bytes_(Length) PVOID Buffer)
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 VOID NTAPI CcSetAdditionalCacheAttributes(_In_ PFILE_OBJECT FileObject, _In_ BOOLEAN DisableReadAhead, _In_ BOOLEAN DisableWriteBehind)
IN OUT PVCB IN PDEVICE_OBJECT IN PVPB Vpb
Definition: fatprocs.h:1664
_In_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _Outptr_ PVOID * Bcb
Definition: ccfuncs.h:329
IN BOOLEAN Wait
Definition: fatprocs.h:1529
NTKERNELAPI LARGE_INTEGER NTAPI CcGetFlushedValidData(_In_ PSECTION_OBJECT_POINTERS SectionObjectPointer, _In_ BOOLEAN BcbListHeld)
NTKERNELAPI NTSTATUS NTAPI CcWaitForCurrentLazyWriterActivity(VOID)
Definition: lazyrite.c:30