I've been trying to change the active partition of an LTO8 tape in Windows 10 pro using the following code snippet (which gcc compiles without any warnings) but can able to change offset low
ChangePartition(HANDLE hTape, DWORD partition) {
DWORD bytesReturned;
TAPE_SET_POSITION tapePosition{};
tapePosition.Method = TAPE_LOGICAL_POSITION;
tapePosition.Partition = partition;
tapePosition.Offset.LowPart = 100;
tapePosition.Offset.HighPart = 0;
tapePosition.Immediate = TRUE;
if (!DeviceIoControl(hTape, IOCTL_TAPE_SET_POSITION, &tapePosition, sizeof(tapePosition), NULL, 0, &bytesReturned, NULL)) {
return GetLastError();
}
return ERROR_SUCCESS;
}
This is the particular function I am using is DWORD partition I have tried to pass input(1 and 2) but nothing happen.