This IOCTL command allows only set encryption state for application-managed encryption.
Note: On unload, some drive settings might be reset to default. To set the encryption state, the application must issue this IOCTL after a tape is loaded and at BOP.
The data structure that is used for this IOCTL is the same as for IOCTL_GET_ENCRYPTION_STATE.
#define IOCTL_TAPE_SET_ENCRYPTION_STATE CTL_CODE(IOCTL_TAPE_BASE, 0x0821, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS )
An example of the IOCTL_TAPE_SET_ENCRYPTION_STATE command is
ENCRYPTION_STATUS scEncryptStat; DeviceIoControl(hDevice, IOCTL_TAPE_SET_ENCRYPTION_STATE, &scEncryptStat, sizeof(ENCRYPTION_STATUS), ,&scEncryptStat sizeof(ENCRYPTION_STATUS), &cb, (LPOVERLAPPED) NULL);