Export (0) Print
Expand All

ZwSetVolumeInformationFile routine

The ZwSetVolumeInformationFile routine modifies information about the volume associated with a given file, directory, storage device, or volume.

Syntax


NTSTATUS ZwSetVolumeInformationFile(
  _In_   HANDLE               FileHandle,
  _Out_  PIO_STATUS_BLOCK     IoStatusBlock,
  _In_   PVOID                FsInformation,
  _In_   ULONG                Length,
  _In_   FS_INFORMATION_CLASS FsInformationClass
);

Parameters

FileHandle [in]

Handle to a file object for an open file, directory, storage device, or volume whose volume information is to be modified.

IoStatusBlock [out]

Pointer to an IO_STATUS_BLOCK structure that receives the final completion status and information about the operation.

FsInformation [in]

Pointer to a caller-allocated buffer containing the volume information to be modified. The structure of the information in this buffer depends on the value of FsInformationClass, as shown in the following table.

Length [in]

Size in bytes of the buffer pointed to by FsInformation. The caller should set this parameter according to the given FsInformationClass.

FsInformationClass [in]

Type of volume information to be set. One of the following:

ValueMeaning

FileFsControlInformation

Set FILE_FS_CONTROL_INFORMATION for the volume.

FileFsLabelInformation

Set FILE_FS_LABEL_INFORMATION for the volume.

FileFsObjectIdInformation

Set FILE_FS_OBJECTID_INFORMATION for the volume.

 

Return value

ZwSetVolumeInformationFile returns STATUS_SUCCESS or an appropriate NTSTATUS value such as one of the following:

Return codeDescription
STATUS_INFO_LENGTH_MISMATCH

An invalid value was specified for Length. This is an error code.

STATUS_INSUFFICIENT_RESOURCES

ZwSetVolumeInformationFile encountered a pool allocation failure. This is an error code.

STATUS_INVALID_INFO_CLASS

An invalid value was specified for FsInformationClass. This is an error code.

 

Remarks

To query volume information, call ZwQueryVolumeInformationFile.

To change information about a file, call ZwSetInformationFile.

Minifilters should use FltSetInformationFile instead of ZwSetInformationFile.

Note  If the call to the ZwSetInformationFile function occurs in user mode, you should use the name "NtSetInformationFile" instead of "ZwSetInformationFile".

Requirements

Target platform

Universal

Version

Available in Windows Server 2003 and later versions of Windows.

Header

Ntifs.h (include Ntifs.h)

Library

Ntoskrnl.lib

IRQL

PASSIVE_LEVEL

DDI compliance rules

PowerIrpDDis, HwStorPortProhibitedDDIs

See also

FILE_FS_CONTROL_INFORMATION
FILE_FS_LABEL_INFORMATION
FILE_FS_OBJECTID_INFORMATION
FltSetInformationFile
IRP_MJ_SET_VOLUME_INFORMATION
ZwQueryVolumeInformationFile
ZwSetInformationFile

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft