annotate libdvdcss/ioctl.h @ 34448:6dc79618ec0e

Fix directory creation in refupdate script.
author reimar
date Sun, 08 Jan 2012 15:38:22 +0000
parents cda66f57f7a5
children 691431d2289e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
20613
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
1 /*****************************************************************************
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
2 * ioctl.h: DVD ioctl replacement function
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
3 *****************************************************************************
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
4 * Copyright (C) 1999-2001 VideoLAN
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
5 * $Id$
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
6 *
27462
60bd1a7f3fc6 Sync libdvdcss with upstream version 1.2.10.
diego
parents: 24535
diff changeset
7 * Authors: Sam Hocevar <sam@zoy.org>
20613
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
8 *
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
9 * This program is free software; you can redistribute it and/or modify
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
10 * it under the terms of the GNU General Public License as published by
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
11 * the Free Software Foundation; either version 2 of the License, or
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
12 * (at your option) any later version.
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
13 *
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful,
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
17 * GNU General Public License for more details.
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
18 *
31098
9e9595c779cf libdvdcss: cosmetics: Fix FSF address and program name in license headers.
diego
parents: 27462
diff changeset
19 * You should have received a copy of the GNU General Public License along
9e9595c779cf libdvdcss: cosmetics: Fix FSF address and program name in license headers.
diego
parents: 27462
diff changeset
20 * with libdvdcss; if not, write to the Free Software Foundation, Inc.,
9e9595c779cf libdvdcss: cosmetics: Fix FSF address and program name in license headers.
diego
parents: 27462
diff changeset
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20613
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
22 *****************************************************************************/
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
23
32265
cda66f57f7a5 Sync some minor changes from upstream libdvdcss, up to r237.
diego
parents: 31098
diff changeset
24 #ifndef DVDCSS_IOCTL_H
cda66f57f7a5 Sync some minor changes from upstream libdvdcss, up to r237.
diego
parents: 31098
diff changeset
25 #define DVDCSS_IOCTL_H
cda66f57f7a5 Sync some minor changes from upstream libdvdcss, up to r237.
diego
parents: 31098
diff changeset
26
20613
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
27 int ioctl_ReadCopyright ( int, int, int * );
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
28 int ioctl_ReadDiscKey ( int, int *, uint8_t * );
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
29 int ioctl_ReadTitleKey ( int, int *, int, uint8_t * );
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
30 int ioctl_ReportAgid ( int, int * );
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
31 int ioctl_ReportChallenge ( int, int *, uint8_t * );
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
32 int ioctl_ReportKey1 ( int, int *, uint8_t * );
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
33 int ioctl_ReportASF ( int, int *, int * );
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
34 int ioctl_InvalidateAgid ( int, int * );
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
35 int ioctl_SendChallenge ( int, int *, uint8_t * );
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
36 int ioctl_SendKey2 ( int, int *, uint8_t * );
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
37 int ioctl_ReportRPC ( int, int *, int *, int * );
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
38 int ioctl_SendRPC ( int, int );
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
39
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
40 #define DVD_KEY_SIZE 5
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
41 #define DVD_CHALLENGE_SIZE 10
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
42 #define DVD_DISCKEY_SIZE 2048
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
43
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
44 /*****************************************************************************
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
45 * Common macro, BeOS specific
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
46 *****************************************************************************/
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
47 #if defined( SYS_BEOS )
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
48 #define INIT_RDC( TYPE, SIZE ) \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
49 raw_device_command rdc; \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
50 uint8_t p_buffer[ (SIZE)+1 ]; \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
51 memset( &rdc, 0, sizeof( raw_device_command ) ); \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
52 rdc.data = (char *)p_buffer; \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
53 rdc.data_length = (SIZE); \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
54 BeInitRDC( &rdc, (TYPE) );
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
55 #endif
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
56
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
57 /*****************************************************************************
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
58 * Common macro, HP-UX specific
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
59 *****************************************************************************/
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
60 #if defined( HPUX_SCTL_IO )
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
61 #define INIT_SCTL_IO( TYPE, SIZE ) \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
62 struct sctl_io sctl_io; \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
63 uint8_t p_buffer[ (SIZE)+1 ]; \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
64 memset( &sctl_io, 0, sizeof( sctl_io ) ); \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
65 sctl_io.data = (void *)p_buffer; \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
66 sctl_io.data_length = (SIZE); \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
67 HPUXInitSCTL( &sctl_io, (TYPE) );
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
68 #endif
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
69
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
70 /*****************************************************************************
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
71 * Common macro, Solaris specific
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
72 *****************************************************************************/
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
73 #if defined( SOLARIS_USCSI )
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
74 #define USCSI_TIMEOUT( SC, TO ) ( (SC)->uscsi_timeout = (TO) )
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
75 #define USCSI_RESID( SC ) ( (SC)->uscsi_resid )
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
76 #define INIT_USCSI( TYPE, SIZE ) \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
77 struct uscsi_cmd sc; \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
78 union scsi_cdb rs_cdb; \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
79 uint8_t p_buffer[ (SIZE)+1 ]; \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
80 memset( &sc, 0, sizeof( struct uscsi_cmd ) ); \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
81 sc.uscsi_cdb = (caddr_t)&rs_cdb; \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
82 sc.uscsi_bufaddr = (caddr_t)p_buffer; \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
83 sc.uscsi_buflen = (SIZE); \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
84 SolarisInitUSCSI( &sc, (TYPE) );
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
85 #endif
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
86
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
87 /*****************************************************************************
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
88 * Common macro, Darwin specific
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
89 *****************************************************************************/
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
90 #if defined( DARWIN_DVD_IOCTL )
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
91 #define INIT_DVDIOCTL( DKDVD_TYPE, BUFFER_TYPE, FORMAT ) \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
92 DKDVD_TYPE dvd; \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
93 BUFFER_TYPE dvdbs; \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
94 memset( &dvd, 0, sizeof(dvd) ); \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
95 memset( &dvdbs, 0, sizeof(dvdbs) ); \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
96 dvd.format = FORMAT; \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
97 dvd.buffer = &dvdbs; \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
98 dvd.bufferLength = sizeof(dvdbs);
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
99 #endif
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
100
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
101 /*****************************************************************************
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
102 * Common macro, win32 specific
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
103 *****************************************************************************/
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
104 #if defined( WIN32 )
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
105 #define INIT_SPTD( TYPE, SIZE ) \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
106 DWORD tmp; \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
107 SCSI_PASS_THROUGH_DIRECT sptd; \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
108 uint8_t p_buffer[ (SIZE) ]; \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
109 memset( &sptd, 0, sizeof( SCSI_PASS_THROUGH_DIRECT ) ); \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
110 sptd.Length = sizeof( SCSI_PASS_THROUGH_DIRECT ); \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
111 sptd.DataBuffer = p_buffer; \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
112 sptd.DataTransferLength = (SIZE); \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
113 WinInitSPTD( &sptd, (TYPE) );
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
114 #define SEND_SPTD( DEV, SPTD, TMP ) \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
115 (DeviceIoControl( (HANDLE)(DEV), IOCTL_SCSI_PASS_THROUGH_DIRECT, \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
116 (SPTD), sizeof( SCSI_PASS_THROUGH_DIRECT ), \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
117 (SPTD), sizeof( SCSI_PASS_THROUGH_DIRECT ), \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
118 (TMP), NULL ) ? 0 : -1)
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
119 #define INIT_SSC( TYPE, SIZE ) \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
120 struct SRB_ExecSCSICmd ssc; \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
121 uint8_t p_buffer[ (SIZE)+1 ]; \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
122 memset( &ssc, 0, sizeof( struct SRB_ExecSCSICmd ) ); \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
123 ssc.SRB_BufPointer = (char *)p_buffer; \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
124 ssc.SRB_BufLen = (SIZE); \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
125 WinInitSSC( &ssc, (TYPE) );
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
126 #endif
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
127
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
128 /*****************************************************************************
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
129 * Common macro, QNX specific
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
130 *****************************************************************************/
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
131 #if defined( __QNXNTO__ )
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
132 #define INIT_CPT( TYPE, SIZE ) \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
133 CAM_PASS_THRU * p_cpt; \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
134 uint8_t * p_buffer; \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
135 int structSize = sizeof( CAM_PASS_THRU ) + (SIZE); \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
136 p_cpt = (CAM_PASS_THRU *) malloc ( structSize ); \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
137 p_buffer = (uint8_t *) p_cpt + sizeof( CAM_PASS_THRU ); \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
138 memset( p_cpt, 0, structSize ); \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
139 p_cpt->cam_data_ptr = sizeof( CAM_PASS_THRU ); \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
140 p_cpt->cam_dxfer_len = (SIZE); \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
141 QNXInitCPT( p_cpt, (TYPE) );
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
142 #endif
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
143
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
144 /*****************************************************************************
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
145 * Common macro, OS2 specific
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
146 *****************************************************************************/
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
147 #if defined( SYS_OS2 )
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
148 #define INIT_SSC( TYPE, SIZE ) \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
149 struct OS2_ExecSCSICmd sdc; \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
150 uint8_t p_buffer[ (SIZE)+1 ]; \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
151 unsigned long ulParamLen; \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
152 unsigned long ulDataLen; \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
153 memset( &sdc, 0, sizeof( OS2_ExecSCSICmd ) ); \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
154 memset( &p_buffer, 0, SIZE ); \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
155 sdc.data_length = (SIZE); \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
156 ulParamLen = sizeof(sdc); \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
157 OS2InitSDC( &sdc, (TYPE) )
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
158 #endif
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
159
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
160 /*****************************************************************************
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
161 * Additional types, OpenBSD specific
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
162 *****************************************************************************/
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
163 #if defined( HAVE_OPENBSD_DVD_STRUCT )
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
164 typedef union dvd_struct dvd_struct;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
165 typedef union dvd_authinfo dvd_authinfo;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
166 #endif
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
167
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
168 /*****************************************************************************
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
169 * Various DVD I/O tables
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
170 *****************************************************************************/
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
171 #if defined( SYS_BEOS ) || defined( WIN32 ) || defined ( SOLARIS_USCSI ) || defined ( HPUX_SCTL_IO ) || defined ( __QNXNTO__ ) || defined ( SYS_OS2 )
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
172 /* The generic packet command opcodes for CD/DVD Logical Units,
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
173 * From Table 57 of the SFF8090 Ver. 3 (Mt. Fuji) draft standard. */
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
174 # define GPCMD_READ_DVD_STRUCTURE 0xad
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
175 # define GPCMD_REPORT_KEY 0xa4
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
176 # define GPCMD_SEND_KEY 0xa3
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
177 /* DVD struct types */
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
178 # define DVD_STRUCT_PHYSICAL 0x00
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
179 # define DVD_STRUCT_COPYRIGHT 0x01
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
180 # define DVD_STRUCT_DISCKEY 0x02
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
181 # define DVD_STRUCT_BCA 0x03
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
182 # define DVD_STRUCT_MANUFACT 0x04
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
183 /* Key formats */
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
184 # define DVD_REPORT_AGID 0x00
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
185 # define DVD_REPORT_CHALLENGE 0x01
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
186 # define DVD_SEND_CHALLENGE 0x01
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
187 # define DVD_REPORT_KEY1 0x02
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
188 # define DVD_SEND_KEY2 0x03
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
189 # define DVD_REPORT_TITLE_KEY 0x04
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
190 # define DVD_REPORT_ASF 0x05
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
191 # define DVD_SEND_RPC 0x06
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
192 # define DVD_REPORT_RPC 0x08
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
193 # define DVD_INVALIDATE_AGID 0x3f
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
194 #endif
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
195
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
196 /*****************************************************************************
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
197 * win32 ioctl specific
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
198 *****************************************************************************/
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
199 #if defined( WIN32 )
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
200
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
201 #define WIN32_LEAN_AND_MEAN
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
202 #include <windows.h>
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
203
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
204 #define IOCTL_DVD_START_SESSION CTL_CODE(FILE_DEVICE_DVD, 0x0400, METHOD_BUFFERED, FILE_READ_ACCESS)
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
205 #define IOCTL_DVD_READ_KEY CTL_CODE(FILE_DEVICE_DVD, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS)
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
206 #define IOCTL_DVD_SEND_KEY CTL_CODE(FILE_DEVICE_DVD, 0x0402, METHOD_BUFFERED, FILE_READ_ACCESS)
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
207 #define IOCTL_DVD_END_SESSION CTL_CODE(FILE_DEVICE_DVD, 0x0403, METHOD_BUFFERED, FILE_READ_ACCESS)
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
208 #define IOCTL_DVD_GET_REGION CTL_CODE(FILE_DEVICE_DVD, 0x0405, METHOD_BUFFERED, FILE_READ_ACCESS)
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
209 #define IOCTL_DVD_SEND_KEY2 CTL_CODE(FILE_DEVICE_DVD, 0x0406, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
210 #define IOCTL_DVD_READ_STRUCTURE CTL_CODE(FILE_DEVICE_DVD, 0x0450, METHOD_BUFFERED, FILE_READ_ACCESS)
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
211 #define IOCTL_SCSI_PASS_THROUGH_DIRECT CTL_CODE(FILE_DEVICE_CONTROLLER, 0x0405, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
212
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
213 #define DVD_CHALLENGE_KEY_LENGTH (12 + sizeof(DVD_COPY_PROTECT_KEY))
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
214 #define DVD_BUS_KEY_LENGTH (8 + sizeof(DVD_COPY_PROTECT_KEY))
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
215 #define DVD_TITLE_KEY_LENGTH (8 + sizeof(DVD_COPY_PROTECT_KEY))
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
216 #define DVD_DISK_KEY_LENGTH (2048 + sizeof(DVD_COPY_PROTECT_KEY))
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
217 #define DVD_RPC_KEY_LENGTH (sizeof(DVD_RPC_KEY) + sizeof(DVD_COPY_PROTECT_KEY))
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
218 #define DVD_ASF_LENGTH (sizeof(DVD_ASF) + sizeof(DVD_COPY_PROTECT_KEY))
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
219
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
220 #define DVD_COPYRIGHT_MASK 0x00000040
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
221 #define DVD_NOT_COPYRIGHTED 0x00000000
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
222 #define DVD_COPYRIGHTED 0x00000040
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
223
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
224 #define DVD_SECTOR_PROTECT_MASK 0x00000020
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
225 #define DVD_SECTOR_NOT_PROTECTED 0x00000000
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
226 #define DVD_SECTOR_PROTECTED 0x00000020
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
227
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
228 #define SCSI_IOCTL_DATA_OUT 0
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
229 #define SCSI_IOCTL_DATA_IN 1
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
230
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
231 typedef ULONG DVD_SESSION_ID, *PDVD_SESSION_ID;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
232
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
233 typedef enum DVD_STRUCTURE_FORMAT {
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
234 DvdPhysicalDescriptor,
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
235 DvdCopyrightDescriptor,
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
236 DvdDiskKeyDescriptor,
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
237 DvdBCADescriptor,
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
238 DvdManufacturerDescriptor,
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
239 DvdMaxDescriptor
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
240 } DVD_STRUCTURE_FORMAT, *PDVD_STRUCTURE_FORMAT;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
241
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
242 typedef struct DVD_READ_STRUCTURE {
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
243 LARGE_INTEGER BlockByteOffset;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
244 DVD_STRUCTURE_FORMAT Format;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
245 DVD_SESSION_ID SessionId;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
246 UCHAR LayerNumber;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
247 } DVD_READ_STRUCTURE, *PDVD_READ_STRUCTURE;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
248
24535
b015cbd37591 Leading underscores in identifiers are reserved in C.
diego
parents: 20613
diff changeset
249 typedef struct DVD_COPYRIGHT_DESCRIPTOR {
20613
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
250 UCHAR CopyrightProtectionType;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
251 UCHAR RegionManagementInformation;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
252 USHORT Reserved;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
253 } DVD_COPYRIGHT_DESCRIPTOR, *PDVD_COPYRIGHT_DESCRIPTOR;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
254
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
255 typedef enum
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
256 {
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
257 DvdChallengeKey = 0x01,
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
258 DvdBusKey1,
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
259 DvdBusKey2,
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
260 DvdTitleKey,
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
261 DvdAsf,
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
262 DvdSetRpcKey = 0x6,
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
263 DvdGetRpcKey = 0x8,
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
264 DvdDiskKey = 0x80,
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
265 DvdInvalidateAGID = 0x3f
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
266 } DVD_KEY_TYPE;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
267
24535
b015cbd37591 Leading underscores in identifiers are reserved in C.
diego
parents: 20613
diff changeset
268 typedef struct DVD_COPY_PROTECT_KEY
20613
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
269 {
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
270 ULONG KeyLength;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
271 DVD_SESSION_ID SessionId;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
272 DVD_KEY_TYPE KeyType;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
273 ULONG KeyFlags;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
274 union
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
275 {
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
276 struct
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
277 {
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
278 ULONG FileHandle;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
279 ULONG Reserved; // used for NT alignment
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
280 };
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
281 LARGE_INTEGER TitleOffset;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
282 } Parameters;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
283 UCHAR KeyData[0];
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
284 } DVD_COPY_PROTECT_KEY, *PDVD_COPY_PROTECT_KEY;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
285
24535
b015cbd37591 Leading underscores in identifiers are reserved in C.
diego
parents: 20613
diff changeset
286 typedef struct DVD_ASF
20613
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
287 {
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
288 UCHAR Reserved0[3];
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
289 UCHAR SuccessFlag:1;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
290 UCHAR Reserved1:7;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
291 } DVD_ASF, * PDVD_ASF;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
292
24535
b015cbd37591 Leading underscores in identifiers are reserved in C.
diego
parents: 20613
diff changeset
293 typedef struct DVD_RPC_KEY
20613
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
294 {
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
295 UCHAR UserResetsAvailable:3;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
296 UCHAR ManufacturerResetsAvailable:3;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
297 UCHAR TypeCode:2;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
298 UCHAR RegionMask;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
299 UCHAR RpcScheme;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
300 UCHAR Reserved2[1];
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
301 } DVD_RPC_KEY, * PDVD_RPC_KEY;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
302
24535
b015cbd37591 Leading underscores in identifiers are reserved in C.
diego
parents: 20613
diff changeset
303 typedef struct SCSI_PASS_THROUGH_DIRECT
20613
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
304 {
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
305 USHORT Length;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
306 UCHAR ScsiStatus;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
307 UCHAR PathId;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
308 UCHAR TargetId;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
309 UCHAR Lun;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
310 UCHAR CdbLength;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
311 UCHAR SenseInfoLength;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
312 UCHAR DataIn;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
313 ULONG DataTransferLength;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
314 ULONG TimeOutValue;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
315 PVOID DataBuffer;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
316 ULONG SenseInfoOffset;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
317 UCHAR Cdb[16];
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
318 } SCSI_PASS_THROUGH_DIRECT, *PSCSI_PASS_THROUGH_DIRECT;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
319
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
320 /*****************************************************************************
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
321 * win32 aspi specific
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
322 *****************************************************************************/
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
323
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
324 typedef DWORD (CALLBACK *GETASPI32SUPPORTINFO)(VOID);
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
325 typedef DWORD (CALLBACK *SENDASPI32COMMAND)(LPVOID);
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
326
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
327 #define WIN2K ( GetVersion() < 0x80000000 )
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
328 #define ASPI_HAID 0
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
329 #define ASPI_TARGET 0
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
330 #define DTYPE_CDROM 0x05
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
331
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
332 #define SENSE_LEN 0x0E
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
333 #define SC_GET_DEV_TYPE 0x01
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
334 #define SC_EXEC_SCSI_CMD 0x02
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
335 #define SC_GET_DISK_INFO 0x06
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
336 #define SS_COMP 0x01
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
337 #define SS_PENDING 0x00
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
338 #define SS_NO_ADAPTERS 0xE8
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
339 #define SRB_DIR_IN 0x08
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
340 #define SRB_DIR_OUT 0x10
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
341 #define SRB_EVENT_NOTIFY 0x40
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
342
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
343 struct w32_aspidev
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
344 {
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
345 long hASPI;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
346 short i_sid;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
347 int i_blocks;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
348 SENDASPI32COMMAND lpSendCommand;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
349 };
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
350
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
351 #pragma pack(1)
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
352
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
353 struct SRB_GetDiskInfo
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
354 {
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
355 unsigned char SRB_Cmd;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
356 unsigned char SRB_Status;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
357 unsigned char SRB_HaId;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
358 unsigned char SRB_Flags;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
359 unsigned long SRB_Hdr_Rsvd;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
360 unsigned char SRB_Target;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
361 unsigned char SRB_Lun;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
362 unsigned char SRB_DriveFlags;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
363 unsigned char SRB_Int13HDriveInfo;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
364 unsigned char SRB_Heads;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
365 unsigned char SRB_Sectors;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
366 unsigned char SRB_Rsvd1[22];
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
367 };
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
368
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
369 struct SRB_GDEVBlock
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
370 {
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
371 unsigned char SRB_Cmd;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
372 unsigned char SRB_Status;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
373 unsigned char SRB_HaId;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
374 unsigned char SRB_Flags;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
375 unsigned long SRB_Hdr_Rsvd;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
376 unsigned char SRB_Target;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
377 unsigned char SRB_Lun;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
378 unsigned char SRB_DeviceType;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
379 unsigned char SRB_Rsvd1;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
380 };
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
381
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
382 struct SRB_ExecSCSICmd
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
383 {
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
384 unsigned char SRB_Cmd;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
385 unsigned char SRB_Status;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
386 unsigned char SRB_HaId;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
387 unsigned char SRB_Flags;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
388 unsigned long SRB_Hdr_Rsvd;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
389 unsigned char SRB_Target;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
390 unsigned char SRB_Lun;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
391 unsigned short SRB_Rsvd1;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
392 unsigned long SRB_BufLen;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
393 unsigned char *SRB_BufPointer;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
394 unsigned char SRB_SenseLen;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
395 unsigned char SRB_CDBLen;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
396 unsigned char SRB_HaStat;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
397 unsigned char SRB_TargStat;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
398 unsigned long *SRB_PostProc;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
399 unsigned char SRB_Rsvd2[20];
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
400 unsigned char CDBByte[16];
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
401 unsigned char SenseArea[SENSE_LEN+2];
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
402 };
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
403
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
404 #pragma pack()
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
405
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
406 #endif
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
407
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
408 /*****************************************************************************
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
409 * OS2 ioctl specific
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
410 *****************************************************************************/
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
411 #if defined( SYS_OS2 )
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
412
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
413 #define CDROMDISK_EXECMD 0x7A
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
414
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
415 #define EX_DIRECTION_IN 0x01
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
416 #define EX_PLAYING_CHK 0x02
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
417
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
418 #pragma pack(1)
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
419
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
420 struct OS2_ExecSCSICmd
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
421 {
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
422 unsigned long id_code; // 'CD01'
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
423 unsigned short data_length; // length of the Data Packet
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
424 unsigned short cmd_length; // length of the Command Buffer
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
425 unsigned short flags; // flags
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
426 unsigned char command[16]; // Command Buffer for SCSI command
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
427
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
428 } OS2_ExecSCSICmd;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
429
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
430 #pragma pack()
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
431
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
432 #endif
32265
cda66f57f7a5 Sync some minor changes from upstream libdvdcss, up to r237.
diego
parents: 31098
diff changeset
433
cda66f57f7a5 Sync some minor changes from upstream libdvdcss, up to r237.
diego
parents: 31098
diff changeset
434 #endif /* DVDCSS_IOCTL_H */