File Management Control Codes

The following control codes are used in file management.

Control codeOperation
FSCTL_ALLOW_EXTENDED_DASD_IOSignals the file system driver not to perform any I/O boundary checks on partition read or write calls. Instead, boundary checks are performed by the device driver.
FSCTL_FILESYSTEM_GET_STATISTICSRetrieves statistics from the file system.
FSCTL_FIND_FILES_BY_SIDSearches a directory for a file whose creator owner matches the specified SID.
FSCTL_GET_NTFS_FILE_RECORDRetrieves the complete NTFS file system file record identified by the specified file identifier.
FSCTL_RECALL_FILERecalls a file from storage media managed by Remote Storage, the hierarchical storage management software.
FSCTL_SET_ZERO_ON_DEALLOCATIONIndicates an NTFS file system file handle should have its clusters filled with zeros when it is deallocated.

 

The following control codes are used with file compression and decompression.

Control codeOperation
FSCTL_GET_COMPRESSIONObtains the compression state of a file or directory.
FSCTL_SET_COMPRESSIONSets the compression state of a file or directory.

 

The following control codes are used with object identifiers.

Control codeOperation
FSCTL_CREATE_OR_GET_OBJECT_IDCreates or retrieves the object identifier for the specified file or directory.
FSCTL_DELETE_OBJECT_IDRemoves the object identifier from the specified file or directory.
FSCTL_GET_OBJECT_IDRetrieves the object identifier for the specified file or directory.
FSCTL_SET_OBJECT_IDSets the object identifier for the specified file or directory.
FSCTL_SET_OBJECT_ID_EXTENDEDModifies user data associated with the object identifier of the specified file or directory.

 

The following control codes are used with opportunistic locks.

Control codeOperation
FSCTL_OPBATCH_ACK_CLOSE_PENDINGNotifies a server that a client application is about to close a file. An application uses this operation following notification that an opportunistic lock on the file is about to be broken.
FSCTL_OPLOCK_BREAK_ACK_NO_2Responds to notification that an opportunistic lock on a file is about to be broken. An application uses this operation to unlock all opportunistic locks on the file but keep the file open.
FSCTL_OPLOCK_BREAK_ACKNOWLEDGEResponds to notification that an exclusive opportunistic lock on a file is about to be broken. An application uses this operation to indicate that the file should receive a level 2 opportunistic lock.
FSCTL_OPLOCK_BREAK_NOTIFYAllows the calling application to wait for completion of an opportunistic lock break.
FSCTL_REQUEST_BATCH_OPLOCKRequests a batch opportunistic lock on a file.
FSCTL_REQUEST_FILTER_OPLOCKRequests a filter opportunistic lock on a file.
FSCTL_REQUEST_OPLOCKRequests an opportunistic lock on a file.
FSCTL_REQUEST_OPLOCK_LEVEL_1Requests a level 1 opportunistic lock on a file.
FSCTL_REQUEST_OPLOCK_LEVEL_2Requests a level 2 opportunistic lock on a file.

 

The following control codes are used with sparse files.

Control codeOperation
FSCTL_QUERY_ALLOCATED_RANGESScans a file for ranges of the file for which disk space is allocated.
FSCTL_SET_SPARSEMarks a file as a sparse file.
FSCTL_SET_ZERO_DATASets a range of a files bytes to zeroes.

 

The following control codes are used with the NTFS self-healing mechanism.

Control codeOperation
FSCTL_GET_REPAIRRetrieves information about the NTFS file system's self-healing mechanism.
FSCTL_INITIATE_REPAIRTriggers the NTFS file system to start a self-healing cycle on a single file.
FSCTL_SET_REPAIRSets the mode of an NTFS file system's self-healing capability.
FSCTL_WAIT_FOR_REPAIRReturns when the specified repairs are completed.

 

The following control codes are used with UDF.

Control codeOperation
FSCTL_MAKE_MEDIA_COMPATIBLECloses an open UDF session on write-once media to make the media ROM compatible. Used in conjunction with FILE_SEQUENTIAL_WRITE_ONCE volume flag. This call must be issued on the volume handle.
FSCTL_QUERY_ON_DISK_VOLUME_INFORequests UDF-specific volume information.
FSCTL_QUERY_SPARING_INFORetrieves the defect management properties of the volume. Used for UDF file systems.
FSCTL_SET_DEFECT_MANAGEMENTSets the software defect management state for the specified file. Used for UDF file systems.

 

Send comments about this topic to Microsoft

Build date: 11/12/2009

Tags :


Page view tracker