IoCheckFileObjectOpenedAsCopyDestination function (ntifs.h)

The IoCheckFileObjectOpenedAsCopyDestination routine checks whether a file was previously opened with copy intent as a destination file.

Syntax

BOOLEAN IoCheckFileObjectOpenedAsCopyDestination(
  [in] PFILE_OBJECT FileObject
);

Parameters

[in] FileObject

Pointer to the destination file object to check for copy intent.

Return value

IoCheckFileObjectOpenedAsCopyDestination returns TRUE if the file object represents a destination file that was previously opened with copy file intent; otherwise it returns FALSE. A return value of TRUE only signals the intent at create time; it does not mean that all operations on the file object are all part of copies.

Remarks

See IoCheckFileObjectOpenedAsCopySource for sample code that shows how to check if a file object was opened with copy intent.

See Kernel-mode file copy and detecting copy file scenarios for more information.

Requirements

Requirement Value
Minimum supported client Windows 11, version 22H2
Header ntifs.h (include Wdm.h, Ntddk.h, Ntifs.h)
IRQL PASSIVE_LEVEL

See also

EXTENDED_CREATE_INFORMATION

IoCheckFileObjectOpenedAsCopySource

NtCopyFileChunk

NtCreateFile