Bewerken

Delen via


FltSetInformationFile function (fltkernel.h)

FltSetInformationFile sets information for a given file.

Syntax

NTSTATUS FLTAPI FltSetInformationFile(
  [in] PFLT_INSTANCE          Instance,
  [in] PFILE_OBJECT           FileObject,
  [in] PVOID                  FileInformation,
  [in] ULONG                  Length,
  [in] FILE_INFORMATION_CLASS FileInformationClass
);

Parameters

[in] Instance

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

[in] FileObject

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

[in] FileInformation

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.

[in] Length

Size, in bytes, of the FileInformation buffer.

[in] FileInformationClass

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

Value Meaning
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

Requirement Value
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