FSCTL_DELETE_USN_JOURNAL IOCTL (ntifs.h)

The FSCTL_DELETE_USN_JOURNAL control code deletes the update sequence number (USN) change journal on a volume, or waits for notification of change journal deletion. See Remarks.

Major code

FSCTL_DELETE_USN_JOURNAL

Remarks

FSCTL_DELETE_USN_JOURNAL can be used to:

  • Delete a change journal. The NTFS file system starts a deletion operation and returns immediately to the calling process, unless the USN_DELETE_FLAG_NOTIFY flag is set in the DeleteFlags member of DELETE_USN_JOURNAL_DATA.

    If the USN_DELETE_FLAG_NOTIFY and USN_DELETE_FLAG_DELETE flags are both set, a call to FSCTL_DELETE_USN_JOURNAL begins the deletion process. Then the call either blocks the calling thread and waits for the deletion (on a synchronous or non-overlapped call), or sets up event notification by using an I/O completion port or other mechanism, and returns (on an asynchronous or overlapped call).

  • Receive notification that a change journal deletion is complete, by setting only USN_DELETE_FLAG_NOTIFY. If you do so, the FSCTL_DELETE_USN_JOURNAL operation either waits until the deletion completes before returning (on a synchronous or non-overlapped call), or sets up event notification by using an I/O completion port or other mechanism (on an asynchronous or overlapped call).

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

  • FileObject [in]: Parameter for FltFsControlFile only. A file object pointer for the remote volume. This parameter is required and can't be NULL.

  • FileHandle [in]: Parameter for ZwFsControlFile only. A handle for the remote volume. This parameter is required and can't be NULL.

  • FsControlCode [in]: A control code for the operation. Use FSCTL_CREATE_USN_JOURNAL for this operation.

  • InputBuffer [in]: Pointer to a DELETE_USN_JOURNAL_DATA structure that contains the parameters for the operation.

  • InputBufferLength [in]: The size, in bytes, of the input buffer.

  • OutputBuffer [out]: Not used.

  • OutputBufferLength [in]: Not used.

FltFsControlFile or ZwFsControlFile returns STATUS_SUCCESS if the operation succeeds. Otherwise, the appropriate function returns the appropriate NTSTATUS error code.

Requirements

Requirement Value
Minimum supported client Windows XP
Header ntifs.h

See also

FltFsControlFile

FSCTL_CREATE_USN_JOURNAL

ZwFsControlFile