CreateTapePartition function (winbase.h)
The CreateTapePartition function reformats a tape.
Syntax
DWORD CreateTapePartition(
[in] HANDLE hDevice,
[in] DWORD dwPartitionMethod,
[in] DWORD dwCount,
[in] DWORD dwSize
);
Parameters
[in] hDevice
Handle to the device where the new partition is to be created. This handle is created by using the CreateFile function.
[in] dwPartitionMethod
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.
[in] dwCount
Number of partitions to create. The GetTapeParameters function provides the maximum number of partitions a tape can support.
[in] dwSize
Size of each partition, in megabytes. This value is ignored if the dwPartitionMethod parameter is TAPE_SELECT_PARTITIONS.
Return value
If the function succeeds, the return value is NO_ERROR.
If the function fails, it can return one of the following error codes.
Error | Description |
---|---|
|
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. |
Remarks
Creating partitions reformats the tape. All previous information recorded on the tape is destroyed.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows XP [desktop apps only] |
Minimum supported server | Windows Server 2003 [desktop apps only] |
Target Platform | Windows |
Header | winbase.h (include Windows.h) |
Library | Kernel32.lib |
DLL | Kernel32.dll |