EraseTape

  DWORD EraseTape(hDevice, dwPartition, fdwEraseType, lpo)    
  HANDLE hDevice; /* open device handle */
  DWORD dwPartition; /* identifies partition to erase */
  DWORD fdwEraseType; /* type of erase to perform */
  LPOVERLAPPED lpo; /* overlapped structure */

Parameters

hDevice

Specifies an open handle to the device where the tape will be erased.

dwPartition

Specifies the partition to erase. If dwPartition is zero, the entire tape is erased.

fdwEraseType

Specifies the erasing technique to be used. This parameter can have one of the following values:

Value Meaning

ERASE_SHORT Only the partition header block is rewritten.
ERASE_LONG Erases the partition.
ERASE_SHORT_IMMED Only the partition header block is rewritten. Returns status as soon as the operation is initiated.
ERASE_LONG_IMMED Erases the partition. Returns status as soon as the operation is initiated.

lpo

Points to an OVERLAPPED structure. The OVERLAPPED structure has the following form:

typedef struct _OVERLAPPED { /* o */

DWORD Internal;

DWORD InternalHigh;

DWORD Offset;

DWORD OffsetHigh;

HANDLE hEvent;

} OVERLAPPED;

typedef OVERLAPPED *LPOVERLAPPED;

Return Value

If the function is successful, the return value is NO_ERROR. Otherwise, it is an error code.