IOCTL_ENH_TAPE_LOG_SENSE10

Issue this command to obtain the log data of the requested log page/subpage from IBM® TotalStorage™ tape device. The data that is returned is formatted according to the IBM TotalStorage hardware reference. This IOCTL is only for the tape path and is enhanced so the application can set the page length and provide the buffer enough to get the data back. The following input/output structure is used by the IOCTL_ENH_TAPE_LOG_SENSE10 command.
typedef struct _ENH_TAPE_LOG_SENSE_PARAMETERS_WITH_SUBPAGE{
  UCHAR          PageCode;                 /* [IN] Log sense page */
  UCHAR          SubPageCode;              /* [IN] Log sense subpage */
  UCHAR          PC;                       /* [IN] PC bit */
  UCHAR          reserved[5];              /* unused */
  ULONG          Length;                   /* [IN][OUT] number of valid bytes in data  */
                                           /* (log_page_header_size+page_length)       */
  ULONG          parm_pointer;             /* [IN]  specific parameter number at which */
                                           /* the data begins                    */
  CHAR           LogData[1];               /* [IN] log sense buffer allocated by */
                                           /* application                        */
                                           /* [OUT] log sense data               */
} ENH_TAPE_LOG_SENSE_PARAMETERS_WITH_SUBPAGE, *PENH_TAPE_LOG_SENSE_PARAMETERS_WITH_SUBPAGE;
An example of the IOCTL_ENH_TAPE_LOG_SENSE10 command is
DWORD cb;
char *logsense;
int pageLength = 256;
long lsize = sizeof(ENH_TAPE_LOG_SENSE_PARAMETERS_WITH_SUBPAGE) - sizeof 
(CHAR) /*LogData[1]*/ + pageLength

logsense = malloc (lsize);
(ENH_TAPE_LOG_SENSE_PARAMETERS_WITH_SUBPAGE)logsense->PageCode=0x10;
(ENH_TAPE_LOG_SENSE_PARAMETERS_WITH_SUBPAGE)logsense->SubPageCode=0x01;
(ENH_TAPE_LOG_SENSE_PARAMETERS_WITH_SUBPAGE)logsense->PC = 1;
(ENH_TAPE_LOG_SENSE_PARAMETERS_WITH_SUBPAGE)logsense->Length = pageLength;
DeviceIoControl(hDevice,
                IOCTL_ENH_TAPE_LOG_SENSE10,
                &logsense, (long)lsize,
                &logsense, (long)lsize,
                &cb, (LPOVERLAPPED) NULL);