FSCTL_SET_PERSISTENT_VOLUME_STATE control code

The FSCTL_SET_PERSISTENT_VOLUME_STATE control code sets persistent settings for a file system volume. Persistent settings remain on a file system volume between reboots of the computer.

To perform this operation, call FltFsControlFile or ZwFsControlFile with the following parameters.

Parameters

FileObject

FltFsControlFile only. A file object pointer for the file system volume. This parameter is required and cannot be NULL.

FileHandle

ZwFsControlFile only. A file handle for the file system volume. This parameter is required and cannot be NULL.

FsControlCode

The control code for the operation. Use FSCTL_SET_PERSISTENT_VOLUME_STATE for this operation.

InputBuffer

A pointer to a caller-allocated FILE_FS_PERSISTENT_VOLUME_INFORMATION structure that contains the persistent settings for a file system volume.

InputBufferLength

The size, in bytes, of the buffer pointed to by the InputBuffer parameter.

OutputBuffer

Not used with this operation; set to NULL.

OutputBufferLength

Not used with this operation; set to zero.

Return Value

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

STATUS_NOT_SUPPORTED

The requested registry setting is not per volume, or the caller specified an incorrect version number in the Version member of FILE_FS_PERSISTENT_VOLUME_INFORMATION.

STATUS_INVALID_PARAMETER

The file system volume is not an open user volume, or the caller specified an invalid flag in the FlagMask member of FILE_FS_PERSISTENT_VOLUME_INFORMATION.

STATUS_BUFFER_TOO_SMALL

The buffer that the InputBuffer parameter points to is not large enough to hold the persistent-settings data. In this case, no persistent-settings data is set. This is an error code.

STATUS_ACCESS_DENIED

The caller cannot access the file system volume.

STATUS_VOLUME_DISMOUNTED

The file system volume is dismounted.

STATUS_TOO_LATE

The file system volume is shut down.

STATUS_MEDIA_WRITE_PROTECTED

The file system volume is read only.

Requirements

Version

Available starting with Windows 7.

Header

Ntifs.h (include Ntifs.h)

See also

FILE_FS_PERSISTENT_VOLUME_INFORMATION
FltFsControlFile
ZwFsControlFile

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft