FltSetInformationFile function

FltSetInformationFile sets information for a given file.

Syntax


NTSTATUS FltSetInformationFile(
  _In_ PFLT_INSTANCE          Instance,
  _In_ PFILE_OBJECT           FileObject,
  _In_ PVOID                  FileInformation,
  _In_ ULONG                  Length,
  _In_ FILE_INFORMATION_CLASS FileInformationClass
);

Parameters

Instance [in]

Opaque instance pointer for the caller. This parameter is required and cannot be NULL.

FileObject [in]

File object pointer for the file. This parameter is required and cannot be NULL.

FileInformation [in]

Pointer to a caller-allocated buffer that contains information to be set for the file. The FileInformationClass parameter specifies the type of information. This parameter is required and cannot be NULL.

Length [in]

Size, in bytes, of the FileInformation buffer.

FileInformationClass [in]

Specifies the type of information to be set for the file. The following values are defined.

ValueMeaning

FileAllocationInformation

Set FILE_ALLOCATION_INFORMATION for the file.

FileBasicInformation

Set FILE_BASIC_INFORMATION for the file.

FileDispositionInformation

Set FILE_DISPOSITION_INFORMATION for the file.

FileEndOfFileInformation

Set FILE_END_OF_FILE_INFORMATION for the file.

FileLinkInformation

Set FILE_LINK_INFORMATION for the file.

FilePositionInformation

Set FILE_POSITION_INFORMATION for the file.

FileRenameInformation

Set FILE_RENAME_INFORMATION for the file. For more information about file renaming, see the following Remarks section.

FileValidDataLengthInformation

Set FILE_VALID_DATA_LENGTH_INFORMATION for the file.

 

Return value

FltSetInformationFile returns STATUS_SUCCESS or an appropriate NTSTATUS value.

Remarks

A minifilter driver calls FltSetInformationFile to set information for a given file. The file must currently be open.

A file rename operation imposes the following restriction on the parameter values passed to FltSetInformationFile: As noted in the reference entry for FILE_RENAME_INFORMATION, a file or directory can only be renamed within a volume. In other words, a rename operation cannot cause a file or directory to be moved to a different volume. Unlike ZwSetInformationFile, FltSetInformationFile does not validate the contents of the FILE_RENAME_INFORMATION structure. Thus the caller of FltSetInformationFile is responsible for ensuring that the new name for the file or directory is on the same volume as the old name.

Minifilter drivers must use FltSetInformationFile , not ZwSetInformationFile, to rename a file.

Requirements

Target platform

Universal

Header

Fltkernel.h (include Fltkernel.h)

Library

FltMgr.lib

DLL

Fltmgr.sys

IRQL

PASSIVE_LEVEL

See also

FILE_ALLOCATION_INFORMATION
FILE_BASIC_INFORMATION
FILE_DISPOSITION_INFORMATION
FILE_END_OF_FILE_INFORMATION
FILE_LINK_INFORMATION
FILE_POSITION_INFORMATION
FILE_RENAME_INFORMATION
FILE_VALID_DATA_LENGTH_INFORMATION
FltQueryInformationFile
FltQueryVolumeInformationFile
ZwSetInformationFile

 

 

Send comments about this topic to Microsoft

Show: