| DWORD PrepareTape(hDevice, dwOperation, lpo) | |||||
| HANDLE hDevice; | /* open device handle | */ | |||
| DWORD dwOperation; | /* how to prepare device | */ | |||
| LPOVERLAPPED lpo; | /* overlapped structure | */ | |||
hDevice
Specifies an open handle to the device to prepare.
dwOperation
Specifies how the tape device is to be prepared. This parameter can have one of the following values:
| Value | Meaning |
| TAPE_UNLOAD | ||
| Rewinds and unloads the tape. | ||
| TAPE_UNLOAD_IMMED | ||
| Rewinds and unloads the tape. Returns status as soon as the operation is initiated. | ||
| TAPE_TENSION | ||
| Tension moves the tape to end of tape and back to beginning of tape. This option is not supported on all drives; this flag is ignored if it is not supported. | ||
| TAPE_LOCK | ||
| Locks the tape ejection mechanism. Locking is intended to prevent the accidental manual ejection of a tape during an operation. | ||
| TAPE_UNLOCK | ||
| Unlocks the tape ejection mechanism. | ||
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;
If the function is successful, the return value is NO_ERROR. Otherwise, it is an error code.