The WriteTapemark function writes a specified number of filemarks, setmarks, short filemarks, or long filemarks to a tape device. These tapemarks divide a tape partition into smaller areas.
DWORD WriteTapemark( HANDLE hDevice, DWORD dwTapemarkType, DWORD dwTapemarkCount, BOOL bImmediate );
Handle to the device on which to write tapemarks. This handle is created by using the CreateFile function.
Type of tapemarks to write. This parameter can be one of the following values.
Number of tapemarks to write.
If this parameter is TRUE, the function returns immediately; if it is FALSE, the function does not return until the operation has been completed.
If the function succeeds, the return value is NO_ERROR.
If the function fails, it can return one of the following error codes.
||An attempt to access data before the beginning-of-medium marker failed.|
||A reset condition was detected on the bus.|
||The partition information could not be found when a tape was being loaded.|
||The end-of-tape marker was reached during an operation.|
||A filemark was reached during an operation.|
||The block size is incorrect on a new tape in a multivolume partition.|
||The tape that was in the drive has been replaced or removed.|
||The end-of-data marker was reached during an operation.|
||There is no media in the drive.|
||The tape driver does not support a requested function.|
||The tape could not be partitioned.|
||A setmark was reached during an operation.|
||An attempt to lock the ejection mechanism failed.|
||An attempt to unload the tape failed.|
||The media is write protected.|
Filemarks, setmarks, short filemarks, and long filemarks are special recorded elements that denote the linear organization of the tape. None of these marks contain user data. Filemarks are the most general marks; setmarks provide a hierarchy not available with filemarks.
A short filemark contains a short erase gap that cannot be overwritten unless the write operation is performed from the beginning of the partition or from an earlier long filemark.
A long filemark contains a long erase gap that allows an application to position the tape at the beginning of the filemark and to overwrite the filemark and the erase gap.
|Minimum supported client||Windows XP [desktop apps only]|
|Minimum supported server||Windows Server 2003 [desktop apps only]|
|Header||winbase.h (include Windows.h)|