File: win32.h

package info (click to toggle)
libcdio 2.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 16,436 kB
  • sloc: ansic: 38,842; sh: 5,501; cpp: 2,555; makefile: 777; ruby: 24; perl: 24
file content (243 lines) | stat: -rw-r--r-- 6,393 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
/*
  Copyright (C) 2004, 2005, 2008, 2014 Rocky Bernstein <rocky@gnu.org>

  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#include "cdio_private.h"

#pragma pack()

typedef struct {
  lsn_t          start_lsn;
  UCHAR          Control : 4;
  UCHAR          Format;
} track_info_t;

typedef enum {
  _AM_NONE,
  _AM_IOCTL,
  _AM_ASPI,
  _AM_MMC_RDWR,
  _AM_MMC_RDWR_EXCL,
} access_mode_t;

typedef struct {
  /* Things common to all drivers like this.
     This must be first. */
  generic_img_private_t gen;

  access_mode_t access_mode;

  /* Some of the more OS specific things. */
    /* Entry info for each track, add 1 for leadout. */
  track_info_t  tocent[CDIO_CD_MAX_TRACKS+1];

  HANDLE h_device_handle; /* device descriptor */
  HMODULE hASPI;
  short i_sid;
  short i_lun;
  long  (*lpSendCommand)( void* );

  bool b_ioctl_init;
  bool b_aspi_init;

} _img_private_t;

/*!
  Pause playing CD through analog output

  @param p_cdio the CD object to be acted upon.
*/
driver_return_code_t audio_pause_win32ioctl (void *p_user_data);

/*!
  Playing starting at given MSF through analog output

  @param p_cdio the CD object to be acted upon.
*/
driver_return_code_t audio_play_msf_win32ioctl (void *p_user_data,
						msf_t *p_start_msf,
						msf_t *p_end_msf);
/*!
  Resume playing an audio CD.

  @param p_cdio the CD object to be acted upon.

*/
driver_return_code_t audio_resume_win32ioctl (void *p_user_data);

/*!
  Get disc type associated with cd object.
*/
discmode_t get_discmode_win32ioctl (_img_private_t *p_env);

/*!
  Get the volume settings of an audio CD.

  @param p_cdio the CD object to be acted upon.

*/
driver_return_code_t
audio_get_volume_win32ioctl ( void *p_user_data,
			      /*out*/ cdio_audio_volume_t *p_volume);

/*!
  Read Audio Subchannel information

  @param p_cdio the CD object to be acted upon.

*/
driver_return_code_t
audio_read_subchannel_win32ioctl (void *p_user_data,
				  cdio_subchannel_t *p_subchannel);

/*!
  Set the volume of an audio CD.

  @param p_cdio the CD object to be acted upon.

*/
driver_return_code_t
audio_stop_win32ioctl ( void *p_user_data );

/*!
  Set the volume of an audio CD.

  @param p_cdio the CD object to be acted upon.

*/
driver_return_code_t
audio_set_volume_win32ioctl ( void *p_user_data,
			      cdio_audio_volume_t *p_volume);

/*!
  Close the tray of a CD-ROM

  @param p_user_data the CD object to be acted upon.

*/
driver_return_code_t close_tray_win32ioctl (const char *psz_win32_drive);

/*!
   Reads an audio device using the DeviceIoControl method into data
   starting from lsn.  Returns 0 if no error.
*/
int read_audio_sectors_win32ioctl (_img_private_t *p_obj, void *p_data, lsn_t lsn,
				   unsigned int nblocks);
/*!
   Reads a single mode2 sector using the DeviceIoControl method into
   data starting from lsn. Returns 0 if no error.
 */
int read_mode2_sector_win32ioctl (_img_private_t *p_env, void *p_data,
				  lsn_t lsn, bool b_form2);

/*!
   Reads a single mode1 sector using the DeviceIoControl method into
   data starting from lsn. Returns 0 if no error.
 */
int read_mode1_sector_win32ioctl (_img_private_t *p_env, void *p_data,
				  lsn_t lsn, bool b_form2);

const char *is_cdrom_win32ioctl (const char drive_letter);

/*!
  Run a SCSI MMC command.

  env	        private CD structure
  i_timeout_ms  time in milliseconds we will wait for the command
                to complete. If this value is -1, use the default
		time-out value.
  p_buf	        Buffer for data, both sending and receiving
  i_buf	        Size of buffer
  e_direction	direction the transfer is to go.
  cdb	        CDB bytes. All values that are needed should be set on
                input. We'll figure out what the right CDB length should be.

  Return 0 if command completed successfully.
 */
int run_mmc_cmd_win32ioctl( void *p_user_data,
			    unsigned int i_timeout,
			    unsigned int i_cdb,
			    const mmc_cdb_t * p_cdb,
			    cdio_mmc_direction_t e_direction,
			    unsigned int i_buf, /*in/out*/ void *p_buf );

/*!
  Initialize internal structures for CD device.
 */
bool init_win32ioctl (_img_private_t *p_env);

/*!
  Read and cache the CD's Track Table of Contents and track info.
  Return true if successful or false if an error.
*/
bool read_toc_win32ioctl (_img_private_t *p_env);

/*!
  Get the LSN of the first track of the last session of
  on the CD.
 */
driver_return_code_t
get_last_session_win32ioctl (void *p_user_data,
                             /*out*/ lsn_t *i_last_session);

/*!
  Return the media catalog number MCN.

  Note: string is malloc'd so caller should free() then returned
  string when done with it.

 */
char *get_mcn_win32ioctl (const _img_private_t *p_env);

/*!
  Return the international standard recording code ISRC.

  Note: string is malloc'd so caller should free() then returned
  string when done with it.

 */
char *get_track_isrc_win32ioctl (const _img_private_t *p_env,
				 track_t i_track);

/*!
  Return the the kind of drive capabilities of device.

  Note: string is malloc'd so caller should free() then returned
  string when done with it.

 */
void get_drive_cap_aspi (const _img_private_t *p_env,
			 cdio_drive_read_cap_t  *p_read_cap,
			 cdio_drive_write_cap_t *p_write_cap,
			 cdio_drive_misc_cap_t  *p_misc_cap);

/*!
  Return the the kind of drive capabilities of device.

  Note: string is malloc'd so caller should free() then returned
  string when done with it.

 */
void get_drive_cap_win32ioctl (const _img_private_t *p_env,
			       cdio_drive_read_cap_t  *p_read_cap,
			       cdio_drive_write_cap_t *p_write_cap,
			       cdio_drive_misc_cap_t  *p_misc_cap);

/*!
  Get the format (XA, DATA, AUDIO) of a track.
*/
track_format_t get_track_format_win32ioctl(const _img_private_t *p_env,
					   track_t i_track);