CcCanIWrite - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// ntifs.h

BOOLEAN CcCanIWrite(
  [in] PFILE_OBJECT FileObject,
  [in] ULONG        BytesToWrite,
  [in] BOOLEAN      Wait,
  [in] UCHAR        Retrying
);

View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-ntifs-cccaniwrite)

CcCanIWrite function

Description

The CcCanIWrite routine determines whether the caller can write to a cached file.

Parameters

FileObject [in]

Pointer to a file object for the cached file.

BytesToWrite [in]

Number of bytes to be written.

Wait [in]

Set to TRUE if the caller can be put into a wait state until it can write to the cached file, FALSE otherwise.

Retrying [in]

Set to FALSE if this is the first time CcCanIWrite is being called for this write request, TRUE otherwise.

Return value

CcCanIWrite returns TRUE if the cache manager can accept the write request, FALSE otherwise.

Remarks

CcCanIWrite should be called before calling CcCopyWrite or CcFastCopyWrite.

If CcCanIWrite returns TRUE, the caller can immediately call CcCopyWrite or CcFastCopyWrite.

If CcCanIWrite returns FALSE, the caller must instead call CcDeferWrite to defer the write request.

Generally speaking, the cache manager can accept a write request if the following conditions are true:

To cache a file, use CcInitializeCacheMap.

See also

CcCopyWrite

CcDeferWrite

CcFastCopyWrite

CcInitializeCacheMap

CcSetDirtyPageThreshold