ReactOS  0.4.14-dev-317-g96040ec
ntddcdrm.h
Go to the documentation of this file.
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_
24 #define _NTDDCDRM_
25 
26 #include "ntddstor.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 #define IOCTL_CDROM_BASE FILE_DEVICE_CD_ROM
33 
34 #define IOCTL_CDROM_CHECK_VERIFY \
35  CTL_CODE(IOCTL_CDROM_BASE, 0x0200, METHOD_BUFFERED, FILE_READ_ACCESS)
36 
37 #define IOCTL_CDROM_FIND_NEW_DEVICES \
38  CTL_CODE(IOCTL_CDROM_BASE, 0x0206, METHOD_BUFFERED, FILE_READ_ACCESS)
39 
40 #define IOCTL_CDROM_GET_CONFIGURATION \
41  CTL_CODE(IOCTL_CDROM_BASE, 0x0016, METHOD_BUFFERED, FILE_READ_ACCESS)
42 
43 #define IOCTL_CDROM_GET_CONTROL \
44  CTL_CODE(IOCTL_CDROM_BASE, 0x000D, METHOD_BUFFERED, FILE_READ_ACCESS)
45 
46 #define IOCTL_CDROM_GET_DRIVE_GEOMETRY \
47  CTL_CODE(IOCTL_CDROM_BASE, 0x0013, METHOD_BUFFERED, FILE_READ_ACCESS)
48 
49 #define IOCTL_CDROM_GET_DRIVE_GEOMETRY_EX \
50  CTL_CODE(IOCTL_CDROM_BASE, 0x0014, METHOD_BUFFERED, FILE_READ_ACCESS)
51 
52 #define IOCTL_CDROM_GET_LAST_SESSION \
53  CTL_CODE(IOCTL_CDROM_BASE, 0x000E, METHOD_BUFFERED, FILE_READ_ACCESS)
54 
55 #define IOCTL_CDROM_GET_VOLUME \
56  CTL_CODE(IOCTL_CDROM_BASE, 0x0005, METHOD_BUFFERED, FILE_READ_ACCESS)
57 
58 #define IOCTL_CDROM_PAUSE_AUDIO \
59  CTL_CODE(IOCTL_CDROM_BASE, 0x0003, METHOD_BUFFERED, FILE_READ_ACCESS)
60 
61 #define IOCTL_CDROM_PLAY_AUDIO_MSF \
62  CTL_CODE(IOCTL_CDROM_BASE, 0x0006, METHOD_BUFFERED, FILE_READ_ACCESS)
63 
64 #define IOCTL_CDROM_RAW_READ \
65  CTL_CODE(IOCTL_CDROM_BASE, 0x000F, METHOD_OUT_DIRECT, FILE_READ_ACCESS)
66 
67 #define IOCTL_CDROM_DISK_TYPE \
68  CTL_CODE(IOCTL_CDROM_BASE, 0x0010, METHOD_BUFFERED, FILE_ANY_ACCESS)
69 
70 #define IOCTL_CDROM_READ_Q_CHANNEL \
71  CTL_CODE(IOCTL_CDROM_BASE, 0x000B, METHOD_BUFFERED, FILE_READ_ACCESS)
72 
73 #define IOCTL_CDROM_READ_TOC \
74  CTL_CODE(IOCTL_CDROM_BASE, 0x0000, METHOD_BUFFERED, FILE_READ_ACCESS)
75 
76 #define IOCTL_CDROM_READ_TOC_EX \
77  CTL_CODE(IOCTL_CDROM_BASE, 0x0015, METHOD_BUFFERED, FILE_READ_ACCESS)
78 
79 #define IOCTL_CDROM_RESUME_AUDIO \
80  CTL_CODE(IOCTL_CDROM_BASE, 0x0004, METHOD_BUFFERED, FILE_READ_ACCESS)
81 
82 #define IOCTL_CDROM_SEEK_AUDIO_MSF \
83  CTL_CODE(IOCTL_CDROM_BASE, 0x0001, METHOD_BUFFERED, FILE_READ_ACCESS)
84 
85 #define IOCTL_CDROM_SET_VOLUME \
86  CTL_CODE(IOCTL_CDROM_BASE, 0x000A, METHOD_BUFFERED, FILE_READ_ACCESS)
87 
88 #define IOCTL_CDROM_SIMBAD \
89  CTL_CODE(IOCTL_CDROM_BASE, 0x1003, METHOD_BUFFERED, FILE_READ_ACCESS)
90 
91 #define IOCTL_CDROM_STOP_AUDIO \
92  CTL_CODE(IOCTL_CDROM_BASE, 0x0002, METHOD_BUFFERED, FILE_READ_ACCESS)
93 
94 #define IOCTL_CDROM_EJECT_MEDIA \
95  CTL_CODE(IOCTL_CDROM_BASE, 0x0202, METHOD_BUFFERED, FILE_READ_ACCESS)
96 
97 
98 #define MAXIMUM_NUMBER_TRACKS 100
99 #define MAXIMUM_CDROM_SIZE 804
100 #define MINIMUM_CDROM_READ_TOC_EX_SIZE 2
101 
102 typedef struct _TRACK_DATA {
105  UCHAR Adr : 4;
110 
111 /* CDROM_DISK_DATA.DiskData flags */
112 #define CDROM_DISK_AUDIO_TRACK 0x00000001
113 #define CDROM_DISK_DATA_TRACK 0x00000002
114 
115 typedef struct _CDROM_DISK_DATA {
118 
119 typedef struct _CDROM_PLAY_AUDIO_MSF {
127 
128 /* CDROM_READ_TOC_EX.Format constants */
129 #define CDROM_READ_TOC_EX_FORMAT_TOC 0x00
130 #define CDROM_READ_TOC_EX_FORMAT_SESSION 0x01
131 #define CDROM_READ_TOC_EX_FORMAT_FULL_TOC 0x02
132 #define CDROM_READ_TOC_EX_FORMAT_PMA 0x03
133 #define CDROM_READ_TOC_EX_FORMAT_ATIP 0x04
134 #define CDROM_READ_TOC_EX_FORMAT_CDTEXT 0x05
135 
136 typedef struct _CDROM_READ_TOC_EX {
139  UCHAR Msf : 1;
144 
145 typedef struct _CDROM_SEEK_AUDIO_MSF {
150 
151 /* CDROM_SUB_Q_DATA_FORMAT.Format constants */
152 #define IOCTL_CDROM_SUB_Q_CHANNEL 0x00
153 #define IOCTL_CDROM_CURRENT_POSITION 0x01
154 #define IOCTL_CDROM_MEDIA_CATALOG 0x02
155 #define IOCTL_CDROM_TRACK_ISRC 0x03
156 
157 typedef struct _CDROM_SUB_Q_DATA_FORMAT {
161 
162 typedef struct _CDROM_TOC {
168 
169 #define CDROM_TOC_SIZE sizeof(CDROM_TOC)
170 
171 typedef struct _CDROM_TOC_SESSION_DATA {
177 
204 
205 typedef struct _CDROM_TOC_ATIP_DATA {
211 
212 /* CDROM_TOC_CD_TEXT_DATA_BLOCK.PackType constants */
213 #define CDROM_CD_TEXT_PACK_ALBUM_NAME 0x80
214 #define CDROM_CD_TEXT_PACK_PERFORMER 0x81
215 #define CDROM_CD_TEXT_PACK_SONGWRITER 0x82
216 #define CDROM_CD_TEXT_PACK_COMPOSER 0x83
217 #define CDROM_CD_TEXT_PACK_ARRANGER 0x84
218 #define CDROM_CD_TEXT_PACK_MESSAGES 0x85
219 #define CDROM_CD_TEXT_PACK_DISC_ID 0x86
220 #define CDROM_CD_TEXT_PACK_GENRE 0x87
221 #define CDROM_CD_TEXT_PACK_TOC_INFO 0x88
222 #define CDROM_CD_TEXT_PACK_TOC_INFO2 0x89
223 #define CDROM_CD_TEXT_PACK_UPC_EAN 0x8e
224 #define CDROM_CD_TEXT_PACK_SIZE_INFO 0x8f
225 
234  _ANONYMOUS_UNION union {
235  UCHAR Text[12];
237  } DUMMYUNIONNAME;
238  UCHAR CRC[2];
240 
241 typedef struct _CDROM_TOC_CD_TEXT_DATA {
247 
248 /* CDROM_TOC_FULL_TOC_DATA_BLOCK.Adr constants */
249 #define ADR_NO_MODE_INFORMATION 0x0
250 #define ADR_ENCODES_CURRENT_POSITION 0x1
251 #define ADR_ENCODES_MEDIA_CATALOG 0x2
252 #define ADR_ENCODES_ISRC 0x3
253 
257  UCHAR Adr : 4;
262  UCHAR Msf[3];
264 
265 typedef struct _CDROM_TOC_FULL_TOC_DATA {
271 
272 typedef struct _CDROM_TOC_PMA_DATA {
278 
279 /* SUB_Q_HEADER.AudioStatus constants */
280 #define AUDIO_STATUS_NOT_SUPPORTED 0x00
281 #define AUDIO_STATUS_IN_PROGRESS 0x11
282 #define AUDIO_STATUS_PAUSED 0x12
283 #define AUDIO_STATUS_PLAY_COMPLETE 0x13
284 #define AUDIO_STATUS_PLAY_ERROR 0x14
285 #define AUDIO_STATUS_NO_STATUS 0x15
286 
287 typedef struct _SUB_Q_HEADER {
292 
301 
302 typedef struct _SUB_Q_TRACK_ISRC {
312 
313 typedef struct _SUB_Q_CURRENT_POSITION {
317  UCHAR ADR : 4;
323 
324 typedef union _SUB_Q_CHANNEL_DATA {
329 
330 /* CDROM_AUDIO_CONTROL.LbaFormat constants */
331 #define AUDIO_WITH_PREEMPHASIS 0x1
332 #define DIGITAL_COPY_PERMITTED 0x2
333 #define AUDIO_DATA_TRACK 0x4
334 #define TWO_FOUR_CHANNEL_AUDIO 0x8
335 
336 typedef struct _CDROM_AUDIO_CONTROL {
340 
341 typedef struct _VOLUME_CONTROL {
344 
345 typedef enum _TRACK_MODE_TYPE {
350 
351 typedef struct __RAW_READ_INFO {
356 
357 #ifdef __cplusplus
358 }
359 #endif
360 
361 #endif /* _NTDDCDRM_ */
enum _TRACK_MODE_TYPE * PTRACK_MODE_TYPE
UCHAR FirstTrack
Definition: ntddcdrm.h:164
SUB_Q_HEADER Header
Definition: ntddcdrm.h:314
#define _ANONYMOUS_UNION
Definition: ntbasedef.h:30
struct _TRACK_DATA * PTRACK_DATA
struct _CDROM_PLAY_AUDIO_MSF * PCDROM_PLAY_AUDIO_MSF
struct _CDROM_TOC_FULL_TOC_DATA * PCDROM_TOC_FULL_TOC_DATA
struct _TRACK_DATA TRACK_DATA
ULONG SectorCount
Definition: ntddcdrm.h:353
UCHAR Address[4]
Definition: ntddcdrm.h:108
struct _CDROM_SEEK_AUDIO_MSF CDROM_SEEK_AUDIO_MSF
UCHAR Reserved
Definition: ntddcdrm.h:103
struct __RAW_READ_INFO * PRAW_READ_INFO
struct _CDROM_READ_TOC_EX * PCDROM_READ_TOC_EX
struct _CDROM_TOC_SESSION_DATA * PCDROM_TOC_SESSION_DATA
struct _CDROM_TOC_ATIP_DATA_BLOCK * PCDROM_TOC_ATIP_DATA_BLOCK
TRACK_DATA TrackData[1]
Definition: ntddcdrm.h:175
enum _TRACK_MODE_TYPE TRACK_MODE_TYPE
struct _CDROM_TOC * PCDROM_TOC
struct _SUB_Q_CURRENT_POSITION SUB_Q_CURRENT_POSITION
struct __RAW_READ_INFO RAW_READ_INFO
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
CDROM_TOC_FULL_TOC_DATA_BLOCK Descriptors[0]
Definition: ntddcdrm.h:276
struct _SUB_Q_HEADER SUB_Q_HEADER
UCHAR DataLength[2]
Definition: ntddcdrm.h:290
struct _CDROM_TOC_CD_TEXT_DATA * PCDROM_TOC_CD_TEXT_DATA
struct _SUB_Q_TRACK_ISRC * PSUB_Q_TRACK_ISRC
TRACK_MODE_TYPE TrackMode
Definition: ntddcdrm.h:354
__wchar_t WCHAR
Definition: xmlstorage.h:180
_TRACK_MODE_TYPE
Definition: ntddcdrm.h:345
_ANONYMOUS_UNION union _CDROM_TOC_CD_TEXT_DATA_BLOCK::@3046 DUMMYUNIONNAME
struct _CDROM_TOC_PMA_DATA CDROM_TOC_PMA_DATA
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
struct _SUB_Q_TRACK_ISRC SUB_Q_TRACK_ISRC
struct _CDROM_TOC_CD_TEXT_DATA CDROM_TOC_CD_TEXT_DATA
struct _CDROM_DISK_DATA * PCDROM_DISK_DATA
UCHAR LastTrack
Definition: ntddcdrm.h:165
unsigned char UCHAR
Definition: xmlstorage.h:181
CDROM_TOC_ATIP_DATA_BLOCK Descriptors[0]
Definition: ntddcdrm.h:209
struct _CDROM_SEEK_AUDIO_MSF * PCDROM_SEEK_AUDIO_MSF
Definition: ntddcdrm.h:348
UCHAR Control
Definition: ntddcdrm.h:104
CDROM_TOC_FULL_TOC_DATA_BLOCK Descriptors[0]
Definition: ntddcdrm.h:269
struct _CDROM_TOC_ATIP_DATA CDROM_TOC_ATIP_DATA
struct _CDROM_TOC_ATIP_DATA_BLOCK CDROM_TOC_ATIP_DATA_BLOCK
union _SUB_Q_CHANNEL_DATA SUB_Q_CHANNEL_DATA
UCHAR AbsoluteAddress[4]
Definition: ntddcdrm.h:320
UCHAR PortVolume[4]
Definition: ntddcdrm.h:342
SUB_Q_TRACK_ISRC TrackIsrc
Definition: ntddcdrm.h:327
UCHAR TrackIsrc[15]
Definition: ntddcdrm.h:310
struct _CDROM_DISK_DATA CDROM_DISK_DATA
struct _CDROM_TOC_CD_TEXT_DATA_BLOCK CDROM_TOC_CD_TEXT_DATA_BLOCK
SUB_Q_HEADER Header
Definition: ntddcdrm.h:303
struct _CDROM_TOC CDROM_TOC
UCHAR AudioStatus
Definition: ntddcdrm.h:289
SUB_Q_CURRENT_POSITION CurrentPosition
Definition: ntddcdrm.h:325
struct _CDROM_SUB_Q_DATA_FORMAT CDROM_SUB_Q_DATA_FORMAT
unsigned short USHORT
Definition: pedump.c:61
UCHAR TrackNumber
Definition: ntddcdrm.h:106
struct _CDROM_AUDIO_CONTROL CDROM_AUDIO_CONTROL
struct _VOLUME_CONTROL * PVOLUME_CONTROL
struct _CDROM_TOC_FULL_TOC_DATA_BLOCK CDROM_TOC_FULL_TOC_DATA_BLOCK
struct _CDROM_TOC_SESSION_DATA CDROM_TOC_SESSION_DATA
struct _CDROM_PLAY_AUDIO_MSF CDROM_PLAY_AUDIO_MSF
struct _CDROM_AUDIO_CONTROL * PCDROM_AUDIO_CONTROL
struct _CDROM_TOC_ATIP_DATA * PCDROM_TOC_ATIP_DATA
UCHAR Reserved
Definition: ntddcdrm.h:288
SUB_Q_MEDIA_CATALOG_NUMBER MediaCatalog
Definition: ntddcdrm.h:326
UCHAR TrackRelativeAddress[4]
Definition: ntddcdrm.h:321
union _SUB_Q_CHANNEL_DATA * PSUB_Q_CHANNEL_DATA
struct _CDROM_SUB_Q_DATA_FORMAT * PCDROM_SUB_Q_DATA_FORMAT
CDROM_TOC_CD_TEXT_DATA_BLOCK Descriptors[0]
Definition: ntddcdrm.h:245
#define MAXIMUM_NUMBER_TRACKS
Definition: ntddcdrm.h:98
TRACK_DATA TrackData[MAXIMUM_NUMBER_TRACKS]
Definition: ntddcdrm.h:166
unsigned int ULONG
Definition: retypes.h:1
struct _CDROM_TOC_FULL_TOC_DATA CDROM_TOC_FULL_TOC_DATA
struct _CDROM_READ_TOC_EX CDROM_READ_TOC_EX
LARGE_INTEGER DiskOffset
Definition: ntddcdrm.h:352
struct _SUB_Q_CURRENT_POSITION * PSUB_Q_CURRENT_POSITION
struct _SUB_Q_MEDIA_CATALOG_NUMBER * PSUB_Q_MEDIA_CATALOG_NUMBER
struct _CDROM_TOC_CD_TEXT_DATA_BLOCK * PCDROM_TOC_CD_TEXT_DATA_BLOCK
struct _SUB_Q_HEADER * PSUB_Q_HEADER
struct _CDROM_TOC_PMA_DATA * PCDROM_TOC_PMA_DATA
struct _SUB_Q_MEDIA_CATALOG_NUMBER SUB_Q_MEDIA_CATALOG_NUMBER
struct _VOLUME_CONTROL VOLUME_CONTROL
struct _CDROM_TOC_FULL_TOC_DATA_BLOCK * PCDROM_TOC_FULL_TOC_DATA_BLOCK
UCHAR Reserved1
Definition: ntddcdrm.h:107
UCHAR Adr
Definition: ntddcdrm.h:105
USHORT LogicalBlocksPerSecond
Definition: ntddcdrm.h:338