IOCTL_VOLUME_ONLINE - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// ntddvol.h

// CTL_CODE(0x0056, 0x002, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_VOLUME_ONLINE 0x0056C008
View the official Windows Driver Kit DDI reference
// winioctl.h

// CTL_CODE(0x0056, 0x002, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_VOLUME_ONLINE 0x0056C008
View the official Win32 API reference

NtDoc

No description available.

Windows Driver Kit DDI reference (ni-ntddvol-ioctl_volume_online)

IOCTL_VOLUME_ONLINE IOCTL

Description

The IOCTL_VOLUME_ONLINE IOCTL puts the volume in an ONLINE state, which is a state where read and write operations will be executed. The requests are passed down to the physical disk until a subsequent IOCTL_VOLUME_OFFLINE is received.

A common use for IOCTL_VOLUME_ONLINE is a case in which the mount manager automatically puts a new volume in the ONLINE state when the volume arrives, unless that volume is listed in a registry key that is populated by the cluster service. IOCTL_VOLUME_ONLINE is called for removable drives regardless of the NoAutoMount setting in the following registry key:

HKCU\System\CurrentControlSet\Services\Mountmgr\NoAutoMount

But for volumes controlled by NoAutoMount, assigning a drive letter will cause IOCTL_VOLUME_ONLINE to be called.

For volumes that are controlled by the cluster service, IOCTL_VOLUME_ONLINE is sent by the cluster service when the local node owns the volume. The cluster service uses both IOCTL_VOLUME_ONLINE and IOCTL_VOLUME_ONLINE to allow I/O to a disk volume when the disk volume is owned by the local server. Until the cluster service puts the disk volume in an ONLINE state, no I/O is permitted to the disk volume. This prevents disk volume corruption that could result from multiple cluster nodes writing to the same disk volume simultaneously.

Parameters

Major code

Input buffer

None.

Input buffer length

None.

Output buffer

None.

Output buffer length

None.

Input/output buffer

Input/output buffer length

Status block

The Status member is set to STATUS_SUCCESS.

See also

IOCTL_VOLUME_OFFLINE


Win32 API reference (ni-winioctl-ioctl_volume_online)

IOCTL_VOLUME_ONLINE IOCTL

Description

Brings a volume online.

Windows Server 2003 and Windows XP: This control code is not supported for dynamic disks.

To perform this operation, call the DeviceIoControl function with the following parameters.

BOOL DeviceIoControl(
  (HANDLE) hDevice,             // handle to device
  IOCTL_VOLUME_ONLINE,          // dwIoControlCode
  NULL,                         // lpInBuffer
  0,                            // nInBufferSize
  NULL,                         // lpOutBuffer
  0,                            // nOutBufferSize
  (LPDWORD) lpBytesReturned,    // number of bytes returned
  (LPOVERLAPPED) lpOverlapped   // OVERLAPPED structure
);

Parameters

Input buffer

Input buffer length

Output buffer

Output buffer length

Input/output buffer

Input/output buffer length

Status block

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.

Remarks

When a volume is offline, all read, write, and IOCTL requests fail with ERROR_NOT_READY. You cannot take the system or boot volume offline.

When a volume is online, all requests sent to the volume are honored.

When a volume that is online is dismounted, the next call to open the volume causes it to be mounted. Taking the volume offline prevents the dismounted volume from being mounted again.

To take a volume offline, use the IOCTL_VOLUME_OFFLINE control code.

In Windows 8 and Windows Server 2012, this code 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) No

See also