// ntifs.h
// CTL_CODE(0x0009, 0x039, METHOD_NEITHER, FILE_ANY_ACCESS)
#define FSCTL_CREATE_USN_JOURNAL 0x000900E7
View the official Windows Driver Kit DDI reference// winioctl.h
// CTL_CODE(0x0009, 0x039, METHOD_NEITHER, FILE_ANY_ACCESS)
#define FSCTL_CREATE_USN_JOURNAL 0x000900E7
View the official Win32 API referenceNo description available.
The FSCTL_CREATE_USN_JOURNAL control code creates an update sequence number (USN) change journal stream on a target volume, or modifies an existing change journal stream. See Remarks.
FSCTL_CREATE_USN_JOURNAL
FSCTL_CREATE_USN_JOURNAL can be used to:
Create a new change journal stream for a volume. After the creation of the stream, the NTFS file system maintains a change journal for that volume.
Modify an existing change journal stream. If a change journal stream already exists, FSCTL_CREATE_USN_JOURNAL sets it to the characteristics provided in the [CREATE_USN_JOURNAL_DATA] structure. The change journal stream eventually gets larger or is trimmed to the new size limit that CREATE_USN_JOURNAL_DATA imposes.
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 CREATE_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.
Creates an update sequence number (USN) change journal stream on a target volume, or modifies an existing change journal stream.
| C++ |
|---|
BOOL WINAPI DeviceIoControl( (HANDLE) hDevice, // handle to volume FSCTL_CREATE_USN_JOURNAL, // dwIoControlCode(LPVOID) lpInBuffer, // input buffer (DWORD) nInBufferSize, // size of input buffer NULL, // lpOutBuffer 0, // nOutBufferSize(LPDWORD) lpBytesReturned, // number of bytes returned (LPOVERLAPPED) lpOverlapped ); // OVERLAPPED structure |
Irp->IoStatus.Status is set to STATUS_SUCCESS if the request is successful.
Otherwise, Status to the appropriate error condition as a NTSTATUS code.
For more information, see NTSTATUS Values.
For the implications of overlapped I/O on this operation, see the Remarks section of the DeviceIoControl topic.
You can use FSCTL_CREATE_USN_JOURNAL to create a new change journal stream for a volume. After the creation of the stream, the NTFS file system maintains a change journal for that volume.
You can also use FSCTL_CREATE_USN_JOURNAL to modify an existing change journal stream. If a change journal stream already exists, FSCTL_CREATE_USN_JOURNAL sets it to the characteristics provided in the CREATE_USN_JOURNAL_DATA structure. The change journal stream eventually gets larger or is trimmed to the new size limit that CREATE_USN_JOURNAL_DATA imposes.
For more information, see Creating, Modifying, and Deleting a Change Journal.
To retrieve a handle to a volume, call CreateFile with the lpFileName parameter set to a string in the following form:
\.*X*:
In the preceding string, X is the letter identifying the drive on which the volume appears. The volume must be NTFS 3.0 or later. To obtain the NTFS version of a volume, open a command prompt with Administrator access rights and execute the following command:
fsutil fsinfo ntfsinfo X:
where X is the drive letter of the volume.
In Windows Server 2012, this function is supported by the following technologies.
| Technology | Supported |
|---|---|
| Server Message Block (SMB) 3.0 protocol | No |
| SMB 3.0 Transparent Failover (TFO) | No |
| SMB 3.0 with Scale-out File Shares (SO) | No |
| Cluster Shared Volume File System (CsvFS) | Yes |
Volume Management Control Codes