2 * DDK information for CD ROM
4 * Copyright (C) 2002 Eric Pouech
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
24 #define IOCTL_CDROM_BASE FILE_DEVICE_CD_ROM
25 #define IOCTL_CDROM_UNLOAD_DRIVER CTL_CODE(IOCTL_CDROM_BASE, 0x0402, METHOD_BUFFERED, FILE_READ_ACCESS)
26 #define IOCTL_CDROM_READ_TOC CTL_CODE(IOCTL_CDROM_BASE, 0x0000, METHOD_BUFFERED, FILE_READ_ACCESS)
27 #define IOCTL_CDROM_GET_CONTROL CTL_CODE(IOCTL_CDROM_BASE, 0x000D, METHOD_BUFFERED, FILE_READ_ACCESS)
28 #define IOCTL_CDROM_PLAY_AUDIO_MSF CTL_CODE(IOCTL_CDROM_BASE, 0x0006, METHOD_BUFFERED, FILE_READ_ACCESS)
29 #define IOCTL_CDROM_SEEK_AUDIO_MSF CTL_CODE(IOCTL_CDROM_BASE, 0x0001, METHOD_BUFFERED, FILE_READ_ACCESS)
30 #define IOCTL_CDROM_STOP_AUDIO CTL_CODE(IOCTL_CDROM_BASE, 0x0002, METHOD_BUFFERED, FILE_READ_ACCESS)
31 #define IOCTL_CDROM_PAUSE_AUDIO CTL_CODE(IOCTL_CDROM_BASE, 0x0003, METHOD_BUFFERED, FILE_READ_ACCESS)
32 #define IOCTL_CDROM_RESUME_AUDIO CTL_CODE(IOCTL_CDROM_BASE, 0x0004, METHOD_BUFFERED, FILE_READ_ACCESS)
33 #define IOCTL_CDROM_GET_VOLUME CTL_CODE(IOCTL_CDROM_BASE, 0x0005, METHOD_BUFFERED, FILE_READ_ACCESS)
34 #define IOCTL_CDROM_SET_VOLUME CTL_CODE(IOCTL_CDROM_BASE, 0x000A, METHOD_BUFFERED, FILE_READ_ACCESS)
35 #define IOCTL_CDROM_READ_Q_CHANNEL CTL_CODE(IOCTL_CDROM_BASE, 0x000B, METHOD_BUFFERED, FILE_READ_ACCESS)
36 #define IOCTL_CDROM_GET_LAST_SESSION CTL_CODE(IOCTL_CDROM_BASE, 0x000E, METHOD_BUFFERED, FILE_READ_ACCESS)
37 #define IOCTL_CDROM_RAW_READ CTL_CODE(IOCTL_CDROM_BASE, 0x000F, METHOD_OUT_DIRECT, FILE_READ_ACCESS)
38 #define IOCTL_CDROM_DISK_TYPE CTL_CODE(IOCTL_CDROM_BASE, 0x0010, METHOD_BUFFERED, FILE_ANY_ACCESS)
39 #define IOCTL_CDROM_GET_DRIVE_GEOMETRY CTL_CODE(IOCTL_CDROM_BASE, 0x0013, METHOD_BUFFERED, FILE_READ_ACCESS)
41 #define IOCTL_CDROM_CHECK_VERIFY CTL_CODE(IOCTL_CDROM_BASE, 0x0200, METHOD_BUFFERED, FILE_READ_ACCESS)
42 #define IOCTL_CDROM_MEDIA_REMOVAL CTL_CODE(IOCTL_CDROM_BASE, 0x0201, METHOD_BUFFERED, FILE_READ_ACCESS)
43 #define IOCTL_CDROM_EJECT_MEDIA CTL_CODE(IOCTL_CDROM_BASE, 0x0202, METHOD_BUFFERED, FILE_READ_ACCESS)
44 #define IOCTL_CDROM_LOAD_MEDIA CTL_CODE(IOCTL_CDROM_BASE, 0x0203, METHOD_BUFFERED, FILE_READ_ACCESS)
45 #define IOCTL_CDROM_RESERVE CTL_CODE(IOCTL_CDROM_BASE, 0x0204, METHOD_BUFFERED, FILE_READ_ACCESS)
46 #define IOCTL_CDROM_RELEASE CTL_CODE(IOCTL_CDROM_BASE, 0x0205, METHOD_BUFFERED, FILE_READ_ACCESS)
47 #define IOCTL_CDROM_FIND_NEW_DEVICES CTL_CODE(IOCTL_CDROM_BASE, 0x0206, METHOD_BUFFERED, FILE_READ_ACCESS)
51 #define MAXIMUM_NUMBER_TRACKS 100
52 #define MAXIMUM_CDROM_SIZE 804
54 typedef struct _TRACK_DATA
{
61 } TRACK_DATA
, *PTRACK_DATA
;
63 typedef struct _CDROM_TOC
{
67 TRACK_DATA TrackData
[MAXIMUM_NUMBER_TRACKS
];
68 } CDROM_TOC
, *PCDROM_TOC
;
70 #define CDROM_TOC_SIZE sizeof(CDROM_TOC)
72 typedef struct _CDROM_PLAY_AUDIO_MSF
{
79 } CDROM_PLAY_AUDIO_MSF
, *PCDROM_PLAY_AUDIO_MSF
;
81 typedef struct _CDROM_SEEK_AUDIO_MSF
{
85 } CDROM_SEEK_AUDIO_MSF
, *PCDROM_SEEK_AUDIO_MSF
;
87 typedef struct _CDROM_DISK_DATA
{
89 } CDROM_DISK_DATA
, *PCDROM_DISK_DATA
;
91 #define CDROM_DISK_AUDIO_TRACK (0x00000001)
92 #define CDROM_DISK_DATA_TRACK (0x00000002)
94 #define IOCTL_CDROM_SUB_Q_CHANNEL 0x00
95 #define IOCTL_CDROM_CURRENT_POSITION 0x01
96 #define IOCTL_CDROM_MEDIA_CATALOG 0x02
97 #define IOCTL_CDROM_TRACK_ISRC 0x03
99 typedef struct _CDROM_SUB_Q_DATA_FORMAT
{
102 } CDROM_SUB_Q_DATA_FORMAT
, *PCDROM_SUB_Q_DATA_FORMAT
;
104 typedef struct _SUB_Q_HEADER
{
108 } SUB_Q_HEADER
, *PSUB_Q_HEADER
;
110 typedef struct _SUB_Q_CURRENT_POSITION
{
117 UCHAR AbsoluteAddress
[4];
118 UCHAR TrackRelativeAddress
[4];
119 } SUB_Q_CURRENT_POSITION
, *PSUB_Q_CURRENT_POSITION
;
121 typedef struct _SUB_Q_MEDIA_CATALOG_NUMBER
{
127 UCHAR MediaCatalog
[15];
128 } SUB_Q_MEDIA_CATALOG_NUMBER
, *PSUB_Q_MEDIA_CATALOG_NUMBER
;
130 typedef struct _SUB_Q_TRACK_ISRC
{
139 } SUB_Q_TRACK_ISRC
, *PSUB_Q_TRACK_ISRC
;
141 typedef union _SUB_Q_CHANNEL_DATA
{
142 SUB_Q_CURRENT_POSITION CurrentPosition
;
143 SUB_Q_MEDIA_CATALOG_NUMBER MediaCatalog
;
144 SUB_Q_TRACK_ISRC TrackIsrc
;
145 } SUB_Q_CHANNEL_DATA
, *PSUB_Q_CHANNEL_DATA
;
147 #define AUDIO_STATUS_NOT_SUPPORTED 0x00
148 #define AUDIO_STATUS_IN_PROGRESS 0x11
149 #define AUDIO_STATUS_PAUSED 0x12
150 #define AUDIO_STATUS_PLAY_COMPLETE 0x13
151 #define AUDIO_STATUS_PLAY_ERROR 0x14
152 #define AUDIO_STATUS_NO_STATUS 0x15
154 #define ADR_NO_MODE_INFORMATION 0x0
155 #define ADR_ENCODES_CURRENT_POSITION 0x1
156 #define ADR_ENCODES_MEDIA_CATALOG 0x2
157 #define ADR_ENCODES_ISRC 0x3
159 #define AUDIO_WITH_PREEMPHASIS 0x0
160 #define DIGITAL_COPY_PERMITTED 0x2
161 #define AUDIO_DATA_TRACK 0x4
162 #define TWO_FOUR_CHANNEL_AUDIO 0x8
164 typedef struct _CDROM_AUDIO_CONTROL
{
166 USHORT LogicalBlocksPerSecond
;
167 } CDROM_AUDIO_CONTROL
, *PCDROM_AUDIO_CONTROL
;
169 typedef struct _VOLUME_CONTROL
{
171 } VOLUME_CONTROL
, *PVOLUME_CONTROL
;
173 typedef enum _TRACK_MODE_TYPE
{
177 } TRACK_MODE_TYPE
, *PTRACK_MODE_TYPE
;
179 typedef struct __RAW_READ_INFO
{
180 LARGE_INTEGER DiskOffset
;
182 TRACK_MODE_TYPE TrackMode
;
183 } RAW_READ_INFO
, *PRAW_READ_INFO
;
185 #endif /* __NTDDCDRM_H */