[UDFS] Svn add some missing files. CORE-9774
[reactos.git] / reactos / drivers / filesystems / udfs / CDRW / cdrw_usr.h
1 ////////////////////////////////////////////////////////////////////
2 // Copyright (C) Alexander Telyatnikov, Ivan Keliukh, Yegor Anchishkin, SKIF Software, 1999-2013. Kiev, Ukraine
3 // All rights reserved
4 ////////////////////////////////////////////////////////////////////
5 /*
6
7 Module Name:
8
9 cdrw_usr.h
10
11 Abstract:
12
13 This file defines the interface between CD-Writer's driver & user
14 applications.
15
16 Environment:
17
18 NT kernel mode or Win32 app
19 */
20
21 #ifndef __CDRW_PUBLIC_H__
22 #define __CDRW_PUBLIC_H__
23
24 #define CDRW_SIGNATURE_v1 "ALWA CD-R/W v1"
25
26 //#define CDRW_RESTRICT_ACCESS // require W-acces rights for some IOCTLs
27
28 #include "cdrw_hw.h"
29 //#include "ntdddisk.h"
30
31 #ifndef CTL_CODE
32 #pragma pack(push, 8)
33 #include "winioctl.h"
34 #pragma pack(pop)
35 #endif
36
37 #if defined(CDRW_EXPORTS) || defined(FileSys_EXPORTS)
38 #include "mountmgr.h"
39 #endif
40
41 #ifndef FILE_DEVICE_SECURE_OPEN
42 #define FILE_DEVICE_SECURE_OPEN 0x00000100
43 #endif //FILE_DEVICE_SECURE_OPEN
44
45 #pragma pack(push, 1)
46
47 #ifndef IRP_MJ_PNP
48 #define IRP_MJ_PNP IRP_MJ_PNP_POWER // Obsolete....
49 #endif //IRP_MJ_PNP
50
51 #ifndef FILE_DEVICE_CDRW
52 #define FILE_DEVICE_CDRW 0x00000999
53 #endif
54
55 #ifndef FILE_DEVICE_CD_ROM
56 #define FILE_DEVICE_CD_ROM 0x00000002
57 #endif //FILE_DEVICE_CD_ROM
58
59 #ifndef IOCTL_CDROM_BASE
60 #define IOCTL_CDROM_BASE FILE_DEVICE_CD_ROM
61 #endif //IOCTL_CDROM_BASE
62
63 #ifndef FILE_DEVICE_DVD
64 #define FILE_DEVICE_DVD 0x00000033
65 #endif //FILE_DEVICE_DVD
66
67 #ifndef IOCTL_DVD_BASE
68 #define IOCTL_DVD_BASE FILE_DEVICE_DVD
69 #endif //IOCTL_DVD_BASE
70
71 #ifndef FILE_DEVICE_DISK
72 #define FILE_DEVICE_DISK 0x00000007
73 #endif //FILE_DEVICE_DISK
74
75 #ifndef IOCTL_DISK_BASE
76 #define IOCTL_DISK_BASE FILE_DEVICE_DISK
77 #endif //IOCTL_DISK_BASE
78
79 #ifndef IOCTL_CDROM_UNLOAD_DRIVER
80 #define IOCTL_CDROM_UNLOAD_DRIVER CTL_CODE(IOCTL_CDROM_BASE, 0x0402, METHOD_BUFFERED, FILE_READ_ACCESS)
81
82 #define IOCTL_CDROM_READ_TOC CTL_CODE(IOCTL_CDROM_BASE, 0x0000, METHOD_BUFFERED, FILE_READ_ACCESS)
83 #define IOCTL_CDROM_GET_CONTROL CTL_CODE(IOCTL_CDROM_BASE, 0x000D, METHOD_BUFFERED, FILE_READ_ACCESS)
84 #define IOCTL_CDROM_PLAY_AUDIO_MSF CTL_CODE(IOCTL_CDROM_BASE, 0x0006, METHOD_BUFFERED, FILE_READ_ACCESS)
85 #define IOCTL_CDROM_SEEK_AUDIO_MSF CTL_CODE(IOCTL_CDROM_BASE, 0x0001, METHOD_BUFFERED, FILE_READ_ACCESS)
86 #define IOCTL_CDROM_STOP_AUDIO CTL_CODE(IOCTL_CDROM_BASE, 0x0002, METHOD_BUFFERED, FILE_READ_ACCESS)
87 #define IOCTL_CDROM_PAUSE_AUDIO CTL_CODE(IOCTL_CDROM_BASE, 0x0003, METHOD_BUFFERED, FILE_READ_ACCESS)
88 #define IOCTL_CDROM_RESUME_AUDIO CTL_CODE(IOCTL_CDROM_BASE, 0x0004, METHOD_BUFFERED, FILE_READ_ACCESS)
89 #define IOCTL_CDROM_GET_VOLUME CTL_CODE(IOCTL_CDROM_BASE, 0x0005, METHOD_BUFFERED, FILE_READ_ACCESS)
90 #define IOCTL_CDROM_SET_VOLUME CTL_CODE(IOCTL_CDROM_BASE, 0x000A, METHOD_BUFFERED, FILE_READ_ACCESS)
91 #define IOCTL_CDROM_READ_Q_CHANNEL CTL_CODE(IOCTL_CDROM_BASE, 0x000B, METHOD_BUFFERED, FILE_READ_ACCESS)
92 #define IOCTL_CDROM_GET_LAST_SESSION CTL_CODE(IOCTL_CDROM_BASE, 0x000E, METHOD_BUFFERED, FILE_READ_ACCESS)
93 #define IOCTL_CDROM_RAW_READ CTL_CODE(IOCTL_CDROM_BASE, 0x000F, METHOD_OUT_DIRECT, FILE_READ_ACCESS)
94 #define IOCTL_CDROM_DISK_TYPE CTL_CODE(IOCTL_CDROM_BASE, 0x0010, METHOD_BUFFERED, FILE_ANY_ACCESS)
95
96 #define IOCTL_CDROM_CHECK_VERIFY CTL_CODE(IOCTL_CDROM_BASE, 0x0200, METHOD_BUFFERED, FILE_READ_ACCESS)
97 #define IOCTL_CDROM_MEDIA_REMOVAL CTL_CODE(IOCTL_CDROM_BASE, 0x0201, METHOD_BUFFERED, FILE_READ_ACCESS)
98 #define IOCTL_CDROM_EJECT_MEDIA CTL_CODE(IOCTL_CDROM_BASE, 0x0202, METHOD_BUFFERED, FILE_READ_ACCESS)
99 #define IOCTL_CDROM_LOAD_MEDIA CTL_CODE(IOCTL_CDROM_BASE, 0x0203, METHOD_BUFFERED, FILE_READ_ACCESS)
100 #define IOCTL_CDROM_RESERVE CTL_CODE(IOCTL_CDROM_BASE, 0x0204, METHOD_BUFFERED, FILE_READ_ACCESS)
101 #define IOCTL_CDROM_RELEASE CTL_CODE(IOCTL_CDROM_BASE, 0x0205, METHOD_BUFFERED, FILE_READ_ACCESS)
102 #define IOCTL_CDROM_FIND_NEW_DEVICES CTL_CODE(IOCTL_CDROM_BASE, 0x0206, METHOD_BUFFERED, FILE_READ_ACCESS)
103
104 #define IOCTL_CDROM_GET_DRIVE_GEOMETRY CTL_CODE(IOCTL_CDROM_BASE, 0x0013, METHOD_BUFFERED, FILE_READ_ACCESS)
105 #define IOCTL_CDROM_GET_DRIVE_GEOMETRY_EX CTL_CODE(IOCTL_CDROM_BASE, 0x0014, METHOD_BUFFERED, FILE_READ_ACCESS)
106
107 #define IOCTL_CDROM_READ_TOC_EX CTL_CODE(IOCTL_CDROM_BASE, 0x0015, METHOD_BUFFERED, FILE_READ_ACCESS)
108 #define IOCTL_CDROM_GET_CONFIGURATION CTL_CODE(IOCTL_CDROM_BASE, 0x0016, METHOD_BUFFERED, FILE_READ_ACCESS)
109
110 #endif //IOCTL_CDROM_UNLOAD_DRIVER
111
112 #ifdef CDRW_RESTRICT_ACCESS
113
114 #define CDRW_CTL_CODE_R(a,b) CTL_CODE(FILE_DEVICE_CDRW, a,b, FILE_READ_DATA)
115 #define CDRW_CTL_CODE_W(a,b) CTL_CODE(FILE_DEVICE_CDRW, a,b, FILE_READ_DATA)
116 #define CDRW_CTL_CODE_W(a,b) CTL_CODE(FILE_DEVICE_CDRW, a,b, FILE_WRITE_DATA )
117 #define CDRW_CTL_CODE_A(a,b) CTL_CODE(FILE_DEVICE_CDRW, a,b, FILE_READ_DATA | FILE_WRITE_DATA )
118
119 #else //CDRW_RESTRICT_ACCESS
120
121 #define CDRW_CTL_CODE_R(a,b) CTL_CODE(FILE_DEVICE_CDRW, a,b, FILE_READ_DATA)
122 #define CDRW_CTL_CODE_W(a,b) CTL_CODE(FILE_DEVICE_CDRW, a,b, FILE_READ_DATA)
123 #define CDRW_CTL_CODE_A(a,b) CTL_CODE(FILE_DEVICE_CDRW, a,b, FILE_READ_DATA)
124 #define CDRW_CTL_CODE_X(a,b) CTL_CODE(FILE_DEVICE_CDRW, a,b, FILE_ANY_ACCESS )
125
126 #endif //CDRW_RESTRICT_ACCESS
127
128 #define IOCTL_CDRW_LOCK_DOOR CDRW_CTL_CODE_R(0x801, METHOD_BUFFERED)
129 #define IOCTL_CDRW_SET_SPEED CDRW_CTL_CODE_R(0x802, METHOD_BUFFERED)
130 #define IOCTL_CDRW_SYNC_CACHE CDRW_CTL_CODE_W(0x803, METHOD_BUFFERED)
131 #define IOCTL_CDRW_GET_CAPABILITIES CDRW_CTL_CODE_X(0x804, METHOD_BUFFERED)
132 #define IOCTL_CDRW_GET_SPEED IOCTL_CDRW_GET_CAPABILITIES
133 #define IOCTL_CDRW_GET_MEDIA_TYPE CDRW_CTL_CODE_X(0x805, METHOD_BUFFERED)
134 #define IOCTL_CDRW_GET_WRITE_MODE CDRW_CTL_CODE_R(0x806, METHOD_BUFFERED)
135 #define IOCTL_CDRW_SET_WRITE_MODE CDRW_CTL_CODE_W(0x807, METHOD_BUFFERED)
136 #define IOCTL_CDRW_RESERVE_TRACK CDRW_CTL_CODE_W(0x808, METHOD_BUFFERED)
137 #define IOCTL_CDRW_BLANK CDRW_CTL_CODE_R(0x809, METHOD_BUFFERED)
138 #define IOCTL_CDRW_CLOSE_TRK_SES CDRW_CTL_CODE_W(0x80a, METHOD_BUFFERED)
139 //#define IOCTL_CDRW_LL_WRITE CDRW_CTL_CODE_R(0x80b, METHOD_OUT_DIRECT)
140 #define IOCTL_CDRW_LL_WRITE CDRW_CTL_CODE_R(0x80b, METHOD_BUFFERED)
141 #define IOCTL_CDRW_READ_TRACK_INFO CDRW_CTL_CODE_R(0x80c, METHOD_IN_DIRECT)
142 #define IOCTL_CDRW_READ_DISC_INFO CDRW_CTL_CODE_R(0x80d, METHOD_IN_DIRECT)
143 #define IOCTL_CDRW_BUFFER_CAPACITY CDRW_CTL_CODE_A(0x80e, METHOD_IN_DIRECT)
144 #define IOCTL_CDRW_GET_SIGNATURE CDRW_CTL_CODE_X(0x80f, METHOD_BUFFERED)
145 #define IOCTL_CDRW_RESET_DRIVER CDRW_CTL_CODE_A(0x810, METHOD_BUFFERED)
146 //#ifndef WITHOUT_FORMATTER
147 #define IOCTL_CDRW_FORMAT_UNIT CDRW_CTL_CODE_W(0x811, METHOD_BUFFERED)
148 #define IOCTL_CDRW_SET_RANDOM_ACCESS CDRW_CTL_CODE_W(0x812, METHOD_BUFFERED)
149 //#endif //WITHOUT_FORMATTER
150 #define IOCTL_CDRW_TEST_UNIT_READY CDRW_CTL_CODE_X(0x813, METHOD_BUFFERED)
151 #define IOCTL_CDRW_RESET_WRITE_STATUS CDRW_CTL_CODE_X(0x814, METHOD_BUFFERED)
152 #define IOCTL_CDRW_GET_LAST_ERROR CDRW_CTL_CODE_R(0x815, METHOD_BUFFERED)
153 #define IOCTL_CDRW_MODE_SENSE CDRW_CTL_CODE_X(0x816, METHOD_BUFFERED)
154 #define IOCTL_CDRW_MODE_SELECT CDRW_CTL_CODE_R(0x817, METHOD_BUFFERED)
155 #define IOCTL_CDRW_SET_READ_AHEAD CDRW_CTL_CODE_R(0x818, METHOD_BUFFERED)
156 #define IOCTL_CDRW_SET_DEFAULT_SESSION CDRW_CTL_CODE_R(0x819, METHOD_BUFFERED) // RESERVED !!!
157 #define IOCTL_CDRW_NOTIFY_MEDIA_CHANGE CDRW_CTL_CODE_X(0x81a, METHOD_BUFFERED)
158 #define IOCTL_CDRW_SEND_OPC_INFO CDRW_CTL_CODE_W(0x81b, METHOD_BUFFERED)
159 #define IOCTL_CDRW_LL_READ CDRW_CTL_CODE_R(0x81c, METHOD_BUFFERED)
160 #define IOCTL_CDRW_SEND_CUE_SHEET CDRW_CTL_CODE_W(0x81d, METHOD_OUT_DIRECT)
161 #define IOCTL_CDRW_INIT_DEINIT CDRW_CTL_CODE_A(0x81e, METHOD_BUFFERED)
162 #define IOCTL_CDRW_READ_FULL_TOC CDRW_CTL_CODE_R(0x81f, METHOD_BUFFERED)
163 #define IOCTL_CDRW_READ_PMA CDRW_CTL_CODE_R(0x820, METHOD_BUFFERED)
164 #define IOCTL_CDRW_READ_SESSION_INFO CDRW_CTL_CODE_R(0x821, METHOD_BUFFERED)
165 #define IOCTL_CDRW_READ_ATIP CDRW_CTL_CODE_R(0x822, METHOD_BUFFERED)
166 #define IOCTL_CDRW_READ_CD_TEXT CDRW_CTL_CODE_R(0x823, METHOD_BUFFERED)
167 #define IOCTL_CDRW_READ_TOC_EX CDRW_CTL_CODE_R(0x824, METHOD_BUFFERED)
168 #define IOCTL_CDRW_GET_DEVICE_INFO CDRW_CTL_CODE_R(0x825, METHOD_BUFFERED)
169 #define IOCTL_CDRW_GET_EVENT CDRW_CTL_CODE_R(0x826, METHOD_IN_DIRECT)
170 #define IOCTL_CDRW_GET_DEVICE_NAME CDRW_CTL_CODE_R(0x827, METHOD_BUFFERED)
171 #define IOCTL_CDRW_RESET_DRIVER_EX CDRW_CTL_CODE_A(0x828, METHOD_BUFFERED)
172 #define IOCTL_CDRW_GET_MEDIA_TYPE_EX CDRW_CTL_CODE_X(0x829, METHOD_BUFFERED)
173 #ifndef WITHOUT_FORMATTER
174 #define IOCTL_CDRW_GET_MRW_MODE CDRW_CTL_CODE_X(0x82a, METHOD_BUFFERED)
175 #define IOCTL_CDRW_SET_MRW_MODE CDRW_CTL_CODE_X(0x82b, METHOD_BUFFERED)
176 #endif //WITHOUT_FORMATTER
177 #define IOCTL_CDRW_READ_CAPACITY CDRW_CTL_CODE_R(0x82c, METHOD_IN_DIRECT)
178 #define IOCTL_CDRW_GET_DISC_LAYOUT CDRW_CTL_CODE_R(0x82d, METHOD_IN_DIRECT)
179 #define IOCTL_CDRW_SET_STREAMING CDRW_CTL_CODE_W(0x82e, METHOD_BUFFERED)
180
181 #define IOCTL_CDRW_UNLOAD_DRIVER IOCTL_CDROM_UNLOAD_DRIVER
182
183 #define IOCTL_CDRW_READ_TOC IOCTL_CDROM_READ_TOC
184 #define IOCTL_CDRW_GET_CONTROL IOCTL_CDROM_GET_CONTROL
185 #define IOCTL_CDRW_PLAY_AUDIO_MSF IOCTL_CDROM_PLAY_AUDIO_MSF
186 #define IOCTL_CDRW_SEEK_AUDIO_MSF IOCTL_CDROM_SEEK_AUDIO_MSF
187 #define IOCTL_CDRW_STOP_AUDIO IOCTL_CDROM_STOP_AUDIO
188 #define IOCTL_CDRW_PAUSE_AUDIO IOCTL_CDROM_PAUSE_AUDIO
189 #define IOCTL_CDRW_RESUME_AUDIO IOCTL_CDROM_RESUME_AUDIO
190 #define IOCTL_CDRW_GET_VOLUME IOCTL_CDROM_GET_VOLUME
191 #define IOCTL_CDRW_SET_VOLUME IOCTL_CDROM_SET_VOLUME
192 #define IOCTL_CDRW_READ_Q_CHANNEL IOCTL_CDROM_READ_Q_CHANNEL
193 #define IOCTL_CDRW_GET_LAST_SESSION IOCTL_CDROM_GET_LAST_SESSION
194 #define IOCTL_CDRW_RAW_READ IOCTL_CDROM_RAW_READ
195 #define IOCTL_CDRW_DISK_TYPE IOCTL_CDROM_DISK_TYPE
196
197 #define IOCTL_CDRW_CHECK_VERIFY IOCTL_CDROM_CHECK_VERIFY
198 #define IOCTL_CDRW_MEDIA_REMOVAL IOCTL_CDROM_MEDIA_REMOVAL
199 #define IOCTL_CDRW_EJECT_MEDIA IOCTL_CDROM_EJECT_MEDIA
200 #define IOCTL_CDRW_LOAD_MEDIA IOCTL_CDROM_LOAD_MEDIA
201 #define IOCTL_CDRW_RESERVE IOCTL_CDROM_RESERVE
202 #define IOCTL_CDRW_RELEASE IOCTL_CDROM_RELEASE
203 #define IOCTL_CDRW_FIND_NEW_DEVICES IOCTL_CDROM_FIND_NEW_DEVICES
204
205 #ifndef IOCTL_DVD_READ_STRUCTURE
206 #define IOCTL_DVD_READ_STRUCTURE CTL_CODE(IOCTL_DVD_BASE, 0x0450, METHOD_BUFFERED, FILE_READ_ACCESS)
207
208 #define IOCTL_DVD_START_SESSION CTL_CODE(IOCTL_DVD_BASE, 0x0400, METHOD_BUFFERED, FILE_READ_ACCESS)
209 #define IOCTL_DVD_READ_KEY CTL_CODE(IOCTL_DVD_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS)
210 #define IOCTL_DVD_SEND_KEY CTL_CODE(IOCTL_DVD_BASE, 0x0402, METHOD_BUFFERED, FILE_READ_ACCESS)
211 #define IOCTL_DVD_END_SESSION CTL_CODE(IOCTL_DVD_BASE, 0x0403, METHOD_BUFFERED, FILE_READ_ACCESS)
212 #define IOCTL_DVD_SET_READ_AHEAD CTL_CODE(IOCTL_DVD_BASE, 0x0404, METHOD_BUFFERED, FILE_READ_ACCESS)
213 #define IOCTL_DVD_GET_REGION CTL_CODE(IOCTL_DVD_BASE, 0x0405, METHOD_BUFFERED, FILE_READ_ACCESS)
214 #define IOCTL_DVD_SEND_KEY2 CTL_CODE(IOCTL_DVD_BASE, 0x0406, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
215 #endif //IOCTL_DVD_READ_STRUCTURE
216
217 #ifndef IOCTL_DISK_GET_DRIVE_GEOMETRY
218 #define IOCTL_DISK_GET_DRIVE_GEOMETRY CTL_CODE(IOCTL_DISK_BASE, 0x0000, METHOD_BUFFERED, FILE_ANY_ACCESS)
219 #define IOCTL_DISK_VERIFY CTL_CODE(IOCTL_DISK_BASE, 0x0005, METHOD_BUFFERED, FILE_ANY_ACCESS)
220 #define IOCTL_DISK_FORMAT_TRACKS CTL_CODE(IOCTL_DISK_BASE, 0x0006, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
221 #define IOCTL_DISK_IS_WRITABLE CTL_CODE(IOCTL_DISK_BASE, 0x0009, METHOD_BUFFERED, FILE_ANY_ACCESS)
222 #define IOCTL_DISK_FORMAT_TRACKS_EX CTL_CODE(IOCTL_DISK_BASE, 0x000b, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
223
224 #define IOCTL_DISK_CHECK_VERIFY CTL_CODE(IOCTL_DISK_BASE, 0x0200, METHOD_BUFFERED, FILE_READ_ACCESS)
225 #define IOCTL_DISK_MEDIA_REMOVAL CTL_CODE(IOCTL_DISK_BASE, 0x0201, METHOD_BUFFERED, FILE_READ_ACCESS)
226 #define IOCTL_DISK_EJECT_MEDIA CTL_CODE(IOCTL_DISK_BASE, 0x0202, METHOD_BUFFERED, FILE_READ_ACCESS)
227 #define IOCTL_DISK_LOAD_MEDIA CTL_CODE(IOCTL_DISK_BASE, 0x0203, METHOD_BUFFERED, FILE_READ_ACCESS)
228 #define IOCTL_DISK_RESERVE CTL_CODE(IOCTL_DISK_BASE, 0x0204, METHOD_BUFFERED, FILE_READ_ACCESS)
229 #define IOCTL_DISK_RELEASE CTL_CODE(IOCTL_DISK_BASE, 0x0205, METHOD_BUFFERED, FILE_READ_ACCESS)
230 #define IOCTL_DISK_FIND_NEW_DEVICES CTL_CODE(IOCTL_DISK_BASE, 0x0206, METHOD_BUFFERED, FILE_READ_ACCESS)
231 #define IOCTL_DISK_GET_MEDIA_TYPES CTL_CODE(IOCTL_DISK_BASE, 0x0300, METHOD_BUFFERED, FILE_ANY_ACCESS)
232 #endif //IOCTL_DISK_GET_DRIVE_GEOMETRY
233
234 #ifndef IOCTL_STORAGE_SET_READ_AHEAD
235 #define IOCTL_STORAGE_SET_READ_AHEAD CTL_CODE(IOCTL_STORAGE_BASE, 0x0100, METHOD_BUFFERED, FILE_READ_ACCESS)
236 #endif //IOCTL_STORAGE_SET_READ_AHEAD
237
238 #ifndef IOCTL_STORAGE_GET_MEDIA_TYPES_EX
239 #define IOCTL_STORAGE_GET_MEDIA_TYPES_EX CTL_CODE(IOCTL_STORAGE_BASE, 0x0301, METHOD_BUFFERED, FILE_ANY_ACCESS)
240
241 typedef enum _STORAGE_MEDIA_TYPE {
242 //
243 // Following are defined in ntdddisk.h in the MEDIA_TYPE enum
244 //
245 // Unknown, // Format is unknown
246 // F5_1Pt2_512, // 5.25", 1.2MB, 512 bytes/sector
247 // F3_1Pt44_512, // 3.5", 1.44MB, 512 bytes/sector
248 // F3_2Pt88_512, // 3.5", 2.88MB, 512 bytes/sector
249 // F3_20Pt8_512, // 3.5", 20.8MB, 512 bytes/sector
250 // F3_720_512, // 3.5", 720KB, 512 bytes/sector
251 // F5_360_512, // 5.25", 360KB, 512 bytes/sector
252 // F5_320_512, // 5.25", 320KB, 512 bytes/sector
253 // F5_320_1024, // 5.25", 320KB, 1024 bytes/sector
254 // F5_180_512, // 5.25", 180KB, 512 bytes/sector
255 // F5_160_512, // 5.25", 160KB, 512 bytes/sector
256 // RemovableMedia, // Removable media other than floppy
257 // FixedMedia, // Fixed hard disk media
258 // F3_120M_512, // 3.5", 120M Floppy
259 // F3_640_512, // 3.5" , 640KB, 512 bytes/sector
260 // F5_640_512, // 5.25", 640KB, 512 bytes/sector
261 // F5_720_512, // 5.25", 720KB, 512 bytes/sector
262 // F3_1Pt2_512, // 3.5" , 1.2Mb, 512 bytes/sector
263 // F3_1Pt23_1024, // 3.5" , 1.23Mb, 1024 bytes/sector
264 // F5_1Pt23_1024, // 5.25", 1.23MB, 1024 bytes/sector
265 // F3_128Mb_512, // 3.5" MO 128Mb 512 bytes/sector
266 // F3_230Mb_512, // 3.5" MO 230Mb 512 bytes/sector
267 // F8_256_128, // 8", 256KB, 128 bytes/sector
268 //
269
270 DDS_4mm = 0x20, // Tape - DAT DDS1,2,... (all vendors)
271 MiniQic, // Tape - miniQIC Tape
272 Travan, // Tape - Travan TR-1,2,3,...
273 QIC, // Tape - QIC
274 MP_8mm, // Tape - 8mm Exabyte Metal Particle
275 AME_8mm, // Tape - 8mm Exabyte Advanced Metal Evap
276 AIT1_8mm, // Tape - 8mm Sony AIT1
277 DLT, // Tape - DLT Compact IIIxt, IV
278 NCTP, // Tape - Philips NCTP
279 IBM_3480, // Tape - IBM 3480
280 IBM_3490E, // Tape - IBM 3490E
281 IBM_Magstar_3590, // Tape - IBM Magstar 3590
282 IBM_Magstar_MP, // Tape - IBM Magstar MP
283 STK_DATA_D3, // Tape - STK Data D3
284 SONY_DTF, // Tape - Sony DTF
285 DV_6mm, // Tape - 6mm Digital Video
286 DMI, // Tape - Exabyte DMI and compatibles
287 SONY_D2, // Tape - Sony D2S and D2L
288 CLEANER_CARTRIDGE, // Cleaner - All Drive types that support Drive Cleaners
289 CD_ROM, // Opt_Disk - CD
290 CD_R, // Opt_Disk - CD-Recordable (Write Once)
291 CD_RW, // Opt_Disk - CD-Rewriteable
292 DVD_ROM, // Opt_Disk - DVD-ROM
293 DVD_R, // Opt_Disk - DVD-Recordable (Write Once)
294 DVD_RW, // Opt_Disk - DVD-Rewriteable
295 MO_3_RW, // Opt_Disk - 3.5" Rewriteable MO Disk
296 MO_5_WO, // Opt_Disk - MO 5.25" Write Once
297 MO_5_RW, // Opt_Disk - MO 5.25" Rewriteable (not LIMDOW)
298 MO_5_LIMDOW, // Opt_Disk - MO 5.25" Rewriteable (LIMDOW)
299 PC_5_WO, // Opt_Disk - Phase Change 5.25" Write Once Optical
300 PC_5_RW, // Opt_Disk - Phase Change 5.25" Rewriteable
301 PD_5_RW, // Opt_Disk - PhaseChange Dual Rewriteable
302 ABL_5_WO, // Opt_Disk - Ablative 5.25" Write Once Optical
303 PINNACLE_APEX_5_RW, // Opt_Disk - Pinnacle Apex 4.6GB Rewriteable Optical
304 SONY_12_WO, // Opt_Disk - Sony 12" Write Once
305 PHILIPS_12_WO, // Opt_Disk - Philips/LMS 12" Write Once
306 HITACHI_12_WO, // Opt_Disk - Hitachi 12" Write Once
307 CYGNET_12_WO, // Opt_Disk - Cygnet/ATG 12" Write Once
308 KODAK_14_WO, // Opt_Disk - Kodak 14" Write Once
309 MO_NFR_525, // Opt_Disk - Near Field Recording (Terastor)
310 NIKON_12_RW, // Opt_Disk - Nikon 12" Rewriteable
311 IOMEGA_ZIP, // Mag_Disk - Iomega Zip
312 IOMEGA_JAZ, // Mag_Disk - Iomega Jaz
313 SYQUEST_EZ135, // Mag_Disk - Syquest EZ135
314 SYQUEST_EZFLYER, // Mag_Disk - Syquest EzFlyer
315 SYQUEST_SYJET, // Mag_Disk - Syquest SyJet
316 AVATAR_F2, // Mag_Disk - 2.5" Floppy
317 MP2_8mm, // Tape - 8mm Hitachi
318 DST_S, // Ampex DST Small Tapes
319 DST_M, // Ampex DST Medium Tapes
320 DST_L, // Ampex DST Large Tapes
321 VXATape_1, // Ecrix 8mm Tape
322 VXATape_2, // Ecrix 8mm Tape
323 STK_EAGLE, // STK Eagle
324 LTO_Ultrium, // IBM, HP, Seagate LTO Ultrium
325 LTO_Accelis // IBM, HP, Seagate LTO Accelis
326 } STORAGE_MEDIA_TYPE, *PSTORAGE_MEDIA_TYPE;
327
328 #endif //IOCTL_STORAGE_GET_MEDIA_TYPES_EX
329
330
331 //**********************************************************************************************
332
333 typedef struct _SET_CD_SPEED_USER_IN {
334 ULONG ReadSpeed; // Kbyte/sec 176 = 1X
335 ULONG WriteSpeed; // Kbyte/sec
336 } SET_CD_SPEED_USER_IN, *PSET_CD_SPEED_USER_IN;
337
338 typedef struct _SET_CD_SPEED_EX_USER_IN {
339 ULONG ReadSpeed; // Kbyte/sec 176 = 1X
340 ULONG WriteSpeed; // Kbyte/sec
341 UCHAR RotCtrl;
342 UCHAR Reserved[3];
343 } SET_CD_SPEED_EX_USER_IN, *PSET_CD_SPEED_EX_USER_IN;
344
345 //**********************************************************************************************
346
347 typedef struct _SET_STREAMING_USER_IN {
348 union {
349 UCHAR Flags;
350 struct {
351 UCHAR RA : 1; // Random Access
352 UCHAR Exact : 1;
353 UCHAR RDD : 1; // Restore Defaults
354 UCHAR WRC : 2;
355 UCHAR Reserved0 : 3;
356 } Fields;
357 } Options;
358
359 UCHAR Reserved1[3];
360
361 ULONG StartLBA;
362 ULONG EndLBA;
363
364 ULONG ReadSize; // KBytes
365 ULONG ReadTime; // ms
366
367 ULONG WriteSize; // KBytes
368 ULONG WriteTime; // ms
369 } SET_STREAMING_USER_IN, *PSET_STREAMING_USER_IN;
370
371 //**********************************************************************************************
372
373 /*
374 #ifndef SyncCache_RELADR
375 #define SyncCache_RELADR 0x01
376 #define SyncCache_Immed 0x02
377 #endif //SyncCache_RELADR
378 */
379
380 typedef struct _SYNC_CACHE_USER_IN {
381 union {
382 UCHAR Flags;
383 struct {
384 UCHAR RELADR : 1;
385 UCHAR Immed : 1;
386 UCHAR Reserved0 : 6;
387 } Fields;
388 } Byte1;
389 ULONG LBA;
390 USHORT NumOfBlocks;
391 } SYNC_CACHE_USER_IN, *PSYNC_CACHE_USER_IN;
392
393 //**********************************************************************************************
394
395 typedef struct _BUFFER_CAPACITY_BLOCK_USER_OUT {
396 UCHAR Reserved0[4];
397 ULONG BufferLength;
398 ULONG BlankBufferLength;
399 ULONG WriteStatus;
400 BOOLEAN LostStreaming;
401 ULONG MaximumPhysicalPages;
402 ULONG MaximumTransferLength;
403 ULONG ActualMaximumTransferLength;
404 } BUFFER_CAPACITY_BLOCK_USER_OUT, *PBUFFER_CAPACITY_BLOCK_USER_OUT;
405
406 //**********************************************************************************************
407
408 typedef struct _TRACK_INFO_BLOCK_USER_OUT {
409 USHORT DataLength;
410 UCHAR _TrackNum;
411 UCHAR _SesNum;
412 UCHAR Reserved0;
413
414 union {
415 UCHAR Flags;
416 struct {
417 UCHAR TrackMode : 4;
418 UCHAR Copy : 1;
419 UCHAR Damage : 1;
420 UCHAR Reserved1 : 2;
421 } Fields;
422 } TrackParam;
423
424 union {
425 UCHAR Flags;
426 struct {
427 UCHAR DataMode : 4;
428 UCHAR FP : 1;
429 UCHAR Packet : 1;
430 UCHAR Blank : 1;
431 UCHAR RT : 1;
432 } Fields;
433 } DataParam;
434
435 UCHAR NWA_V;
436 ULONG TrackStartLBA;
437 ULONG NextWriteLBA;
438 ULONG FreeBlocks;
439 ULONG FixPacketSize;
440 ULONG TrackLength;
441
442 // MMC-3
443
444 ULONG LastRecordedAddr;
445 UCHAR _TrackNum2; // MSB
446 UCHAR _SesNum2; // MSB
447 UCHAR Reserved2[2];
448
449 // MMC-5
450
451 ULONG ReadCompatLBA;
452
453 // Additional
454
455 UCHAR TrackStartMSF[3];
456 UCHAR NextWriteMSF[3];
457 ULONG TrackNum;
458 ULONG SesNum;
459
460 } TRACK_INFO_BLOCK_USER_OUT, *PTRACK_INFO_BLOCK_USER_OUT;
461
462 //**********************************************************************************************
463
464 typedef struct _TRACK_INFO_BLOCK_USER_IN {
465 BOOLEAN Track;
466 ULONG LBA_TrkNum;
467 } TRACK_INFO_BLOCK_USER_IN, *PTRACK_INFO_BLOCK_USER_IN;
468
469 //**********************************************************************************************
470
471 typedef READ_CAPACITY_DATA READ_CAPACITY_USER_OUT;
472 typedef PREAD_CAPACITY_DATA PREAD_CAPACITY_USER_OUT;
473
474 //**********************************************************************************************
475
476 typedef struct _GET_SIGNATURE_USER_OUT {
477 ULONG MagicDword;
478 USHORT VersiomMajor ;
479 USHORT VersiomMinor ;
480 USHORT VersiomId ; // alfa/beta/...
481 USHORT Reserved;
482 UCHAR VendorId[32];
483 } GET_SIGNATURE_USER_OUT, *PGET_SIGNATURE_USER_OUT;
484
485 //**********************************************************************************************
486
487 /*
488 #ifndef BlankMedia_Mask
489 #define BlankMedia_Mask 0x07
490 #define BlankMedia_Complete 0x00
491 #define BlankMedia_Minimal 0x01
492 #define BlankMedia_Track 0x02
493 #define BlankMedia_UnreserveTrack 0x03
494 #define BlankMedia_TrackTail 0x04
495 #define BlankMedia_UncloseLastSes 0x05
496 #define BlankMedia_EraseSes 0x06
497 #define BlankMedia_Immed 0x10
498 #endif //BlankMedia_Mask
499 */
500
501 typedef struct _BLANK_MEDIA_USER_IN {
502 union {
503 UCHAR Flags;
504 ULONG Reserved;
505 struct {
506 UCHAR BlankType : 3;
507 UCHAR Reserved0 : 1;
508 UCHAR Immed : 1;
509 UCHAR Reserved1 : 3;
510 } Fields;
511 } Byte1;
512 ULONG StartAddr_TrkNum;
513 } BLANK_MEDIA_USER_IN, *PBLANK_MEDIA_USER_IN;
514
515 //**********************************************************************************************
516
517 typedef struct _RESERVE_TRACK_USER_IN {
518 ULONG Size;
519 } RESERVE_TRACK_USER_IN, *PRESERVE_TRACK_USER_IN;
520
521 #define RESERVE_TRACK_EX_SIZE 0x0
522 #define RESERVE_TRACK_EX_START_LBA 0x1
523 #define RESERVE_TRACK_EX_RMZ 0x2
524
525 typedef struct _RESERVE_TRACK_EX_USER_IN {
526 ULONG Flags;
527 union {
528 ULONG Size;
529 ULONG StartLBA;
530 };
531 } RESERVE_TRACK_EX_USER_IN, *PRESERVE_TRACK_EX_USER_IN;
532
533 //**********************************************************************************************
534
535 typedef struct _LL_WRITE_USER_IN {
536 union {
537 UCHAR Flags;
538 ULONG Reserved;
539 struct {
540 UCHAR RELADR : 1;
541 UCHAR Reserved0 : 2;
542 UCHAR FUA : 1;
543 UCHAR DPO : 1;
544 UCHAR Reserved1 : 3;
545 } Fields;
546 } Flags;
547 ULONG LBA;
548 USHORT NumOfBlocks;
549 UCHAR Reserved1[2];
550 } LL_WRITE_USER_IN, *PLL_WRITE_USER_IN;
551
552 //**********************************************************************************************
553
554 //#ifndef WITHOUT_FORMATTER
555
556 /*
557 #ifndef FormatDesc_Grow
558 #define FormatDesc_Grow 0x40
559 #define FormatDesc_Ses 0x80
560 #endif
561 */
562
563 #define FORMAT_UNIT_FORCE_STD_MODE 0x80000000
564 #define FORMAT_UNIT_FORCE_FULL_FMT 0x40000000
565 #define FORMAT_UNIT_RESTART_MRW 0x01000000
566
567 typedef struct _FORMAT_CDRW_PARAMETERS_USER_IN {
568 union {
569 UCHAR Flags;
570 ULONG FlagsEx;
571 struct {
572 UCHAR Reserved0: 6;
573 UCHAR Grow: 1;
574 UCHAR Ses: 1;
575 } Fields;
576 } Flags;
577 LONG BlockCount;
578 } FORMAT_CDRW_PARAMETERS_USER_IN, *PFORMAT_CDRW_PARAMETERS_USER_IN;
579
580 //#endif //WITHOUT_FORMATTER
581
582 //**********************************************************************************************
583
584 /*
585 #ifndef CloseTrkSes_Immed
586 #define CloseTrkSes_Immed 0x01
587
588 #define CloseTrkSes_Trk 0x01
589 #define CloseTrkSes_Ses 0x02
590
591 #define CloseTrkSes_LastTrkSes 0xff
592 #endif
593 */
594
595 typedef struct _CLOSE_TRK_SES_USER_IN {
596 union {
597 UCHAR Flags;
598 struct {
599 UCHAR Immed : 1;
600 UCHAR Reserved0 : 7;
601 } Fields;
602 } Byte1;
603 union {
604 UCHAR Flags;
605 struct {
606 UCHAR Track : 1;
607 UCHAR Session : 1;
608 UCHAR Reserved0 : 6;
609 } Fields;
610 } Byte2;
611 UCHAR TrackNum;
612 } CLOSE_TRK_SES_USER_IN, *PCLOSE_TRK_SES_USER_IN;
613
614 //**********************************************************************************************
615
616 typedef struct _PREVENT_MEDIA_REMOVAL_USER_IN {
617 BOOLEAN PreventMediaRemoval;
618 } PREVENT_MEDIA_REMOVAL_USER_IN, *PPREVENT_MEDIA_REMOVAL_USER_IN;
619
620 //**********************************************************************************************
621
622 typedef struct _SET_RANDOM_ACCESS_USER_IN {
623 BOOLEAN RandomAccessMode;
624 } SET_RANDOM_ACCESS_USER_IN, *PSET_RANDOM_ACCESS_USER_IN;
625
626 //**********************************************************************************************
627
628 /*
629 #ifndef DiscInfo_Disk_Mask
630 #define DiscInfo_Disk_Mask 0x03
631 #define DiscInfo_Disk_Empty 0x00
632 #define DiscInfo_Disk_Appendable 0x01
633 #define DiscInfo_Disk_Complete 0x02
634
635 #define DiscInfo_Ses_Mask 0x0C
636 #define DiscInfo_Ses_Empty 0x00
637 #define DiscInfo_Ses_Incomplete 0x04
638 #define DiscInfo_Ses_Complete 0x0C
639
640 #define DiscInfo_Disk_Erasable 0x10
641
642 #define DiscInfo_URU 0x10
643 #define DiscInfo_DBC_V 0x20
644 #define DiscInfo_DID_V 0x40
645
646 #define DiscInfo_Type_cdrom 0x00 // CD-DA / CD-ROM
647 #define DiscInfo_Type_cdi 0x10 // CD-I
648 #define DiscInfo_Type_cdromxa 0x20 // CD-ROM XA
649 #define DiscInfo_Type_unknown 0xFF // HZ ;)
650
651 #endif
652 */
653
654 typedef struct _DISC_STATUS_INFO_USER_OUT {
655 UCHAR ErrorCode;
656 UCHAR SenseKey;
657 UCHAR AdditionalSenseCode;
658 UCHAR AdditionalSenseCodeQualifier;
659 UCHAR SrbStatus;
660 BOOLEAN RandomAccessMode;
661 BOOLEAN CUE_sent;
662 UCHAR Flags;
663 LARGE_INTEGER MediaChangeTime;
664
665 UCHAR LastSesLeadInMSF[4];
666 UCHAR LastSesLeadOutMSF[4];
667
668 ULONG NumOfSes;
669 ULONG FirstTrackNumLastSes;
670 ULONG LastTrackNumLastSes;
671 ULONG Reserved1; // this is used to align data
672
673 } DISC_STATUS_INFO_USER_OUT, *PDISC_STATUS_INFO_USER_OUT;
674
675 #define DiscStatus_Formattable 0x01
676
677 typedef struct _DISC_INFO_BLOCK_USER_OUT { //
678
679 DISC_STATUS_INFO_USER_OUT Status;
680
681 USHORT DataLength;
682
683 union {
684 UCHAR Flags;
685 struct {
686 UCHAR DiscStat : 2;
687 UCHAR LastSesStat : 2;
688 UCHAR Erasable : 1;
689 UCHAR Reserved0: 3;
690 } Fields;
691 } DiscStat;
692
693 UCHAR FirstTrackNum;
694 UCHAR NumOfSes;
695 UCHAR FirstTrackNumLastSes;
696 UCHAR LastTrackNumLastSes;
697
698 union {
699 UCHAR Flags;
700 struct {
701 UCHAR Reserved1: 5;
702 UCHAR URU : 1;
703 UCHAR DBC_V : 1; // 0
704 UCHAR DID_V : 1;
705 } Fields;
706 } Flags;
707
708 UCHAR DiskType;
709 UCHAR NumOfSes2; // MSB MMC-3
710 UCHAR FirstTrackNumLastSes2; // MSB MMC-3
711 UCHAR LastTrackNumLastSes2; // MSB MMC-3
712 UCHAR DiskId [4];
713 ULONG LastSesLeadInLBA;
714 ULONG LastSesLeadOutLBA;
715 UCHAR DiskBarCode [8];
716 UCHAR Reserved3;
717 UCHAR OPCNum;
718 } DISC_INFO_BLOCK_USER_OUT, *PDISC_INFO_BLOCK_USER_OUT;
719
720 //**********************************************************************************************
721
722 typedef struct _TEST_UNIT_READY_USER_IN {
723 ULONG MaxReadyRetry;
724 } TEST_UNIT_READY_USER_IN, *PTEST_UNIT_READY_USER_IN;
725
726 typedef struct _TEST_UNIT_READY_USER_OUT {
727 UCHAR ErrorCode;
728 UCHAR SenseKey;
729 UCHAR AdditionalSenseCode;
730 UCHAR AdditionalSenseCodeQualifier;
731 } TEST_UNIT_READY_USER_OUT, *PTEST_UNIT_READY_USER_OUT;
732
733 //**********************************************************************************************
734
735 /*
736 #ifndef MediaType_Unknown
737
738 #define MediaType_Unknown 0x00
739 #define MediaType_120mm_CDROM_DataOnly 0x01
740 #define MediaType_120mm_CDROM_AudioOnly 0x02 //CDDA
741 #define MediaType_120mm_CDROM_DataAudioCombined 0x03
742 #define MediaType_120mm_CDROM_Hybrid_PhotoCD 0x04
743 #define MediaType_80mm_CDROM_DataOnly 0x05
744 #define MediaType_80mm_CDROM_AudioOnly 0x06 //CDDA
745 #define MediaType_80mm_CDROM_DataAudioCombined 0x07
746 #define MediaType_80mm_CDROM_Hybrid_PhotoCD 0x08
747
748 #define MediaType_UnknownSize_CDR 0x10
749 #define MediaType_120mm_CDR_DataOnly 0x11
750 #define MediaType_120mm_CDR_AudioOnly 0x12 //CDDA
751 #define MediaType_120mm_CDR_DataAudioCombined 0x13
752 #define MediaType_120mm_CDR_Hybrid_PhotoCD 0x14
753 #define MediaType_80mm_CDR_DataOnly 0x15
754 #define MediaType_80mm_CDR_AudioOnly 0x16 //CDDA
755 #define MediaType_80mm_CDR_DataAudioCombined 0x17
756 #define MediaType_80mm_CDR_Hybrid_Photo_CD 0x18
757
758 #define MediaType_UnknownSize_CDRW 0x20
759 #define MediaType_120mm_CDRW_DataOnly 0x21
760 #define MediaType_120mm_CDRW_AudioOnly 0x22 //CDDA
761 #define MediaType_120mm_CDRW_DataAudioCombined 0x23
762 #define MediaType_120mm_CDRW_Hybrid 0x24
763 #define MediaType_80mm_CDRW_DataOnly 0x25
764 #define MediaType_80mm_CDRW_AudioOnly 0x26 //CDDA
765 #define MediaType_80mm_CDRW_DataAudioCombined 0x27
766 #define MediaType_80mm_CDRW_Hybrid 0x28
767
768 #define MediaType_UnknownSize_Unknown 0x30
769
770 #define MediaType_NoDiscPresent 0x70
771 #define MediaType_DoorOpen 0x71
772
773 #endif
774 */
775
776 typedef struct _GET_MEDIA_TYPE_USER_OUT {
777 UCHAR MediaType;
778 } GET_MEDIA_TYPE_USER_OUT, *PGET_MEDIA_TYPE_USER_OUT;
779
780 typedef struct _GET_MEDIA_TYPE_EX_USER_OUT {
781 UCHAR OldStyleMediaType; // see GET_MEDIA_TYPE_USER_OUT
782 UCHAR MediaClass;
783 UCHAR MediaSize;
784 UCHAR DataType;
785 UCHAR MediaClassEx;
786 UCHAR DataClassEx;
787 UCHAR CapFlags;
788 UCHAR Layers; // Number of layers - 1 (e.g. 0 => 1 layer)
789 UCHAR Reserved[8]; // for future implementation
790 } GET_MEDIA_TYPE_EX_USER_OUT, *PGET_MEDIA_TYPE_EX_USER_OUT;
791
792 #define CdMediaClass_CDROM 0x00
793 #define CdMediaClass_CDR 0x01
794 #define CdMediaClass_CDRW 0x02
795 #define CdMediaClass_DVDROM 0x03
796 #define CdMediaClass_DVDRAM 0x05
797 #define CdMediaClass_DVDR 0x06
798 #define CdMediaClass_DVDRW 0x07
799 #define CdMediaClass_DVDpR 0x08
800 #define CdMediaClass_DVDpRW 0x09
801 #define CdMediaClass_DDCDROM 0x0a
802 #define CdMediaClass_DDCDR 0x0b
803 #define CdMediaClass_DDCDRW 0x0c
804 #define CdMediaClass_BDROM 0x0d
805 #define CdMediaClass_BDRE 0x0e
806 #define CdMediaClass_BDR 0x0f
807 #define CdMediaClass_HD_DVDROM 0x10
808 #define CdMediaClass_HD_DVDRAM 0x11
809 #define CdMediaClass_HD_DVDR 0x12
810 #define CdMediaClass_HD_DVDRW 0x13
811 #define CdMediaClass_NoDiscPresent 0x70
812 #define CdMediaClass_DoorOpen 0x71
813 #define CdMediaClass_Unknown 0xff
814
815 #define CdMediaClass_Max CdMediaClass_HD_DVDRW
816
817 #define CdMediaSize_Unknown 0
818 #define CdMediaSize_120mm 1
819 #define CdMediaSize_80mm 2
820
821 #define CdDataType_Unknown 0
822 #define CdDataType_DataOnly 1
823 #define CdDataType_AudioOnly 2 //CDDA
824 #define CdDataType_DataAudioCombined 3
825 #define CdDataType_Hybrid 4
826 #define CdDataType_DataOnlyMRW 5
827
828 #define CdMediaClassEx_CD 0x00
829 #define CdMediaClassEx_DVD 0x01
830 #define CdMediaClassEx_DDCD 0x02
831 #define CdMediaClassEx_BD 0x03
832 #define CdMediaClassEx_HD_DVD 0x04
833 #define CdMediaClassEx_None 0x70
834 #define CdMediaClassEx_Unknown 0xff
835
836 #define CdDataClassEx_ROM 0x00
837 #define CdDataClassEx_R 0x01
838 #define CdDataClassEx_RW 0x02
839 #define CdDataClassEx_Unknown 0xff
840
841 #define CdCapFlags_Writable 0x01
842 #define CdCapFlags_Erasable 0x02
843 #define CdCapFlags_Formatable 0x04
844 #define CdCapFlags_WriteParamsReq 0x08
845 #define CdCapFlags_RandomWritable 0x10
846 #define CdCapFlags_Cav 0x20
847
848 #define CdrwMediaClassEx_IsRAM(MediaClassEx) ( \
849 ((MediaClassEx) == CdMediaClass_DVDRAM) || \
850 ((MediaClassEx) == CdMediaClass_BDRE) || \
851 ((MediaClassEx) == CdMediaClass_HD_DVDRAM) )
852
853 #define CdrwIsDvdOverwritable(MediaClassEx) \
854 ((MediaClassEx) == CdMediaClass_DVDRW || \
855 (MediaClassEx) == CdMediaClass_DVDpRW || \
856 (MediaClassEx) == CdMediaClass_DVDRAM || \
857 (MediaClassEx) == CdMediaClass_BDRE || \
858 (MediaClassEx) == CdMediaClass_HD_DVDRW || \
859 (MediaClassEx) == CdMediaClass_HD_DVDRAM \
860 )
861
862 //**********************************************************************************************
863
864 /*
865 #ifndef MAX_PAGE_SIZE
866 #define MAX_PAGE_SIZE 0x100
867 #endif
868 */
869
870 typedef struct _MODE_SENSE_USER_IN {
871 union {
872 UCHAR Byte;
873 struct {
874 UCHAR PageCode : 6;
875 UCHAR Reserved0: 1;
876 UCHAR PageSavable : 1;
877 } Fields;
878 } PageCode;
879 } MODE_SENSE_USER_IN, *PMODE_SENSE_USER_IN;
880
881 typedef struct _MODE_SENSE_USER_OUT {
882 MODE_PARAMETER_HEADER Header;
883 } MODE_SENSE_USER_OUT, *PMODE_SENSE_USER_OUT;
884
885 //**********************************************************************************************
886
887 typedef struct _MODE_SELECT_USER_IN {
888 MODE_PARAMETER_HEADER Header;
889 } MODE_SELECT_USER_IN, *PMODE_SELECT_USER_IN;
890
891 //**********************************************************************************************
892
893 typedef struct _MODE_WRITE_PARAMS_PAGE_USER { // 0x05
894 UCHAR PageCode : 6;
895 UCHAR Reserved0: 1;
896 UCHAR PageSavable : 1;
897
898 UCHAR PageLength; // 0x32
899
900 /*
901 #ifndef WParam_WType_Mask
902 #define WParam_WType_Mask 0x0f
903 #define WParam_WType_Packet 0x00
904 #define WParam_WType_TAO 0x01
905 #define WParam_WType_Ses 0x02
906 #define WParam_WType_Raw 0x03
907 #define WParam_TestWrite 0x10
908 #define WParam_LS_V 0x20
909 #define WParam_BUFF 0x40
910 #endif
911 */
912
913 union {
914 UCHAR Flags;
915 struct {
916 UCHAR WriteType: 4; // 1
917 UCHAR TestWrite: 1;
918 UCHAR LS_V: 1;
919 UCHAR BUFF: 1;
920 UCHAR Reserved1: 1;
921 } Fields;
922 } Byte2;
923
924 /*
925 #ifndef WParam_TrkMode_Mask
926 #define WParam_TrkMode_Mask 0x0f
927 #define WParam_TrkMode_None 0x00
928 #define WParam_TrkMode_Audio 0x00
929 #define WParam_TrkMode_Audio_PreEmph 0x01
930 #define WParam_TrkMode_Data 0x04
931 #define WParam_TrkMode_IncrData 0x05
932 #define WParam_TrkMode_QAudio_PreEmph 0x08
933 #define WParam_TrkMode_AllowCpy 0x02
934 #define WParam_Copy 0x10
935 #define WParam_FP 0x20
936 #define WParam_MultiSes_Mask 0xc0
937 #define WParam_Multises_None 0x00
938 #define WParam_Multises_Final 0x80
939 #define WParam_Multises_Multi 0xc0
940 #endif
941 */
942
943 union {
944 UCHAR Flags;
945 struct {
946 UCHAR TrackMode: 4; // 4
947 UCHAR Copy : 1; // 0
948 UCHAR FP : 1; // 0
949 UCHAR Multisession: 2; // 11
950 } Fields;
951 } Byte3;
952
953 /*
954 #ifndef WParam_BlkType_Mask
955 #define WParam_BlkType_Mask 0x0f
956 #define WParam_BlkType_Raw_2352 0x00
957 #define WParam_BlkType_RawPQ_2368 0x01
958 #define WParam_BlkType_RawPW_2448 0x02
959 #define WParam_BlkType_RawPW_R_2448 0x03
960 #define WParam_BlkType_M1_2048 0x08
961 #define WParam_BlkType_M2_2336 0x09
962 #define WParam_BlkType_M2XAF1_2048 0x0a
963 #define WParam_BlkType_M2XAF1SH_2056 0x0b
964 #define WParam_BlkType_M2XAF2_2324 0x0c
965 #define WParam_BlkType_M2XAFXSH_2332 0x0d
966 #endif
967 */
968
969 union {
970 UCHAR Flags;
971 struct {
972 UCHAR DataBlockType: 4; // 8
973 UCHAR Reserved2: 4;
974 } Fields;
975 } Byte4;
976
977 UCHAR LinkSize;
978 UCHAR Reserved3;
979
980 union {
981 UCHAR Flags;
982 struct {
983 UCHAR HostAppCode : 6; // 0
984 UCHAR Reserved4: 2;
985 } Fields;
986 } Byte7;
987
988 /*
989 #ifndef WParam_SesFmt_CdRom
990 #define WParam_SesFmt_CdRom 0x00
991 #define WParam_SesFmt_CdI 0x10
992 #define WParam_SesFmt_CdRomXa 0x20
993 #endif
994 */
995
996 UCHAR SesFmt; // 0
997 UCHAR Reserved5;
998 ULONG PacketSize; // 0
999 USHORT AudioPause; // 150
1000
1001 UCHAR Reserved6: 7;
1002 UCHAR MCVAL : 1;
1003
1004 UCHAR N[13];
1005 UCHAR Zero;
1006 UCHAR AFRAME;
1007
1008 UCHAR Reserved7: 7;
1009 UCHAR TCVAL : 1;
1010
1011 UCHAR I[12];
1012 UCHAR Zero_2;
1013 UCHAR AFRAME_2;
1014 UCHAR Reserved8;
1015
1016 struct {
1017 union {
1018 UCHAR MSF[3];
1019 struct _SubHdrParams1 {
1020 UCHAR FileNum;
1021 UCHAR ChannelNum;
1022
1023 /*
1024 #define WParam_SubHdr_SubMode0 0x00
1025 #define WParam_SubHdr_SubMode1 0x08
1026 */
1027
1028 UCHAR SubMode;
1029 } Params1;
1030 } Params;
1031
1032 /*
1033 #define WParam_SubHdr_Mode_Mask 0x03
1034 #define WParam_SubHdr_Mode0 0x00
1035 #define WParam_SubHdr_Mode1 0x01
1036 #define WParam_SubHdr_Mode2 0x02
1037 #define WParam_SubHdr_Format_Mask 0xe0
1038 #define WParam_SubHdr_Format_UserData 0x00
1039 #define WParam_SubHdr_Format_RunIn4 0x20
1040 #define WParam_SubHdr_Format_RunIn3 0x40
1041 #define WParam_SubHdr_Format_RunIn2 0x60
1042 #define WParam_SubHdr_Format_RunIn1 0x80
1043 #define WParam_SubHdr_Format_Link 0xa0
1044 #define WParam_SubHdr_Format_RunOut2 0xc0
1045 #define WParam_SubHdr_Format_RunOut1 0xe0
1046 */
1047
1048 union {
1049 UCHAR Flags;
1050 struct {
1051 UCHAR Mode : 2;
1052 UCHAR Reserved : 3;
1053 UCHAR Format : 3;
1054 } Fields;
1055 } Mode;
1056 } SubHeader;
1057 } MODE_WRITE_PARAMS_PAGE_USER, *PMODE_WRITE_PARAMS_PAGE_USER;
1058
1059 typedef MODE_WRITE_PARAMS_PAGE_USER GET_WRITE_MODE_USER_OUT;
1060 typedef PMODE_WRITE_PARAMS_PAGE_USER PGET_WRITE_MODE_USER_OUT;
1061
1062 typedef MODE_WRITE_PARAMS_PAGE_USER SET_WRITE_MODE_USER_IN;
1063 typedef PMODE_WRITE_PARAMS_PAGE_USER PSET_WRITE_MODE_USER_IN;
1064
1065 //**********************************************************************************************
1066
1067 #ifndef WITHOUT_FORMATTER
1068
1069 typedef MODE_MRW_PAGE GET_MRW_MODE_USER_OUT;
1070 typedef PMODE_MRW_PAGE PGET_MRW_MODE_USER_OUT;
1071
1072 typedef MODE_MRW_PAGE SET_MRW_MODE_USER_IN;
1073 typedef PMODE_MRW_PAGE PSET_MRW_MODE_USER_IN;
1074
1075 #endif //WITHOUT_FORMATTER
1076
1077 //**********************************************************************************************
1078
1079 typedef struct _SET_READ_AHEAD_USER_IN {
1080 ULONG TriggerLBA;
1081 ULONG ReadAheadLBA;
1082 } SET_READ_AHEAD_USER_IN, *PSET_READ_AHEAD_USER_IN;
1083
1084 //**********************************************************************************************
1085
1086 typedef struct _GET_CAPABILITIES_USER_OUT {
1087 UCHAR PageCode : 6;
1088 UCHAR Reserved1 : 1;
1089 UCHAR PSBit : 1;
1090
1091 UCHAR PageLength;
1092
1093 /*
1094 #ifndef DevCap_read_cd_r
1095 #define DevCap_read_cd_r 0x01 // reserved in 1.2
1096 #define DevCap_read_cd_rw 0x02 // reserved in 1.2
1097 #define DevCap_method2 0x04
1098 #define DevCap_read_dvd_rom 0x08
1099 #define DevCap_read_dvd_r 0x10
1100 #define DevCap_read_dvd_ram 0x20
1101 #endif //DevCap_cd_r_read
1102 */
1103
1104 UCHAR ReadCap; // DevCap_*_read
1105 /* UCHAR cd_r_read : 1; // reserved in 1.2
1106 UCHAR cd_rw_read : 1; // reserved in 1.2
1107 UCHAR method2 : 1;
1108 UCHAR dvd_rom : 1;
1109 UCHAR dvd_r_read : 1;
1110 UCHAR dvd_ram_read : 1;
1111 UCHAR Reserved2 : 2;*/
1112
1113 /*
1114 #ifndef DevCap_write_cd_r
1115 #define DevCap_write_cd_r 0x01 // reserved in 1.2
1116 #define DevCap_write_cd_rw 0x02 // reserved in 1.2
1117 #define DevCap_test_write 0x04
1118 #define DevCap_write_dvd_r 0x10
1119 #define DevCap_write_dvd_ram 0x20
1120 #endif //DevCap_cd_r_write
1121 */
1122
1123 UCHAR WriteCap; // DevCap_*_write
1124 /* UCHAR cd_r_write : 1; // reserved in 1.2
1125 UCHAR cd_rw_write : 1; // reserved in 1.2
1126 UCHAR dvd_ram_write : 1;
1127 UCHAR dvd_r_write : 1;
1128 UCHAR reserved3a : 1;
1129 UCHAR test_write : 1;
1130 UCHAR Reserved3 : 2;*/
1131
1132 /*
1133 #ifndef DevCap_audio_play
1134 #define DevCap_audio_play 0x01
1135 #define DevCap_composite 0x02
1136 #define DevCap_digport1 0x04
1137 #define DevCap_digport2 0x08
1138 #define DevCap_mode2_form1 0x10
1139 #define DevCap_mode2_form2 0x20
1140 #define DevCap_multisession 0x40
1141 #endif //DevCap_audio_play
1142 */
1143
1144 UCHAR Capabilities0;
1145 /* UCHAR audio_play : 1;
1146 UCHAR composite : 1;
1147 UCHAR digport1 : 1;
1148 UCHAR digport2 : 1;
1149 UCHAR mode2_form1 : 1;
1150 UCHAR mode2_form2 : 1;
1151 UCHAR multisession : 1;
1152 UCHAR Reserved4 : 1;*/
1153
1154 /*
1155 #ifndef DevCap_cdda
1156 #define DevCap_cdda 0x01
1157 #define DevCap_cdda_accurate 0x02
1158 #define DevCap_rw_supported 0x04
1159 #define DevCap_rw_corr 0x08
1160 #define DevCap_c2_pointers 0x10
1161 #define DevCap_isrc 0x20
1162 #define DevCap_upc 0x40
1163 #define DevCap_read_bar_code 0x80
1164 #endif //DevCap_cdda
1165 */
1166
1167 UCHAR Capabilities1;
1168 /* UCHAR cdda : 1;
1169 UCHAR cdda_accurate : 1;
1170 UCHAR rw_supported : 1;
1171 UCHAR rw_corr : 1;
1172 UCHAR c2_pointers : 1;
1173 UCHAR isrc : 1;
1174 UCHAR upc : 1;
1175 UCHAR Reserved5 : 1;*/
1176
1177 /*
1178 #ifndef DevCap_lock
1179 #define DevCap_lock 0x01
1180 #define DevCap_lock_state 0x02
1181 #define DevCap_prevent_jumper 0x04
1182 #define DevCap_eject 0x08
1183 #define DevCap_mechtype_mask 0xE0
1184 #define DevCap_mechtype_caddy 0x00
1185 #define DevCap_mechtype_tray (0x01<<5)
1186 #define DevCap_mechtype_popup (0x02<<5)
1187 #define DevCap_mechtype_individual_changer (0x04<<5)
1188 #define DevCap_mechtype_cartridge_changer (0x05<<5)
1189 #endif //DevCap_lock
1190 */
1191
1192 UCHAR Capabilities2;
1193 /* UCHAR lock : 1;
1194 UCHAR lock_state : 1;
1195 UCHAR prevent_jumper : 1;
1196 UCHAR eject : 1;
1197 UCHAR Reserved6 : 1;
1198 UCHAR mechtype : 3;*/
1199
1200 /*
1201 #ifndef DevCap_separate_volume
1202 #define DevCap_separate_volume 0x01
1203 #define DevCap_separate_mute 0x02
1204 #define DevCap_disc_present 0x04 // reserved in 1.2
1205 #define DevCap_sw_slot_select 0x08 // reserved in 1.2
1206 #define DevCap_change_side_cap 0x10
1207 #define DevCap_rw_leadin_read 0x20
1208 #endif //DevCap_separate_volume
1209 */
1210
1211 UCHAR Capabilities3;
1212 /* UCHAR separate_volume : 1;
1213 UCHAR separate_mute : 1;
1214 UCHAR disc_present : 1; // reserved in 1.2
1215 UCHAR sss : 1; // reserved in 1.2
1216 UCHAR Reserved7 : 4;*/
1217
1218 USHORT MaximumSpeedSupported;
1219 USHORT NumberVolumeLevels;
1220 USHORT BufferSize;
1221 USHORT CurrentSpeed;
1222
1223 UCHAR Reserved8;
1224
1225 UCHAR SpecialParameters0;
1226 /* UCHAR Reserved9 : 1;
1227 UCHAR BCK : 1;
1228 UCHAR RCK : 1;
1229 UCHAR LSBF : 1;
1230 UCHAR Length : 2;
1231 UCHAR Reserved10 : 2;*/
1232
1233 USHORT MaximumWriteSpeedSupported;
1234 USHORT CurrentWriteSpeed;
1235 USHORT CopyManagementRevision;
1236 UCHAR Reserved11[2];
1237
1238 } GET_CAPABILITIES_USER_OUT, *PGET_CAPABILITIES_USER_OUT;
1239
1240 typedef struct _GET_CAPABILITIES_3_USER_OUT {
1241
1242 UCHAR PageCode : 6;
1243 UCHAR Reserved1 : 1;
1244 UCHAR PSBit : 1;
1245
1246 UCHAR PageLength;
1247 UCHAR ReadCap; // DevCap_*_read
1248 UCHAR WriteCap; // DevCap_*_write
1249 UCHAR Capabilities0;
1250 UCHAR Capabilities1;
1251 UCHAR Capabilities2;
1252 UCHAR Capabilities3;
1253 USHORT MaximumSpeedSupported;
1254 USHORT NumberVolumeLevels;
1255 USHORT BufferSize;
1256 USHORT CurrentSpeed;
1257
1258 UCHAR Reserved8;
1259 UCHAR SpecialParameters0;
1260
1261 USHORT MaximumWriteSpeedSupported;
1262 USHORT CurrentWriteSpeed;
1263 USHORT CopyManagementRevision;
1264 UCHAR Reserved11[2];
1265
1266 // MMC 3
1267
1268 UCHAR Reserved12;
1269
1270 UCHAR SpecialParameters1;
1271 /* UCHAR RCS : 2; // rotation control selected
1272 UCHAR Reserved13 : 6; */
1273
1274 USHORT CurrentWriteSpeed3;
1275 USHORT LunWPerfDescriptorCount;
1276
1277 // LUN_WRITE_PERF_DESC_USER WritePerfDescs[0];
1278
1279 } GET_CAPABILITIES_3_USER_OUT, *PGET_CAPABILITIES_3_USER_OUT;
1280
1281 typedef struct _LUN_WRITE_PERF_DESC_USER {
1282 UCHAR Reserved;
1283
1284 #define LunWPerf_RotCtrl_Mask 0x07
1285 #define LunWPerf_RotCtrl_CLV 0x00
1286 #define LunWPerf_RotCtrl_CAV 0x01
1287
1288 UCHAR RotationControl;
1289 USHORT WriteSpeedSupported; // kbps
1290
1291 } LUN_WRITE_PERF_DESC_USER, *PLUN_WRITE_PERF_DESC_USER;
1292
1293 //**********************************************************************************************
1294
1295 typedef struct _SEND_OPC_INFO_USER_IN {
1296 USHORT Speed;
1297 UCHAR OpcValue[6];
1298 } SEND_OPC_INFO_USER_IN, *PSEND_OPC_INFO_USER_IN;
1299
1300 typedef struct _SEND_OPC_INFO_HEADER_USER_IN {
1301 BOOLEAN DoOpc;
1302 USHORT OpcBlocksNumber;
1303 } SEND_OPC_INFO_HEADER_USER_IN, *PSEND_OPC_INFO_HEADER_USER_IN;
1304
1305 //**********************************************************************************************
1306
1307 typedef struct _LL_READ_USER_IN {
1308
1309 #define ReadCd_BlkType_Mask 0x1c
1310 #define ReadCd_BlkType_Any (0x00<<2)
1311 #define ReadCd_BlkType_CDDA (0x01<<2)
1312 #define ReadCd_BlkType_M1 (0x02<<2)
1313 #define ReadCd_BlkType_M2FX (0x03<<2)
1314 #define ReadCd_BlkType_M2F1 (0x04<<2)
1315 #define ReadCd_BlkType_M2F2 (0x05<<2)
1316
1317 UCHAR ExpectedBlkType;
1318
1319 ULONG LBA; // negative value (-1) indicates tha (H)MSF must be used
1320 ULONG NumOfBlocks;
1321
1322 #define ReadCd_Error_Mask 0x0006
1323 #define ReadCd_Error_None 0x0000
1324 #define ReadCd_Error_C2 0x0002
1325 #define ReadCd_Error_C2ex 0x0004
1326 #define ReadCd_Include_EDC 0x0008
1327 #define ReadCd_Include_UsrData 0x0010
1328 #define ReadCd_Header_Mask 0x0060
1329 #define ReadCd_Header_None 0x0000
1330 #define ReadCd_Header_Hdr 0x0020
1331 #define ReadCd_Header_SubHdr 0x0040
1332 #define ReadCd_Header_AllHdr 0x0060
1333 #define ReadCd_Include_SyncData 0x0080
1334 #define ReadCd_SubChan_Mask 0x0700
1335 #define ReadCd_SubChan_None 0x0000
1336 #define ReadCd_SubChan_Raw 0x0100
1337 #define ReadCd_SubChan_Q 0x0200
1338 #define ReadCd_SubChan_PW 0x0400
1339 #define ReadCd_SubChan_All ReadCd_SubChan_Mask
1340
1341 union {
1342 USHORT Flags;
1343 struct {
1344 UCHAR Reserved2 : 1;
1345 UCHAR ErrorFlags : 2;
1346 UCHAR IncludeEDC : 1;
1347 UCHAR IncludeUserData : 1;
1348 UCHAR HeaderCode : 2;
1349 UCHAR IncludeSyncData : 1;
1350
1351 UCHAR SubChannelSelection : 3;
1352 UCHAR Reserved3 : 5;
1353 } Fields;
1354 } Flags;
1355
1356 BOOLEAN UseMFS;
1357 CHAR Starting_MSF[3];
1358 CHAR Ending_MSF[3];
1359
1360 } LL_READ_USER_IN, *PLL_READ_USER_IN;
1361
1362 //**********************************************************************************************
1363
1364 typedef struct _GET_LAST_ERROR_USER_OUT {
1365
1366 UCHAR ErrorCode;
1367 UCHAR SenseKey;
1368 UCHAR AdditionalSenseCode;
1369 UCHAR AdditionalSenseCodeQualifier;
1370 UCHAR SrbStatus;
1371 ULONG LastError;
1372 BOOLEAN RandomAccessMode;
1373 LARGE_INTEGER MediaChangeTime;
1374 ULONG MediaChangeCount;
1375
1376 } GET_LAST_ERROR_USER_OUT, *PGET_LAST_ERROR_USER_OUT;
1377
1378 //**********************************************************************************************
1379
1380 typedef enum _TRACK_MODE_TYPE {
1381 YellowMode2,
1382 XAForm2,
1383 CDDA
1384 } TRACK_MODE_TYPE, *PTRACK_MODE_TYPE;
1385
1386 typedef struct _RAW_READ_USER_IN {
1387 LARGE_INTEGER DiskOffset;
1388 ULONG SectorCount;
1389 TRACK_MODE_TYPE TrackMode;
1390 } RAW_READ_USER_IN, *PRAW_READ_USER_IN;
1391
1392 //**********************************************************************************************
1393
1394 typedef struct _PLAY_AUDIO_MSF_USER_IN {
1395 UCHAR StartingMSF[3];
1396 UCHAR EndingMSF[3];
1397 } PLAY_AUDIO_MSF_USER_IN, *PPLAY_AUDIO_MSF_USER_IN;
1398
1399 //**********************************************************************************************
1400
1401 #define AudioStatus_NotSupported 0x00
1402 #define AudioStatus_InProgress 0x11
1403 #define AudioStatus_Paused 0x12
1404 #define AudioStatus_PlayComplete 0x13
1405 #define AudioStatus_PlayError 0x14
1406 #define AudioStatus_NoStatus 0x15
1407
1408 typedef struct _SUB_Q_HEADER {
1409 UCHAR Reserved;
1410 UCHAR AudioStatus;
1411 UCHAR DataLength[2];
1412 } SUB_Q_HEADER, *PSUB_Q_HEADER;
1413
1414 typedef struct _SUB_Q_CURRENT_POSITION {
1415 SUB_Q_HEADER Header;
1416 UCHAR FormatCode;
1417 UCHAR Control : 4;
1418 UCHAR ADR : 4;
1419 UCHAR TrackNumber;
1420 UCHAR IndexNumber;
1421 UCHAR AbsoluteAddress[4];
1422 UCHAR TrackRelativeAddress[4];
1423 } SUB_Q_CURRENT_POSITION, *PSUB_Q_CURRENT_POSITION;
1424
1425 typedef struct _SUB_Q_MEDIA_CATALOG_NUMBER {
1426 SUB_Q_HEADER Header;
1427 UCHAR FormatCode;
1428 UCHAR Reserved[3];
1429 UCHAR Reserved1 : 7;
1430 UCHAR Mcval : 1;
1431 UCHAR MediaCatalog[15];
1432 } SUB_Q_MEDIA_CATALOG_NUMBER, *PSUB_Q_MEDIA_CATALOG_NUMBER;
1433
1434 typedef struct _SUB_Q_TRACK_ISRC {
1435 SUB_Q_HEADER Header;
1436 UCHAR FormatCode;
1437 UCHAR Reserved0;
1438 UCHAR Track;
1439 UCHAR Reserved1;
1440 UCHAR Reserved2 : 7;
1441 UCHAR Tcval : 1;
1442 UCHAR TrackIsrc[15];
1443 } SUB_Q_TRACK_ISRC, *PSUB_Q_TRACK_ISRC;
1444
1445 typedef union _SUB_Q_CHANNEL_DATA_USER_OUT {
1446 SUB_Q_CURRENT_POSITION CurrentPosition;
1447 SUB_Q_MEDIA_CATALOG_NUMBER MediaCatalog;
1448 SUB_Q_TRACK_ISRC TrackIsrc;
1449 } SUB_Q_CHANNEL_DATA_USER_OUT, *PSUB_Q_CHANNEL_DATA_USER_OUT;
1450
1451 #define IOCTL_CDROM_SUB_Q_CHANNEL 0x00
1452 #define IOCTL_CDROM_CURRENT_POSITION 0x01
1453 #define IOCTL_CDROM_MEDIA_CATALOG 0x02
1454 #define IOCTL_CDROM_TRACK_ISRC 0x03
1455
1456 typedef struct _SUB_Q_CHANNEL_DATA_USER_IN {
1457 UCHAR Format;
1458 UCHAR Track;
1459 } SUB_Q_CHANNEL_DATA_USER_IN, *PSUB_Q_CHANNEL_DATA_USER_IN;
1460
1461 //**********************************************************************************************
1462
1463 typedef struct _SEEK_AUDIO_MSF_USER_IN {
1464 UCHAR MSF[3];
1465 } SEEK_AUDIO_MSF_USER_IN, *PSEEK_AUDIO_MSF_USER_IN;
1466
1467 //**********************************************************************************************
1468
1469 typedef struct _AUDIO_CONTROL_USER_OUT {
1470 UCHAR LbaFormat;
1471 USHORT LogicalBlocksPerSecond;
1472 } AUDIO_CONTROL_USER_OUT, *PAUDIO_CONTROL_USER_OUT;
1473
1474 //**********************************************************************************************
1475
1476 typedef READ_TOC_TOC READ_TOC_USER_OUT;
1477 typedef PREAD_TOC_TOC PREAD_TOC_USER_OUT;
1478
1479 typedef READ_TOC_SES GET_LAST_SESSION_USER_OUT;
1480 typedef PREAD_TOC_SES PGET_LAST_SESSION_USER_OUT;
1481
1482 typedef READ_TOC_FULL_TOC READ_FULL_TOC_USER_OUT;
1483 typedef PREAD_TOC_FULL_TOC PREAD_FULL_TOC_USER_OUT;
1484
1485 typedef READ_TOC_FULL_TOC READ_PMA_USER_OUT;
1486 typedef PREAD_TOC_FULL_TOC PREAD_PMA_USER_OUT;
1487
1488 typedef READ_TOC_ATIP READ_ATIP_USER_OUT;
1489 typedef PREAD_TOC_ATIP PREAD_ATIP_USER_OUT;
1490
1491 typedef READ_TOC_CD_TEXT READ_CD_TEXT_USER_OUT;
1492 typedef PREAD_TOC_CD_TEXT PREAD_CD_TEXT_USER_OUT;
1493
1494 //**********************************************************************************************
1495
1496 typedef struct _VOLUME_CONTROL {
1497 UCHAR PortVolume[4];
1498 } VOLUME_CONTROL, *PVOLUME_CONTROL;
1499
1500 typedef VOLUME_CONTROL VOLUME_CONTROL_USER_IN;
1501 typedef PVOLUME_CONTROL PVOLUME_CONTROL_USER_IN;
1502
1503 typedef VOLUME_CONTROL VOLUME_CONTROL_USER_OUT;
1504 typedef PVOLUME_CONTROL PVOLUME_CONTROL_USER_OUT;
1505
1506 //**********************************************************************************************
1507
1508 typedef struct _INIT_DEINIT_USER_IN {
1509 BOOLEAN PassThrough;
1510 BOOLEAN Reserved; // For separate device (de)initialization
1511 } INIT_DEINIT_USER_IN, *PINIT_DEINIT_USER_IN;
1512
1513 typedef INIT_DEINIT_USER_IN INIT_DEINIT_USER_OUT;
1514 typedef PINIT_DEINIT_USER_IN PINIT_DEINIT_USER_OUT;
1515
1516 //**********************************************************************************************
1517
1518 typedef struct _READ_SESSION_INFO_USER_IN {
1519 BOOLEAN UseLBA;
1520 UCHAR Session;
1521 } READ_SESSION_INFO_USER_IN, *PREAD_SESSION_INFO_USER_IN;
1522
1523 typedef READ_TOC_SES READ_SESSION_INFO_USER_OUT;
1524 typedef PREAD_TOC_SES PREAD_SESSION_INFO_USER_OUT;
1525
1526 //**********************************************************************************************
1527
1528 typedef struct _READ_TOC_EX_USER_IN {
1529 BOOLEAN UseLBA;
1530 UCHAR Track;
1531 } READ_TOC_EX_USER_IN, *PREAD_TOC_EX_USER_IN;
1532
1533 typedef READ_TOC_SES READ_TOC_EX_USER_OUT;
1534 typedef PREAD_TOC_SES PREAD_TOC_EX_USER_OUT;
1535
1536 //**********************************************************************************************
1537
1538 #define DefSession_LastAvailable 0xff
1539
1540 typedef struct _SET_DEFAULT_SESSION_USER_IN {
1541 UCHAR LastSes;
1542 } SET_DEFAULT_SESSION_USER_IN, *PSET_DEFAULT_SESSION_USER_IN;
1543
1544 //**********************************************************************************************
1545
1546 typedef struct _NOTIFY_MEDIA_CHANGE_USER_IN {
1547 BOOLEAN Autorun;
1548 } NOTIFY_MEDIA_CHANGE_USER_IN, *PNOTIFY_MEDIA_CHANGE_USER_IN;
1549
1550 //**********************************************************************************************
1551
1552 typedef DISK_GEOMETRY GET_DRIVE_GEOMETRY_USER_OUT;
1553 typedef PDISK_GEOMETRY PGET_DRIVE_GEOMETRY_USER_OUT;
1554
1555 //**********************************************************************************************
1556
1557 typedef struct _GET_DEVICE_INFO_OLD_USER_OUT {
1558 UCHAR WModes [4][16];
1559 UCHAR VendorId[25];
1560 UCHAR SimulatedWModes [4][16];
1561 ULONG DeviceNumber;
1562 ULONG Features;
1563 INQUIRYDATA InquiryData;
1564 ULONG Features2[4]; // form GET_CONFIG 0 - 128
1565 } GET_DEVICE_INFO_OLD_USER_OUT, *PGET_DEVICE_INFO_OLD_USER_OUT;
1566
1567 typedef struct _GET_DEVICE_INFO_USER_OUT {
1568 ULONG Tag;
1569 ULONG Length;
1570 UCHAR WModes [4][16];
1571 UCHAR VendorId[25];
1572 UCHAR SimulatedWModes [4][16];
1573 ULONG DeviceNumber;
1574 ULONG Features;
1575 INQUIRYDATA InquiryData;
1576 ULONG Features2[4]; // from GET_CONFIG
1577 ULONG Features2ex[64-4]; // from GET_CONFIG (reserved for higher values)
1578 ULONG WriteCaps; // CDRW_DEV_CAPABILITY_xxx
1579 ULONG ReadCaps; // CDRW_DEV_CAPABILITY_xxx
1580 } GET_DEVICE_INFO_USER_OUT, *PGET_DEVICE_INFO_USER_OUT;
1581
1582 #define CDRW_DEV_CAPABILITY_TAG 0xCA10AB11
1583
1584 #define WMODE_SUPPORTED 0x01
1585 #define WMODE_SUPPORTED_FP 0x02
1586 #define WMODE_SUPPORTED_VP 0x04
1587 #define WMODE_NOT_SUPPORTED 0xff
1588 #define WMODE_NOT_TESTED 0x00
1589
1590 #define CDRW_FEATURE_OPC 0x00000001 // use OPC regardless of OPCn in DISK_INFO
1591 #define CDRW_FEATURE_EVENT 0x00000002
1592 #define CDRW_FEATURE_GET_CFG 0x00000004
1593 #define CDRW_FEATURE_NO_LOCK_REP 0x00000008 // device doesn't report tray lock state
1594 #define CDRW_FEATURE_SYNC_ON_WRITE 0x00000010 // device preferes Sync Cache after each Write
1595 #define CDRW_FEATURE_BAD_RW_SEEK 0x00000020 // seek error occures with status Illegal Sector Mode For This Track
1596 // on old CdRoms when they attempt to read outer sectors on FP formatted
1597 // disk. Workaround: perform sequence of seeks from lower address
1598 // to required with step about 0x800 blocks.
1599 #define CDRW_FEATURE_FP_ADDRESSING_PROBLEM 0x00000040
1600 #define CDRW_FEATURE_MRW_ADDRESSING_PROBLEM 0x00000080
1601 #define CDRW_FEATURE_FORCE_SYNC_ON_WRITE 0x00000100 // device requires Sync Cache after each Write
1602 #define CDRW_FEATURE_BAD_DVD_LAST_LBA 0x00000200 // device cannot determile LastLba on not closed DVD disks
1603 #define CDRW_FEATURE_FULL_BLANK_ON_FORMAT 0x00000400 // device cannot format disk until it is full-blanked
1604 #define CDRW_FEATURE_STREAMING 0x00000800 // device supports streaming read/write
1605 #define CDRW_FEATURE_FORCE_SYNC_BEFORE_READ 0x00001000 // device requires Sync Cache on Write -> Read state transition
1606 #define CDRW_FEATURE_CHANGER 0x80000000
1607
1608 #define DEV_CAP_GET_PROFILE(arr, pf) \
1609 (((pf) > PFNUM_Max) ? 0 : (((arr)[(pf)/32] >> (pf)%32) & 1))
1610
1611 #define CDRW_DEV_CAPABILITY_CDROM ((ULONG)1 << CdMediaClass_CDROM )
1612 #define CDRW_DEV_CAPABILITY_CDR ((ULONG)1 << CdMediaClass_CDR )
1613 #define CDRW_DEV_CAPABILITY_CDRW ((ULONG)1 << CdMediaClass_CDRW )
1614 #define CDRW_DEV_CAPABILITY_DVDROM ((ULONG)1 << CdMediaClass_DVDROM )
1615 #define CDRW_DEV_CAPABILITY_DVDRAM ((ULONG)1 << CdMediaClass_DVDRAM )
1616 #define CDRW_DEV_CAPABILITY_DVDR ((ULONG)1 << CdMediaClass_DVDR )
1617 #define CDRW_DEV_CAPABILITY_DVDRW ((ULONG)1 << CdMediaClass_DVDRW )
1618 #define CDRW_DEV_CAPABILITY_DVDpR ((ULONG)1 << CdMediaClass_DVDpR )
1619 #define CDRW_DEV_CAPABILITY_DVDpRW ((ULONG)1 << CdMediaClass_DVDpRW )
1620 #define CDRW_DEV_CAPABILITY_DDCDROM ((ULONG)1 << CdMediaClass_DDCDROM)
1621 #define CDRW_DEV_CAPABILITY_DDCDR ((ULONG)1 << CdMediaClass_DDCDR )
1622 #define CDRW_DEV_CAPABILITY_DDCDRW ((ULONG)1 << CdMediaClass_DDCDRW )
1623
1624 //**********************************************************************************************
1625
1626 typedef ULONG CHECK_VERIFY_USER_OUT, *PCHECK_VERIFY_USER_OUT;
1627
1628 //**********************************************************************************************
1629
1630 /*
1631 #ifndef EventStat_Class_OpChange
1632 #define EventStat_Class_OpChange 0x01
1633 #define EventStat_Class_PM 0x02
1634 #define EventStat_Class_Media 0x04
1635 #define EventStat_Class_DevBusy 0x06
1636 #endif // end EventStat_Class_OpChange
1637 */
1638
1639 typedef struct _GET_EVENT_USER_IN {
1640 UCHAR EventClass;
1641 BOOLEAN Immed;
1642 } GET_EVENT_USER_IN, *PGET_EVENT_USER_IN;
1643
1644 typedef union _GET_EVENT_USER_OUT {
1645 EVENT_STAT_OPERATIONAL_BLOCK Operational;
1646 EVENT_STAT_PM_BLOCK PowerManagement;
1647 EVENT_STAT_EXT_REQ_BLOCK ExternalReq;
1648 EVENT_STAT_MEDIA_BLOCK MediaChange;
1649 EVENT_STAT_DEV_BUSY_BLOCK DeviceBusy;
1650 } GET_EVENT_USER_OUT, *PGET_EVENT_USER_OUT;
1651
1652 //**********************************************************************************************
1653
1654
1655 //**********************************************************************************************
1656
1657 typedef enum DVD_STRUCTURE_FORMAT {
1658 DvdPhysicalDescriptor,
1659 DvdCopyrightDescriptor,
1660 DvdDiskKeyDescriptor,
1661 DvdBCADescriptor,
1662 DvdManufacturerDescriptor,
1663 DvdMaxDescriptor
1664 } DVD_STRUCTURE_FORMAT, *PDVD_STRUCTURE_FORMAT;
1665
1666 typedef ULONG DVD_SESSION_ID, *PDVD_SESSION_ID;
1667
1668 typedef struct _DVD_READ_STRUCTURE_USER_IN {
1669 LARGE_INTEGER BlockByteOffset;
1670 DVD_STRUCTURE_FORMAT Format;
1671 DVD_SESSION_ID SessionId;
1672 UCHAR LayerNumber;
1673 } DVD_READ_STRUCTURE_USER_IN, *PDVD_READ_STRUCTURE_USER_IN;
1674
1675 typedef struct _DVD_READ_STRUCTURE_USER_OUT {
1676 USHORT Length;
1677 UCHAR Reserved[2];
1678 // UCHAR Data[0];
1679 } DVD_READ_STRUCTURE_USER_OUT, *PDVD_READ_STRUCTURE_USER_OUT;
1680
1681 //**********************************************************************************************
1682
1683 typedef struct _DVD_START_SESSION_USER_OUT {
1684 DVD_SESSION_ID SessionId;
1685 } DVD_START_SESSION_USER_OUT, *PDVD_START_SESSION_USER_OUT;
1686
1687 //**********************************************************************************************
1688
1689 typedef enum {
1690 DvdChallengeKey = 0x01,
1691 DvdBusKey1,
1692 DvdBusKey2,
1693 DvdTitleKey,
1694 DvdAsf,
1695 DvdSetRpcKey = 0x6,
1696 DvdGetRpcKey = 0x8,
1697 DvdDiskKey = 0x80,
1698 DvdInvalidateAGID = 0x3f
1699 } DVD_KEY_TYPE;
1700
1701 typedef struct _DVD_READ_KEY_USER_IN {
1702 ULONG KeyLength;
1703 DVD_SESSION_ID SessionId;
1704 DVD_KEY_TYPE KeyType;
1705 ULONG KeyFlags;
1706 union {
1707 HANDLE FileHandle;
1708 LARGE_INTEGER TitleOffset;
1709 } Parameters;
1710 // UCHAR KeyData[0];
1711 } DVD_READ_KEY_USER_IN, *PDVD_READ_KEY_USER_IN;
1712
1713 typedef DVD_READ_KEY_USER_IN DVD_COPY_PROTECT_KEY;
1714 typedef PDVD_READ_KEY_USER_IN PDVD_COPY_PROTECT_KEY;
1715
1716 typedef DVD_READ_KEY_USER_IN DVD_READ_KEY_USER_OUT;
1717 typedef PDVD_READ_KEY_USER_IN PDVD_READ_KEY_USER_OUT;
1718
1719 //**********************************************************************************************
1720
1721 typedef DVD_START_SESSION_USER_OUT DVD_END_SESSION_USER_IN;
1722 typedef PDVD_START_SESSION_USER_OUT PDVD_END_SESSION_USER_IN;
1723
1724 //**********************************************************************************************
1725
1726 typedef DVD_READ_KEY_USER_IN DVD_SEND_KEY_USER_IN;
1727 typedef PDVD_READ_KEY_USER_IN PDVD_SEND_KEY_USER_IN;
1728
1729 typedef struct _DVD_SET_RPC_KEY {
1730 UCHAR PreferredDriveRegionCode;
1731 UCHAR Reserved[3];
1732 } DVD_SET_RPC_KEY, * PDVD_SET_RPC_KEY;
1733
1734 //**********************************************************************************************
1735
1736 // Predefined (Mt. Fuji) key sizes
1737 // Add sizeof(DVD_COPY_PROTECT_KEY) to get allocation size for
1738 // the full key structure
1739
1740 #define DVD_CHALLENGE_KEY_LENGTH (12 + sizeof(DVD_COPY_PROTECT_KEY))
1741 #define DVD_BUS_KEY_LENGTH (8 + sizeof(DVD_COPY_PROTECT_KEY))
1742 #define DVD_TITLE_KEY_LENGTH (8 + sizeof(DVD_COPY_PROTECT_KEY))
1743 #define DVD_DISK_KEY_LENGTH (2048 + sizeof(DVD_COPY_PROTECT_KEY))
1744 #define DVD_RPC_KEY_LENGTH (sizeof(DVD_RPC_KEY) + sizeof(DVD_COPY_PROTECT_KEY))
1745 #define DVD_SET_RPC_KEY_LENGTH (sizeof(DVD_SET_RPC_KEY) + sizeof(DVD_COPY_PROTECT_KEY))
1746 #define DVD_ASF_LENGTH (sizeof(DVD_ASF) + sizeof(DVD_COPY_PROTECT_KEY))
1747
1748 //**********************************************************************************************
1749
1750 typedef struct _DISK_VERIFY_USER_IN {
1751 LONGLONG StartingOffset;
1752 ULONG Length;
1753 } DISK_VERIFY_USER_IN, *PDISK_VERIFY_USER_IN;
1754
1755 //**********************************************************************************************
1756
1757 typedef struct _CDROM_DISK_DATA_USER_OUT {
1758
1759 ULONG DiskData;
1760
1761 } CDROM_DISK_DATA_USER_OUT, *PCDROM_DISK_DATA_USER_OUT;
1762
1763 #define CDROM_DISK_AUDIO_TRACK (0x00000001)
1764 #define CDROM_DISK_DATA_TRACK (0x00000002)
1765
1766 //**********************************************************************************************
1767
1768 typedef struct _CDRW_RESET_DRIVER_USER_IN {
1769 BOOLEAN UnlockTray;
1770 BOOLEAN Reserved[3];
1771 ULONG MagicWord;
1772 } CDRW_RESET_DRIVER_USER_IN, *PCDRW_RESET_DRIVER_USER_IN;
1773
1774 //**********************************************************************************************
1775
1776 typedef struct _MediaTrackMap {
1777 ULONG FirstLba;
1778 ULONG LastLba;
1779 ULONG NWA;
1780 ULONG PacketSize;
1781 ULONG Session;
1782 UCHAR TrackParam;
1783 UCHAR DataParam;
1784 UCHAR NWA_V;
1785
1786 UCHAR Flags;
1787 #define TrackMap_AllowCopyBit_variated 0x01
1788 #define TrackMap_CopyBit_variated 0x02
1789 #define TrackMap_Try_variation 0x04
1790 #define TrackMap_Use_variation 0x08
1791 #define TrackMap_FixFPAddressing 0x10
1792 #define TrackMap_FixMRWAddressing 0x20
1793
1794 // are used only if FixFPAddressing is enabled
1795 ULONG TrackFPOffset;
1796 ULONG PacketFPOffset;
1797
1798 } MediaTrackMap, *PMediaTrackMap;
1799
1800 typedef struct _GET_DISK_LAYOUT_USER_OUT {
1801 ULONG Tag;
1802 ULONG Length;
1803 ULONG DiskLayoutFlags;
1804 // Number of last session
1805 ULONG LastSession;
1806 ULONG FirstTrackNum;
1807 ULONG LastTrackNum;
1808 // First & Last LBA of the last session
1809 ULONG FirstLBA;
1810 ULONG LastLBA;
1811 // Last writable LBA
1812 ULONG LastPossibleLBA;
1813 // First writable LBA
1814 ULONG NWA;
1815 // sector type map
1816 struct _MediaTrackMap* TrackMap;
1817 //
1818 ULONG BlockSize;
1819 ULONG WriteBlockSize;
1820 // disk state
1821 BOOLEAN FP_disc;
1822 UCHAR OPCNum;
1823 UCHAR MediaClassEx;
1824 UCHAR DiscStat;
1825 ULONG PhSerialNumber;
1826 UCHAR PhErasable;
1827 UCHAR PhDiskType;
1828 UCHAR MRWStatus;
1829 } GET_DISK_LAYOUT_USER_OUT, *PGET_DISK_LAYOUT_USER_OUT;
1830
1831 #define DiskLayout_FLAGS_TRACKMAP (0x00002000)
1832 #define DiskLayout_FLAGS_RAW_DISK (0x00040000)
1833
1834 //**********************************************************************************************
1835
1836 // Error codes returned by IOCTL_CDRW_GEL_LAST_ERROR
1837
1838 //#ifndef CDRW_ERR_NO_ERROR
1839
1840 #define CDRW_ERR_NO_ERROR 0x0000
1841 #define CDRW_ERR_WRITE_IN_PROGRESS_BUSY 0x0001
1842 #define CDRW_ERR_FORMAT_IN_PROGRESS_BUSY 0x0002
1843 #define CDRW_ERR_CLOSE_IN_PROGRESS_BUSY 0x0003
1844 #define CDRW_ERR_BAD_ADDR_ALIGNMENT 0x0004
1845 #define CDRW_ERR_BAD_SIZE_ALIGNMENT 0x0005
1846 #define CDRW_ERR_STREAM_LOSS 0x0006
1847 #define CDRW_ERR_TEST_WRITE_UNSUPPORTED 0x0007
1848 #define CDRW_ERR_UNHANDLED_WRITE_TYPE 0x0008
1849 #define CDRW_ERR_CANT_ALLOC_TMP_BUFFER 0x0009
1850 #define CDRW_ERR_BUFFER_IS_FULL 0x000a
1851 #define CDRW_ERR_VERIFY_REQUIRED 0x000b
1852 #define CDRW_ERR_PLAY_IN_PROGRESS_BUSY 0x000c
1853 #define CDRW_ERR_TOO_LONG_BLOCK_TO_TRANSFER 0x000d
1854 #define CDRW_ERR_INWALID_WRITE_PARAMETERS 0x000e // use SET_WRITE_PARAMS properly
1855 #define CDRW_ERR_INVALID_IO_BUFFER_ADDRESS 0x000f
1856 #define CDRW_ERR_INVALID_INPUT_BUFFER_SIZE 0x0010
1857 #define CDRW_ERR_INVALID_OUTPUT_BUFFER_SIZE 0x0011
1858 #define CDRW_ERR_UNRECOGNIZED_MEDIA 0x0012
1859 #define CDRW_ERR_MEDIA_WRITE_PROTECTED 0x0013
1860 #define CDRW_ERR_NO_MEDIA 0x0014
1861 #define CDRW_ERR_TRAY_OPEN 0x0015
1862 #define CDRW_ERR_MEDIA_NOT_APPENDABLE 0x0016
1863 #define CDRW_ERR_INVALID_LBA 0x0017
1864 #define CDRW_ERR_INVALID_FIXED_PACKET_SIZE 0x0018
1865 #define CDRW_ERR_INVALID_WRITE_TYPE_FOR_MEDIA 0x0019
1866 #define CDRW_ERR_CUE_SHEET_REQUIRED 0x001a // you sould send cue sheet before SAO
1867 #define CDRW_ERR_CANT_DEINIT_IN_CLASS_MODE 0x001b // there is no underlayered driver
1868 #define CDRW_ERR_INVALID_FORMAT_UNIT_SETTINGS 0x001c // use SET_WRITE_PARAMS properly before
1869 // calling FormatUnit
1870 #define CDRW_ERR_UNHANDLED_FORMAT_UNIT_MODE 0x001d // this mode is not supported by
1871 // Workaround module
1872 #define CDRW_ERR_CANT_READ_BUFFER_CAPACITY 0x001e
1873 #define CDRW_ERR_DEVICE_WRITE_ERROR 0x001f
1874 #define CDRW_ERR_UNHANDLED_IOCTL 0x0020
1875 #define CDRW_ERR_UNHANDLED_FORMAT_WORKAROUND_MODE 0x0021 // check your Registry settings
1876 #define CDRW_ERR_DOOR_LOCKED_BUSY 0x0022
1877 #define CDRW_ERR_MAGIC_WORD_REQUIRED 0x0023
1878 #define CDRW_ERR_INVALID_SECTOR_MODE 0x0024
1879 #define CDRW_ERR_DVD_LICENSE_VIOLATION 0x0025
1880 #define CDRW_ERR_INVALID_DVD_KEY_TYPE 0x0026
1881 #define CDRW_ERR_INVALID_DVD_REGION_CODE 0x0027
1882 #define CDRW_ERR_PAGE_IS_NOT_SUPPORTED 0x0028
1883 #define CDRW_ERR_STD_FORMAT_REQUIRED 0x0029
1884 //#define CDRW_ERR_ 0x00
1885 //#define CDRW_ERR_ 0x00
1886 //#define CDRW_ERR_ 0x00
1887 //#define CDRW_ERR_ 0x00
1888
1889 //#endif
1890
1891 // Registry keys
1892 #define REG_TIMEOUT_NAME_USER ("TimeOutValue")
1893 #define REG_AUTORUN_NAME_USER ("Autorun")
1894 #define REG_LOADMODE_NAME_USER ("LoadMode")
1895
1896 #define LOADMODE_CDRW_ONLY 0
1897 #define LOADMODE_ALWAYS 1
1898 #define LOADMODE_NEVER 2
1899
1900 #define REG_PACKETSIZE_NAME_USER ("PacketSize") // Initial packet size (FP)
1901
1902 #define PACKETSIZE_STREAM 0
1903 #define PACKETSIZE_UDF 32
1904
1905 #ifndef WITHOUT_FORMATTER
1906 #define REG_FORMATUNIT_NAME_USER ("FormatUnitMode") // FORMAT_UNIT workaround mode
1907
1908 #define FORMATUNIT_FP 0 // simulation via FP
1909 #define FORMATUNIT_STD 1
1910 #endif //WITHOUT_FORMATTER
1911
1912 #define REG_R_SPLIT_SIZE_NAME_USER ("ReadSplitSize") // Read request spliting limit
1913 #define REG_W_SPLIT_SIZE_NAME_USER ("WriteSplitSize") // Write request spliting limit
1914
1915 #define REG_CDR_SIMULATION_NAME_USER ("CdRSimulationMode") // Influence on READ_DISC_INFO
1916 // capability check on startup
1917 #define CDR_SIMULATION_CDROM 0
1918 #define CDR_SIMULATION_ALWAYS 1
1919 #define CDR_SIMULATION_NEVER 2
1920
1921 #define REG_SPEEDMODE_NAME_USER ("SpeedDetectionMode")
1922
1923 #define SPEEDMODE_ASSUME_OK 0
1924 #define SPEEDMODE_REREAD 1
1925
1926 //#define REG_MAX_WRITE_SPEED_R_NAME_USER ("MaxWriteSpeedCDR")
1927 //#define REG_MAX_WRITE_SPEED_RW_NAME_USER ("MaxWriteSpeedCDRW")
1928
1929 //#define REG_SIMULATION_TABLE_NAME_USER ("WModeSimulationTable") // via Raw
1930
1931 #define REG_WMODE_SIMULATION_NAME_USER ("WModeSimulation") // via Raw
1932 #define WMODE_SIMULATION_ON 1
1933 #define WMODE_SIMULATION_OFF 0
1934 #define WMODE_ASSUME_OK 2
1935
1936 #define REG_SYNC_PACKETS_NAME_USER ("SyncPacketsMode")
1937 #define SYNC_PACKETS_ALWAYS 0
1938 #define SYNC_PACKETS_RESET_DRV 1
1939 #define SYNC_PACKETS_NEVER 2
1940 #define SYNC_PACKETS_FP 3
1941 #define SYNC_PACKETS_DISABLED 4
1942 #define SYNC_PACKETS_VP_ONLY 5
1943 #define SYNC_PACKETS_BY_W_THROUGH 6
1944
1945 #define REG_ASSURE_READY_NAME_USER ("AssureReadiness")
1946 #define ASSURE_READY_TEST_UNIT 0
1947 #define ASSURE_READY_DELAY_100 1
1948 #define ASSURE_READY_NONE 2
1949
1950 #define REG_WAIT_PACKETS_NAME_USER ("WaitPackets")
1951 #define WAIT_PACKETS_ALWAYS 0
1952 #define WAIT_PACKETS_STREAM 1
1953
1954 #define REG_BAD_RW_SEEK_NAME_USER ("BadRWSeek")
1955
1956 #define REG_ALLOW_PACKET_ON_CDR_NAME_USER ("AllowPacketOnCdR")
1957 #define ALLOW_PACKET_ON_CDR_OFF 0
1958 #define ALLOW_PACKET_ON_CDR_ON 1
1959
1960 #define REG_MAX_READY_RETRY_NAME_USER ("MaxReadyRetry")
1961
1962 #define REG_BAD_DVD_READ_TRACK_INFO_NAME_USER ("DvdBadReadTrackInfo")
1963 #define REG_BAD_DVD_READ_DISC_INFO_NAME_USER ("DvdBadReadDiscInfo")
1964 #define REG_BAD_DVD_READ_CAPACITY_NAME_USER ("DvdBadReadCapacity")
1965 #define REG_BAD_DVD_LAST_LBA_NAME_USER ("DvdBadLastLba")
1966 #define REG_BAD_DVD_LAST_LBA_NAME_USER ("DvdBadLastLba")
1967
1968 #define REG_FULL_BLANK_ON_FORMAT_NAME_USER ("FullEraseBeforeFormat")
1969
1970 #define DEFAULT_LAST_LBA_FP_CD 276159
1971 #define DEFAULT_LAST_LBA_DVD 0x23053f
1972 #define DEFAULT_LAST_LBA_BD (25*1000*1000/2-1)
1973
1974
1975 #pragma pack(pop)
1976
1977 #endif //__CDRW_PUBLIC_H__