UID | tech.root | title | ms.date | targetos | description | prerelease | req.assembly | req.construct-type | req.ddi-compliance | req.dll | req.header | req.idl | req.include-header | req.irql | req.kmdf-ver | req.lib | req.max-support | req.namespace | req.redist | req.target-min-winverclnt | req.target-min-winversvr | req.target-type | req.type-library | req.umdf-ver | req.unicode-ansi | topic_type | api_type | api_location | api_name | f1_keywords | dev_langs | helpviewer_keywords | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
NF:ntifs.IoCheckFileObjectOpenedAsCopySource |
kernel |
IoCheckFileObjectOpenedAsCopySource |
08/01/2022 |
Windows |
Learn more about the IoCheckFileObjectOpenedAsCopySource function. |
false |
function |
ntifs.h |
Wdm.h, Ntddk.h, Ntifs.h |
PASSIVE_LEVEL |
Windows 11, version 22H2 |
|
|
|
|
|
|
|
The IoCheckFileObjectOpenedAsCopySource routine checks whether a file was previously opened with copy intent as a source file.
Pointer to the source file object to check for copy intent.
IoCheckFileObjectOpenedAsCopySource returns TRUE if the file object represents a source 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.
The following example shows how to check if a file object was opened with copy intent.
typedef
BOOLEAN (*PIO_CHECK_FILE_OBJECT_OPENED_AS_COPY_SOURCE)(
_In_ PFILE_OBJECT FileObject
);
typedef
BOOLEAN (*PIO_CHECK_FILE_OBJECT_OPENED_AS_COPY_DESTINATION)(
_In_ PFILE_OBJECT FileObject
);
PIO_CHECK_FILE_OBJECT_OPENED_AS_COPY_SOURCE IoCheckFileObjectOpenedAsCopySource;
PIO_CHECK_FILE_OBJECT_OPENED_AS_COPY_DESTINATION IoCheckFileObjectOpenedAsCopyDestination;
// First resolve the API
RtlInitUnicodeString(&RoutineName, L"IoCheckFileObjectOpenedAsCopySource");
IoCheckFileObjectOpenedAsCopySource = (PIO_CHECK_FILE_OBJECT_OPENED_AS_COPY_SOURCE)MmGetSystemRoutineAddress(&RoutineName);
RtlInitUnicodeString(&RoutineName, L"IoCheckFileObjectOpenedAsCopyDestination");
IoCheckFileObjectOpenedAsCopyDestination = (PIO_CHECK_FILE_OBJECT_OPENED_AS_COPY_DESTINATION)MmGetSystemRoutineAddress(&RoutineName);
// Now use the API
IoCheckFileObjectOpenedAsCopySource(FltObjects->FileObject);
IoCheckFileObjectOpenedAsCopyDestination(FltObjects->FileObject);
See Kernel-mode file copy and detecting copy file scenarios for more information.