How to change the active partition using SetTapePosition function ?
i am using SetTapePosition function to change the active partition of a LTO tape drive but unable to do so it compiled without any error but didn't change the partition as well, On the other hand i and able to set the dwOffsetLow and it is working completely fine but the partition is not changing.
DWORD errorCode = 0;
DWORD PARTITION = 1;
errorCode = SetTapePosition(pApp.m_handleValue,TAPE_LOGICAL_BLOCK,PARTITION,20,0,FALSE);
if (errorCode != NO_ERROR) {
DWORD err = GetLastError();
}
and this function as well
DWORD bytesReturned;
TAPE_SET_POSITION tapePosition{};
tapePosition.Method = TAPE_LOGICAL_POSITION;
tapePosition.Partition = partition;
tapePosition.Offset.LowPart = 0;
tapePosition.Offset.HighPart = 0;
tapePosition.Immediate = FALSE;
if (!DeviceIoControl(hTape, IOCTL_TAPE_SET_POSITION, &tapePosition, sizeof(tapePosition), NULL, 0, &bytesReturned, NULL)) {
return GetLastError();
}
both of them are only able to set the offsetlowPart but unable to change the partition.
kindly let me know how to resolve this issue.
and i have already included the header files