CcFastCopyWrite - NtDoc

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

VOID CcFastCopyWrite(
  [in] PFILE_OBJECT FileObject,
  [in] ULONG        FileOffset,
  [in] ULONG        Length,
  [in] PVOID        Buffer
);

View the official Windows Driver Kit DDI reference

NtDoc

No description available.

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

CcFastCopyWrite function

Description

The CcFastCopyWrite routine performs a fast copy write from a buffer in memory to a cached file.

Parameters

FileObject [in]

Pointer to a file object for the cached file to which the data is to be written.

FileOffset [in]

Pointer to a variable that specifies the starting byte offset within the cached file.

Length [in]

Length in bytes of the data to be written.

Buffer [in]

Pointer to the buffer from which the data is to be copied.

Remarks

CcFastCopyWrite is a faster version of CcCopyWrite. It differs from CcCopyWrite in the following respects:

If the required pages of the cached file are already resident in memory, the data is copied immediately and no blocking occurs. If any needed pages are not resident, the caller is put in a wait state until all required pages have been made resident and the data can be copied.

If any failure occurs, CcFastCopyWrite raises a status exception for that particular failure. For example, if a pool allocation failure occurs, CcFastCopyWrite raises a STATUS_INSUFFICIENT_RESOURCES exception; if an I/O error occurs, CcFastCopyWrite raises the status exception of the I/O error. Therefore, to gain control if a failure occurs, the driver should wrap the call to CcFastCopyWrite in a try-except or try-finally statement.

To cache a file, use CcInitializeCacheMap.

See also

CcCopyWrite

CcInitializeCacheMap