source: Daodan/MinGW/include/ddk/ntddcdrm.h@ 1106

Last change on this file since 1106 was 1046, checked in by alloc, 8 years ago

Daodan: Added Windows MinGW and build batch file

File size: 9.5 KB
RevLine 
[1046]1/*
2 * ntddcdrm.h
3 *
4 * CDROM IOCTL interface.
5 *
6 * This file is part of the w32api package.
7 *
8 * Contributors:
9 * Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
10 *
11 * THIS SOFTWARE IS NOT COPYRIGHTED
12 *
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
15 *
16 * This code is distributed in the hope that it will be useful but
17 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18 * DISCLAIMED. This includes but is not limited to warranties of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 *
21 */
22
23#ifndef __NTDDCDRM_H
24#define __NTDDCDRM_H
25
26#if __GNUC__ >=3
27#pragma GCC system_header
28#endif
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34#include "ntddk.h"
35#include "ntddstor.h"
36
37#define IOCTL_CDROM_BASE FILE_DEVICE_CD_ROM
38
39#define IOCTL_CDROM_CHECK_VERIFY \
40 CTL_CODE(IOCTL_CDROM_BASE, 0x0200, METHOD_BUFFERED, FILE_READ_ACCESS)
41
42#define IOCTL_CDROM_FIND_NEW_DEVICES \
43 CTL_CODE(IOCTL_CDROM_BASE, 0x0206, METHOD_BUFFERED, FILE_READ_ACCESS)
44
45#define IOCTL_CDROM_GET_CONTROL \
46 CTL_CODE(IOCTL_CDROM_BASE, 0x000D, METHOD_BUFFERED, FILE_READ_ACCESS)
47
48#define IOCTL_CDROM_GET_DRIVE_GEOMETRY \
49 CTL_CODE(IOCTL_CDROM_BASE, 0x0013, METHOD_BUFFERED, FILE_READ_ACCESS)
50
51#define IOCTL_CDROM_GET_LAST_SESSION \
52 CTL_CODE(IOCTL_CDROM_BASE, 0x000E, METHOD_BUFFERED, FILE_READ_ACCESS)
53
54#define IOCTL_CDROM_GET_VOLUME \
55 CTL_CODE(IOCTL_CDROM_BASE, 0x0005, METHOD_BUFFERED, FILE_READ_ACCESS)
56
57#define IOCTL_CDROM_PAUSE_AUDIO \
58 CTL_CODE(IOCTL_CDROM_BASE, 0x0003, METHOD_BUFFERED, FILE_READ_ACCESS)
59
60#define IOCTL_CDROM_PLAY_AUDIO_MSF \
61 CTL_CODE(IOCTL_CDROM_BASE, 0x0006, METHOD_BUFFERED, FILE_READ_ACCESS)
62
63#define IOCTL_CDROM_RAW_READ \
64 CTL_CODE(IOCTL_CDROM_BASE, 0x000F, METHOD_OUT_DIRECT, FILE_READ_ACCESS)
65
66#define IOCTL_CDROM_READ_Q_CHANNEL \
67 CTL_CODE(IOCTL_CDROM_BASE, 0x000B, METHOD_BUFFERED, FILE_READ_ACCESS)
68
69#define IOCTL_CDROM_READ_TOC \
70 CTL_CODE(IOCTL_CDROM_BASE, 0x0000, METHOD_BUFFERED, FILE_READ_ACCESS)
71
72#define IOCTL_CDROM_READ_TOC_EX \
73 CTL_CODE(IOCTL_CDROM_BASE, 0x0015, METHOD_BUFFERED, FILE_READ_ACCESS)
74
75#define IOCTL_CDROM_RESUME_AUDIO \
76 CTL_CODE(IOCTL_CDROM_BASE, 0x0004, METHOD_BUFFERED, FILE_READ_ACCESS)
77
78#define IOCTL_CDROM_SEEK_AUDIO_MSF \
79 CTL_CODE(IOCTL_CDROM_BASE, 0x0001, METHOD_BUFFERED, FILE_READ_ACCESS)
80
81#define IOCTL_CDROM_SET_VOLUME \
82 CTL_CODE(IOCTL_CDROM_BASE, 0x000A, METHOD_BUFFERED, FILE_READ_ACCESS)
83
84#define IOCTL_CDROM_SIMBAD \
85 CTL_CODE(IOCTL_CDROM_BASE, 0x1003, METHOD_BUFFERED, FILE_READ_ACCESS)
86
87#define IOCTL_CDROM_STOP_AUDIO \
88 CTL_CODE(IOCTL_CDROM_BASE, 0x0002, METHOD_BUFFERED, FILE_READ_ACCESS)
89
90
91#define MAXIMUM_NUMBER_TRACKS 100
92#define MAXIMUM_CDROM_SIZE 804
93#define MINIMUM_CDROM_READ_TOC_EX_SIZE 2
94
95typedef struct _TRACK_DATA {
96 UCHAR Reserved;
97 UCHAR Control : 4;
98 UCHAR Adr : 4;
99 UCHAR TrackNumber;
100 UCHAR Reserved1;
101 UCHAR Address[4];
102} TRACK_DATA, *PTRACK_DATA;
103
104/* CDROM_DISK_DATA.DiskData flags */
105#define CDROM_DISK_AUDIO_TRACK 0x00000001
106#define CDROM_DISK_DATA_TRACK 0x00000002
107
108typedef struct _CDROM_DISK_DATA {
109 ULONG DiskData;
110} CDROM_DISK_DATA, *PCDROM_DISK_DATA;
111
112typedef struct _CDROM_PLAY_AUDIO_MSF {
113 UCHAR StartingM;
114 UCHAR StartingS;
115 UCHAR StartingF;
116 UCHAR EndingM;
117 UCHAR EndingS;
118 UCHAR EndingF;
119} CDROM_PLAY_AUDIO_MSF, *PCDROM_PLAY_AUDIO_MSF;
120
121/* CDROM_READ_TOC_EX.Format constants */
122#define CDROM_READ_TOC_EX_FORMAT_TOC 0x00
123#define CDROM_READ_TOC_EX_FORMAT_SESSION 0x01
124#define CDROM_READ_TOC_EX_FORMAT_FULL_TOC 0x02
125#define CDROM_READ_TOC_EX_FORMAT_PMA 0x03
126#define CDROM_READ_TOC_EX_FORMAT_ATIP 0x04
127#define CDROM_READ_TOC_EX_FORMAT_CDTEXT 0x05
128
129typedef struct _CDROM_READ_TOC_EX {
130 UCHAR Format : 4;
131 UCHAR Reserved1 : 3;
132 UCHAR Msf : 1;
133 UCHAR SessionTrack;
134 UCHAR Reserved2;
135 UCHAR Reserved3;
136} CDROM_READ_TOC_EX, *PCDROM_READ_TOC_EX;
137
138typedef struct _CDROM_SEEK_AUDIO_MSF {
139 UCHAR M;
140 UCHAR S;
141 UCHAR F;
142} CDROM_SEEK_AUDIO_MSF, *PCDROM_SEEK_AUDIO_MSF;
143
144/* CDROM_SUB_Q_DATA_FORMAT.Format constants */
145#define IOCTL_CDROM_SUB_Q_CHANNEL 0x00
146#define IOCTL_CDROM_CURRENT_POSITION 0x01
147#define IOCTL_CDROM_MEDIA_CATALOG 0x02
148#define IOCTL_CDROM_TRACK_ISRC 0x03
149
150typedef struct _CDROM_SUB_Q_DATA_FORMAT {
151 UCHAR Format;
152 UCHAR Track;
153} CDROM_SUB_Q_DATA_FORMAT, *PCDROM_SUB_Q_DATA_FORMAT;
154
155typedef struct _CDROM_TOC {
156 UCHAR Length[2];
157 UCHAR FirstTrack;
158 UCHAR LastTrack;
159 TRACK_DATA TrackData[MAXIMUM_NUMBER_TRACKS];
160} CDROM_TOC, *PCDROM_TOC;
161
162#define CDROM_TOC_SIZE sizeof(CDROM_TOC)
163
164typedef struct _CDROM_TOC_ATIP_DATA_BLOCK {
165 UCHAR CdrwReferenceSpeed : 3;
166 UCHAR Reserved3 : 1;
167 UCHAR WritePower : 3;
168 UCHAR True1 : 1;
169 UCHAR Reserved4 : 6;
170 UCHAR UnrestrictedUse : 1;
171 UCHAR Reserved5 : 1;
172 UCHAR A3Valid : 1;
173 UCHAR A2Valid : 1;
174 UCHAR A1Valid : 1;
175 UCHAR Reserved6 : 3;
176 UCHAR IsCdrw : 1;
177 UCHAR True2 : 1;
178 UCHAR Reserved7;
179 UCHAR LeadInMsf[3];
180 UCHAR Reserved8;
181 UCHAR LeadOutMsf[3];
182 UCHAR Reserved9;
183 UCHAR A1Values[3];
184 UCHAR Reserved10;
185 UCHAR A2Values[3];
186 UCHAR Reserved11;
187 UCHAR A3Values[3];
188 UCHAR Reserved12;
189} CDROM_TOC_ATIP_DATA_BLOCK, *PCDROM_TOC_ATIP_DATA_BLOCK;
190
191typedef struct _CDROM_TOC_ATIP_DATA {
192 UCHAR Length[2];
193 UCHAR Reserved1;
194 UCHAR Reserved2;
195 CDROM_TOC_ATIP_DATA_BLOCK Descriptors[0];
196} CDROM_TOC_ATIP_DATA, *PCDROM_TOC_ATIP_DATA;
197
198/* CDROM_TOC_CD_TEXT_DATA_BLOCK.PackType constants */
199#define CDROM_CD_TEXT_PACK_ALBUM_NAME 0x80
200#define CDROM_CD_TEXT_PACK_PERFORMER 0x81
201#define CDROM_CD_TEXT_PACK_SONGWRITER 0x82
202#define CDROM_CD_TEXT_PACK_COMPOSER 0x83
203#define CDROM_CD_TEXT_PACK_ARRANGER 0x84
204#define CDROM_CD_TEXT_PACK_MESSAGES 0x85
205#define CDROM_CD_TEXT_PACK_DISC_ID 0x86
206#define CDROM_CD_TEXT_PACK_GENRE 0x87
207#define CDROM_CD_TEXT_PACK_TOC_INFO 0x88
208#define CDROM_CD_TEXT_PACK_TOC_INFO2 0x89
209#define CDROM_CD_TEXT_PACK_UPC_EAN 0x8e
210#define CDROM_CD_TEXT_PACK_SIZE_INFO 0x8f
211
212typedef struct _CDROM_TOC_CD_TEXT_DATA_BLOCK {
213 UCHAR PackType;
214 UCHAR TrackNumber : 7;
215 UCHAR ExtensionFlag : 1;
216 UCHAR SequenceNumber;
217 UCHAR CharacterPosition : 4;
218 UCHAR BlockNumber : 3;
219 UCHAR Unicode : 1;
220 _ANONYMOUS_UNION union {
221 UCHAR Text[12];
222 WCHAR WText[6];
223 } DUMMYUNIONNAME;
224 UCHAR CRC[2];
225} CDROM_TOC_CD_TEXT_DATA_BLOCK, *PCDROM_TOC_CD_TEXT_DATA_BLOCK;
226
227typedef struct _CDROM_TOC_CD_TEXT_DATA {
228 UCHAR Length[2];
229 UCHAR Reserved1;
230 UCHAR Reserved2;
231 CDROM_TOC_CD_TEXT_DATA_BLOCK Descriptors[0];
232} CDROM_TOC_CD_TEXT_DATA, *PCDROM_TOC_CD_TEXT_DATA;
233
234/* CDROM_TOC_FULL_TOC_DATA_BLOCK.Adr constants */
235#define ADR_NO_MODE_INFORMATION 0x0
236#define ADR_ENCODES_CURRENT_POSITION 0x1
237#define ADR_ENCODES_MEDIA_CATALOG 0x2
238#define ADR_ENCODES_ISRC 0x3
239
240typedef struct _CDROM_TOC_FULL_TOC_DATA_BLOCK {
241 UCHAR SessionNumber;
242 UCHAR Control : 4;
243 UCHAR Adr : 4;
244 UCHAR Reserved1;
245 UCHAR Point;
246 UCHAR MsfExtra[3];
247 UCHAR Zero;
248 UCHAR Msf[3];
249} CDROM_TOC_FULL_TOC_DATA_BLOCK, *PCDROM_TOC_FULL_TOC_DATA_BLOCK;
250
251typedef struct _CDROM_TOC_FULL_TOC_DATA {
252 UCHAR Length[2];
253 UCHAR FirstCompleteSession;
254 UCHAR LastCompleteSession;
255 CDROM_TOC_FULL_TOC_DATA_BLOCK Descriptors[0];
256} CDROM_TOC_FULL_TOC_DATA, *PCDROM_TOC_FULL_TOC_DATA;
257
258typedef struct _CDROM_TOC_PMA_DATA {
259 UCHAR Length[2];
260 UCHAR Reserved1;
261 UCHAR Reserved2;
262 CDROM_TOC_FULL_TOC_DATA_BLOCK Descriptors[0];
263} CDROM_TOC_PMA_DATA, *PCDROM_TOC_PMA_DATA;
264
265/* SUB_Q_HEADER.AudioStatus constants */
266#define AUDIO_STATUS_NOT_SUPPORTED 0x00
267#define AUDIO_STATUS_IN_PROGRESS 0x11
268#define AUDIO_STATUS_PAUSED 0x12
269#define AUDIO_STATUS_PLAY_COMPLETE 0x13
270#define AUDIO_STATUS_PLAY_ERROR 0x14
271#define AUDIO_STATUS_NO_STATUS 0x15
272
273typedef struct _SUB_Q_HEADER {
274 UCHAR Reserved;
275 UCHAR AudioStatus;
276 UCHAR DataLength[2];
277} SUB_Q_HEADER, *PSUB_Q_HEADER;
278
279typedef struct _SUB_Q_MEDIA_CATALOG_NUMBER {
280 SUB_Q_HEADER Header;
281 UCHAR FormatCode;
282 UCHAR Reserved[3];
283 UCHAR Reserved1 : 7;
284 UCHAR Mcval :1;
285 UCHAR MediaCatalog[15];
286} SUB_Q_MEDIA_CATALOG_NUMBER, *PSUB_Q_MEDIA_CATALOG_NUMBER;
287
288typedef struct _SUB_Q_TRACK_ISRC {
289 SUB_Q_HEADER Header;
290 UCHAR FormatCode;
291 UCHAR Reserved0;
292 UCHAR Track;
293 UCHAR Reserved1;
294 UCHAR Reserved2 : 7;
295 UCHAR Tcval : 1;
296 UCHAR TrackIsrc[15];
297} SUB_Q_TRACK_ISRC, *PSUB_Q_TRACK_ISRC;
298
299typedef struct _SUB_Q_CURRENT_POSITION {
300 SUB_Q_HEADER Header;
301 UCHAR FormatCode;
302 UCHAR Control : 4;
303 UCHAR ADR : 4;
304 UCHAR TrackNumber;
305 UCHAR IndexNumber;
306 UCHAR AbsoluteAddress[4];
307 UCHAR TrackRelativeAddress[4];
308} SUB_Q_CURRENT_POSITION, *PSUB_Q_CURRENT_POSITION;
309
310typedef union _SUB_Q_CHANNEL_DATA {
311 SUB_Q_CURRENT_POSITION CurrentPosition;
312 SUB_Q_MEDIA_CATALOG_NUMBER MediaCatalog;
313 SUB_Q_TRACK_ISRC TrackIsrc;
314} SUB_Q_CHANNEL_DATA, *PSUB_Q_CHANNEL_DATA;
315
316/* CDROM_AUDIO_CONTROL.LbaFormat constants */
317#define AUDIO_WITH_PREEMPHASIS 0x1
318#define DIGITAL_COPY_PERMITTED 0x2
319#define AUDIO_DATA_TRACK 0x4
320#define TWO_FOUR_CHANNEL_AUDIO 0x8
321
322typedef struct _CDROM_AUDIO_CONTROL {
323 UCHAR LbaFormat;
324 USHORT LogicalBlocksPerSecond;
325} CDROM_AUDIO_CONTROL, *PCDROM_AUDIO_CONTROL;
326
327typedef struct _VOLUME_CONTROL {
328 UCHAR PortVolume[4];
329} VOLUME_CONTROL, *PVOLUME_CONTROL;
330
331typedef enum _TRACK_MODE_TYPE {
332 YellowMode2,
333 XAForm2,
334 CDDA
335} TRACK_MODE_TYPE, *PTRACK_MODE_TYPE;
336
337typedef struct __RAW_READ_INFO {
338 LARGE_INTEGER DiskOffset;
339 ULONG SectorCount;
340 TRACK_MODE_TYPE TrackMode;
341} RAW_READ_INFO, *PRAW_READ_INFO;
342
343#ifdef __cplusplus
344}
345#endif
346
347#endif /* __NTDDCDRM_H */
Note: See TracBrowser for help on using the repository browser.