annotate libdvdcss/ioctl.h @ 29942:9b90e1052b32

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