1 | /*
|
---|
2 | * DDK information for CD ROM
|
---|
3 | *
|
---|
4 | * Copyright (C) 2002 Eric Pouech
|
---|
5 | *
|
---|
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.
|
---|
10 | *
|
---|
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.
|
---|
15 | *
|
---|
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
|
---|
19 | */
|
---|
20 |
|
---|
21 | /*
|
---|
22 | * Sun LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
|
---|
23 | * other than GPL or LGPL is available it will apply instead, Sun elects to use only
|
---|
24 | * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
|
---|
25 | * a choice of LGPL license versions is made available with the language indicating
|
---|
26 | * that LGPLv2 or any later version may be used, or where a choice of which version
|
---|
27 | * of the LGPL is applied is otherwise unspecified.
|
---|
28 | */
|
---|
29 |
|
---|
30 | #ifndef __NTDDCDRM_H
|
---|
31 | #define __NTDDCDRM_H
|
---|
32 |
|
---|
33 | #define IOCTL_CDROM_BASE FILE_DEVICE_CD_ROM
|
---|
34 | #define IOCTL_CDROM_UNLOAD_DRIVER CTL_CODE(IOCTL_CDROM_BASE, 0x0402, METHOD_BUFFERED, FILE_READ_ACCESS)
|
---|
35 | #define IOCTL_CDROM_READ_TOC CTL_CODE(IOCTL_CDROM_BASE, 0x0000, METHOD_BUFFERED, FILE_READ_ACCESS)
|
---|
36 | #define IOCTL_CDROM_GET_CONTROL CTL_CODE(IOCTL_CDROM_BASE, 0x000D, METHOD_BUFFERED, FILE_READ_ACCESS)
|
---|
37 | #define IOCTL_CDROM_PLAY_AUDIO_MSF CTL_CODE(IOCTL_CDROM_BASE, 0x0006, METHOD_BUFFERED, FILE_READ_ACCESS)
|
---|
38 | #define IOCTL_CDROM_SEEK_AUDIO_MSF CTL_CODE(IOCTL_CDROM_BASE, 0x0001, METHOD_BUFFERED, FILE_READ_ACCESS)
|
---|
39 | #define IOCTL_CDROM_STOP_AUDIO CTL_CODE(IOCTL_CDROM_BASE, 0x0002, METHOD_BUFFERED, FILE_READ_ACCESS)
|
---|
40 | #define IOCTL_CDROM_PAUSE_AUDIO CTL_CODE(IOCTL_CDROM_BASE, 0x0003, METHOD_BUFFERED, FILE_READ_ACCESS)
|
---|
41 | #define IOCTL_CDROM_RESUME_AUDIO CTL_CODE(IOCTL_CDROM_BASE, 0x0004, METHOD_BUFFERED, FILE_READ_ACCESS)
|
---|
42 | #define IOCTL_CDROM_GET_VOLUME CTL_CODE(IOCTL_CDROM_BASE, 0x0005, METHOD_BUFFERED, FILE_READ_ACCESS)
|
---|
43 | #define IOCTL_CDROM_SET_VOLUME CTL_CODE(IOCTL_CDROM_BASE, 0x000A, METHOD_BUFFERED, FILE_READ_ACCESS)
|
---|
44 | #define IOCTL_CDROM_READ_Q_CHANNEL CTL_CODE(IOCTL_CDROM_BASE, 0x000B, METHOD_BUFFERED, FILE_READ_ACCESS)
|
---|
45 | #define IOCTL_CDROM_GET_LAST_SESSION CTL_CODE(IOCTL_CDROM_BASE, 0x000E, METHOD_BUFFERED, FILE_READ_ACCESS)
|
---|
46 | #define IOCTL_CDROM_RAW_READ CTL_CODE(IOCTL_CDROM_BASE, 0x000F, METHOD_OUT_DIRECT, FILE_READ_ACCESS)
|
---|
47 | #define IOCTL_CDROM_DISK_TYPE CTL_CODE(IOCTL_CDROM_BASE, 0x0010, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
---|
48 | #define IOCTL_CDROM_GET_DRIVE_GEOMETRY CTL_CODE(IOCTL_CDROM_BASE, 0x0013, METHOD_BUFFERED, FILE_READ_ACCESS)
|
---|
49 |
|
---|
50 | #define IOCTL_CDROM_CHECK_VERIFY CTL_CODE(IOCTL_CDROM_BASE, 0x0200, METHOD_BUFFERED, FILE_READ_ACCESS)
|
---|
51 | #define IOCTL_CDROM_MEDIA_REMOVAL CTL_CODE(IOCTL_CDROM_BASE, 0x0201, METHOD_BUFFERED, FILE_READ_ACCESS)
|
---|
52 | #define IOCTL_CDROM_EJECT_MEDIA CTL_CODE(IOCTL_CDROM_BASE, 0x0202, METHOD_BUFFERED, FILE_READ_ACCESS)
|
---|
53 | #define IOCTL_CDROM_LOAD_MEDIA CTL_CODE(IOCTL_CDROM_BASE, 0x0203, METHOD_BUFFERED, FILE_READ_ACCESS)
|
---|
54 | #define IOCTL_CDROM_RESERVE CTL_CODE(IOCTL_CDROM_BASE, 0x0204, METHOD_BUFFERED, FILE_READ_ACCESS)
|
---|
55 | #define IOCTL_CDROM_RELEASE CTL_CODE(IOCTL_CDROM_BASE, 0x0205, METHOD_BUFFERED, FILE_READ_ACCESS)
|
---|
56 | #define IOCTL_CDROM_FIND_NEW_DEVICES CTL_CODE(IOCTL_CDROM_BASE, 0x0206, METHOD_BUFFERED, FILE_READ_ACCESS)
|
---|
57 |
|
---|
58 | #include <ntddstor.h>
|
---|
59 |
|
---|
60 | #define MAXIMUM_NUMBER_TRACKS 100
|
---|
61 | #define MAXIMUM_CDROM_SIZE 804
|
---|
62 |
|
---|
63 | typedef struct _TRACK_DATA {
|
---|
64 | UCHAR Reserved;
|
---|
65 | UCHAR Control : 4;
|
---|
66 | UCHAR Adr : 4;
|
---|
67 | UCHAR TrackNumber;
|
---|
68 | UCHAR Reserved1;
|
---|
69 | UCHAR Address[4];
|
---|
70 | } TRACK_DATA, *PTRACK_DATA;
|
---|
71 |
|
---|
72 | typedef struct _CDROM_TOC {
|
---|
73 | UCHAR Length[2];
|
---|
74 | UCHAR FirstTrack;
|
---|
75 | UCHAR LastTrack;
|
---|
76 | TRACK_DATA TrackData[MAXIMUM_NUMBER_TRACKS];
|
---|
77 | } CDROM_TOC, *PCDROM_TOC;
|
---|
78 |
|
---|
79 | #define CDROM_TOC_SIZE sizeof(CDROM_TOC)
|
---|
80 |
|
---|
81 | typedef struct _CDROM_PLAY_AUDIO_MSF {
|
---|
82 | UCHAR StartingM;
|
---|
83 | UCHAR StartingS;
|
---|
84 | UCHAR StartingF;
|
---|
85 | UCHAR EndingM;
|
---|
86 | UCHAR EndingS;
|
---|
87 | UCHAR EndingF;
|
---|
88 | } CDROM_PLAY_AUDIO_MSF, *PCDROM_PLAY_AUDIO_MSF;
|
---|
89 |
|
---|
90 | typedef struct _CDROM_SEEK_AUDIO_MSF {
|
---|
91 | UCHAR M;
|
---|
92 | UCHAR S;
|
---|
93 | UCHAR F;
|
---|
94 | } CDROM_SEEK_AUDIO_MSF, *PCDROM_SEEK_AUDIO_MSF;
|
---|
95 |
|
---|
96 | typedef struct _CDROM_DISK_DATA {
|
---|
97 | ULONG DiskData;
|
---|
98 | } CDROM_DISK_DATA, *PCDROM_DISK_DATA;
|
---|
99 |
|
---|
100 | #define CDROM_DISK_AUDIO_TRACK (0x00000001)
|
---|
101 | #define CDROM_DISK_DATA_TRACK (0x00000002)
|
---|
102 |
|
---|
103 | #define IOCTL_CDROM_SUB_Q_CHANNEL 0x00
|
---|
104 | #define IOCTL_CDROM_CURRENT_POSITION 0x01
|
---|
105 | #define IOCTL_CDROM_MEDIA_CATALOG 0x02
|
---|
106 | #define IOCTL_CDROM_TRACK_ISRC 0x03
|
---|
107 |
|
---|
108 | typedef struct _CDROM_SUB_Q_DATA_FORMAT {
|
---|
109 | UCHAR Format;
|
---|
110 | UCHAR Track;
|
---|
111 | } CDROM_SUB_Q_DATA_FORMAT, *PCDROM_SUB_Q_DATA_FORMAT;
|
---|
112 |
|
---|
113 | typedef struct _SUB_Q_HEADER {
|
---|
114 | UCHAR Reserved;
|
---|
115 | UCHAR AudioStatus;
|
---|
116 | UCHAR DataLength[2];
|
---|
117 | } SUB_Q_HEADER, *PSUB_Q_HEADER;
|
---|
118 |
|
---|
119 | typedef struct _SUB_Q_CURRENT_POSITION {
|
---|
120 | SUB_Q_HEADER Header;
|
---|
121 | UCHAR FormatCode;
|
---|
122 | UCHAR Control : 4;
|
---|
123 | UCHAR ADR : 4;
|
---|
124 | UCHAR TrackNumber;
|
---|
125 | UCHAR IndexNumber;
|
---|
126 | UCHAR AbsoluteAddress[4];
|
---|
127 | UCHAR TrackRelativeAddress[4];
|
---|
128 | } SUB_Q_CURRENT_POSITION, *PSUB_Q_CURRENT_POSITION;
|
---|
129 |
|
---|
130 | typedef struct _SUB_Q_MEDIA_CATALOG_NUMBER {
|
---|
131 | SUB_Q_HEADER Header;
|
---|
132 | UCHAR FormatCode;
|
---|
133 | UCHAR Reserved[3];
|
---|
134 | UCHAR Reserved1 : 7;
|
---|
135 | UCHAR Mcval : 1;
|
---|
136 | UCHAR MediaCatalog[15];
|
---|
137 | } SUB_Q_MEDIA_CATALOG_NUMBER, *PSUB_Q_MEDIA_CATALOG_NUMBER;
|
---|
138 |
|
---|
139 | typedef struct _SUB_Q_TRACK_ISRC {
|
---|
140 | SUB_Q_HEADER Header;
|
---|
141 | UCHAR FormatCode;
|
---|
142 | UCHAR Reserved0;
|
---|
143 | UCHAR Track;
|
---|
144 | UCHAR Reserved1;
|
---|
145 | UCHAR Reserved2 : 7;
|
---|
146 | UCHAR Tcval : 1;
|
---|
147 | UCHAR TrackIsrc[15];
|
---|
148 | } SUB_Q_TRACK_ISRC, *PSUB_Q_TRACK_ISRC;
|
---|
149 |
|
---|
150 | typedef union _SUB_Q_CHANNEL_DATA {
|
---|
151 | SUB_Q_CURRENT_POSITION CurrentPosition;
|
---|
152 | SUB_Q_MEDIA_CATALOG_NUMBER MediaCatalog;
|
---|
153 | SUB_Q_TRACK_ISRC TrackIsrc;
|
---|
154 | } SUB_Q_CHANNEL_DATA, *PSUB_Q_CHANNEL_DATA;
|
---|
155 |
|
---|
156 | #define AUDIO_STATUS_NOT_SUPPORTED 0x00
|
---|
157 | #define AUDIO_STATUS_IN_PROGRESS 0x11
|
---|
158 | #define AUDIO_STATUS_PAUSED 0x12
|
---|
159 | #define AUDIO_STATUS_PLAY_COMPLETE 0x13
|
---|
160 | #define AUDIO_STATUS_PLAY_ERROR 0x14
|
---|
161 | #define AUDIO_STATUS_NO_STATUS 0x15
|
---|
162 |
|
---|
163 | #define ADR_NO_MODE_INFORMATION 0x0
|
---|
164 | #define ADR_ENCODES_CURRENT_POSITION 0x1
|
---|
165 | #define ADR_ENCODES_MEDIA_CATALOG 0x2
|
---|
166 | #define ADR_ENCODES_ISRC 0x3
|
---|
167 |
|
---|
168 | #define AUDIO_WITH_PREEMPHASIS 0x0
|
---|
169 | #define DIGITAL_COPY_PERMITTED 0x2
|
---|
170 | #define AUDIO_DATA_TRACK 0x4
|
---|
171 | #define TWO_FOUR_CHANNEL_AUDIO 0x8
|
---|
172 |
|
---|
173 | typedef struct _CDROM_AUDIO_CONTROL {
|
---|
174 | UCHAR LbaFormat;
|
---|
175 | USHORT LogicalBlocksPerSecond;
|
---|
176 | } CDROM_AUDIO_CONTROL, *PCDROM_AUDIO_CONTROL;
|
---|
177 |
|
---|
178 | typedef struct _VOLUME_CONTROL {
|
---|
179 | UCHAR PortVolume[4];
|
---|
180 | } VOLUME_CONTROL, *PVOLUME_CONTROL;
|
---|
181 |
|
---|
182 | typedef enum _TRACK_MODE_TYPE {
|
---|
183 | YellowMode2,
|
---|
184 | XAForm2,
|
---|
185 | CDDA
|
---|
186 | } TRACK_MODE_TYPE, *PTRACK_MODE_TYPE;
|
---|
187 |
|
---|
188 | typedef struct __RAW_READ_INFO {
|
---|
189 | LARGE_INTEGER DiskOffset;
|
---|
190 | ULONG SectorCount;
|
---|
191 | TRACK_MODE_TYPE TrackMode;
|
---|
192 | } RAW_READ_INFO, *PRAW_READ_INFO;
|
---|
193 |
|
---|
194 | #endif /* __NTDDCDRM_H */
|
---|