IOCTL_ALLOW_DATA_OVERWRITE
This command allows previously written data on the tape to be overwritten. This action happens when append only mode is enabled on the drive with either a write type command or a format command is allowed on the IOCTL_CREATE_PARTITION. Before this IOCTL is issued, the application must locate to the partition number and logical block id within the partition where the data overwrite or format occurs.
The data structure that is used for IOCTL_ALLOW_DATA_OVERWRITE to
enable or disable is
#define IOCTL_ALLOW_DATA_OVERWRITE CTL_CODE(IOCTL_TAPE_BASE, 0x0828,
METHOD_BUFFERED,
FILE_READ_ACCESS | FILE_WRITE_ACCESS )
typedef struct ALLOW_DATA_OVERWRITE{
UCHAR partition_number; /* Partition number 0-n to overwrite */
ULONGULONG logical_block_id; /* Blockid to overwrite to within partition */
UCHAR allow_format_overwrite; /* allow format if in data safe mode */
UCHAR reserved[32];
} ALLOW_DATA_OVERWRITE, *PALLOW_DATA_OVERWRITE;
An example of the IOCTL_ALLOW_DATA_OVERWRITE command
is
ALLOW_DATA_OVERWRITE tapeAllowDataOverwrite;
...
DeviceIoControl(gp->ddHandle0,
IOCTL_ALLOW_DATA_OVERWRITE,
&tapeAllowDataOverwrite,
(long)sizeof(ALLOW_DATA_OVERWRITE),
NULL,
0,
&cb,
(LPOVERLAPPED) NULL);