FSCTL_IS_CSV_FILE control code

Determines whether a file is stored on a CSVFS volume, or retrieves namespace information.

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

DeviceIoControl( (HANDLE) hDevice,              // handle to device
                 FSCTL_IS_CSV_FILE,             // dwIoControlCode
                 (LPVOID) lpInBuffer,           // input buffer
                 (DWORD) nInBufferSize,         // size of input buffer
                 (LPVOID) lpOutBuffer,          // lpOutBuffer
                 (DWORD) nOutBufferSize,        // nOutBufferSize
                 (LPDWORD) lpBytesReturned,     // number of bytes returned
                 (LPOVERLAPPED) lpOverlapped ); // OVERLAPPED structure



A handle to the volume. To retrieve a volume handle, call the CreateFile function. Only administrators can open volume handles.


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


NULL to return a value in the lpOutBuffer parameter that indicates whether the file is stored on a CSVFS volume. Otherwise, the input buffer must be a CSV_NAMESPACE_INFO structure in which the Version member is set to CSV_NAMESPACE_INFO_V1.


The size of the input buffer, in bytes.


ERROR_SUCCESS if lpInBuffer is NULL and the file is stored on a CSVFS volume. Otherwise, the output buffer is a pointer to the returned CSV_NAMESPACE_INFO structure, which contains the disk device number, starting offset of the volume, and the disk sector size.


The size of the output buffer, in bytes.


A pointer to a variable that receives the size of the data stored in the output buffer, in bytes.

If lpOverlapped is NULL, lpBytesReturned cannot be NULL. Even when an operation returns no output data and lpOutBuffer is NULL, DeviceIoControl makes use of lpBytesReturned. After such an operation, the value of lpBytesReturned is meaningless.

If lpOverlapped is not NULL, lpBytesReturned can be NULL. If this parameter is not NULL and the operation returns data, lpBytesReturned is meaningless until the overlapped operation has completed. To retrieve the number of bytes returned, call GetOverlappedResult. If hDevice is associated with an I/O completion port, you can retrieve the number of bytes returned by calling GetQueuedCompletionStatus.


A pointer to an OVERLAPPED structure.

If hDevice was opened without specifying FILE_FLAG_OVERLAPPED, lpOverlapped is ignored.

If hDevice was opened with the FILE_FLAG_OVERLAPPED flag, the operation is performed as an overlapped (asynchronous) operation. In this case, lpOverlapped must point to a valid OVERLAPPED structure that contains a handle to an event object. Otherwise, the function fails in unpredictable ways.

For overlapped operations, DeviceIoControl returns immediately, and the event object is signaled when the operation has been completed. Otherwise, the function does not return until the operation has been completed or an error occurs.

Return value

If the operation completes successfully, DeviceIoControl returns a nonzero value.

If the operation fails or is pending, DeviceIoControl returns zero (0). To get extended error information, call GetLastError.


To determine whether a file is stored on a CSVFS volume, simply leave the lpInBuffer parameter empty. If the file is on a CSVFS volume, the lpOutBuffer parameter will contain ERROR_SUCCESS.

To retrieve namespace information, specify a pointer to the same CSV_NAMESPACE_INFO structure that is initially empty (except for the Version member) in both the lpInBuffer and lpOutBuffer parameters. The information in that structure is filled in by the function call.


Minimum supported client

None supported

Minimum supported server

Windows Server 2012 [desktop apps only]


WinIoCtl.h (include Windows.h)

See also

Volume Management Control Codes