The CreateTapePartition function reformats a tape.
DWORD CreateTapePartition( HANDLE hDevice, DWORD dwPartitionMethod, DWORD dwCount, DWORD dwSize );
Handle to the device where the new partition is to be created. This handle is created by using the CreateFile function.
Type of partition to create. To determine what type of partitions your device supports, see the documentation for your hardware. This parameter can have one of the following values.
Number of partitions to create. The GetTapeParameters function provides the maximum number of partitions a tape can support.
Size of each partition, in megabytes. This value is ignored if the dwPartitionMethod parameter is TAPE_SELECT_PARTITIONS.
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 end-of-tape marker was reached during an operation.|
||A filemark was reached during an operation.|
||A setmark was reached during an operation.|
||The end-of-data marker was reached during an operation.|
||The tape could not be partitioned.|
||The block size is incorrect on a new tape in a multivolume partition.|
||The partition information could not be found when a tape was being loaded.|
||The tape that was in the drive has been replaced or removed.|
||There is no media in the drive.|
||The tape driver does not support a requested function.|
||An attempt to lock the ejection mechanism failed.|
||An attempt to unload the tape failed.|
||The media is write protected.|
Creating partitions reformats the tape. All previous information recorded on the tape is destroyed.
|Minimum supported client||Windows XP [desktop apps only]|
|Minimum supported server||Windows Server 2003 [desktop apps only]|
|Header||winbase.h (include Windows.h)|