Fix compilation errors on FreeBSD.
[wine] / include / ntddcdrm.h
1 /* DDK information for CD ROM */
2
3 #ifndef __NTDDCDRM_H
4 #define __NTDDCDRM_H
5
6 #define IOCTL_CDROM_BASE                FILE_DEVICE_CD_ROM
7 #define IOCTL_CDROM_UNLOAD_DRIVER       CTL_CODE(IOCTL_CDROM_BASE, 0x0402, METHOD_BUFFERED, FILE_READ_ACCESS)
8 #define IOCTL_CDROM_READ_TOC            CTL_CODE(IOCTL_CDROM_BASE, 0x0000, METHOD_BUFFERED, FILE_READ_ACCESS)
9 #define IOCTL_CDROM_GET_CONTROL         CTL_CODE(IOCTL_CDROM_BASE, 0x000D, METHOD_BUFFERED, FILE_READ_ACCESS)
10 #define IOCTL_CDROM_PLAY_AUDIO_MSF      CTL_CODE(IOCTL_CDROM_BASE, 0x0006, METHOD_BUFFERED, FILE_READ_ACCESS)
11 #define IOCTL_CDROM_SEEK_AUDIO_MSF      CTL_CODE(IOCTL_CDROM_BASE, 0x0001, METHOD_BUFFERED, FILE_READ_ACCESS)
12 #define IOCTL_CDROM_STOP_AUDIO          CTL_CODE(IOCTL_CDROM_BASE, 0x0002, METHOD_BUFFERED, FILE_READ_ACCESS)
13 #define IOCTL_CDROM_PAUSE_AUDIO         CTL_CODE(IOCTL_CDROM_BASE, 0x0003, METHOD_BUFFERED, FILE_READ_ACCESS)
14 #define IOCTL_CDROM_RESUME_AUDIO        CTL_CODE(IOCTL_CDROM_BASE, 0x0004, METHOD_BUFFERED, FILE_READ_ACCESS)
15 #define IOCTL_CDROM_GET_VOLUME          CTL_CODE(IOCTL_CDROM_BASE, 0x0005, METHOD_BUFFERED, FILE_READ_ACCESS)
16 #define IOCTL_CDROM_SET_VOLUME          CTL_CODE(IOCTL_CDROM_BASE, 0x000A, METHOD_BUFFERED, FILE_READ_ACCESS)
17 #define IOCTL_CDROM_READ_Q_CHANNEL      CTL_CODE(IOCTL_CDROM_BASE, 0x000B, METHOD_BUFFERED, FILE_READ_ACCESS)
18 #define IOCTL_CDROM_GET_LAST_SESSION    CTL_CODE(IOCTL_CDROM_BASE, 0x000E, METHOD_BUFFERED, FILE_READ_ACCESS)
19 #define IOCTL_CDROM_RAW_READ            CTL_CODE(IOCTL_CDROM_BASE, 0x000F, METHOD_OUT_DIRECT,  FILE_READ_ACCESS)
20 #define IOCTL_CDROM_DISK_TYPE           CTL_CODE(IOCTL_CDROM_BASE, 0x0010, METHOD_BUFFERED, FILE_ANY_ACCESS)
21 #define IOCTL_CDROM_GET_DRIVE_GEOMETRY  CTL_CODE(IOCTL_CDROM_BASE, 0x0013, METHOD_BUFFERED, FILE_READ_ACCESS)
22
23 #define IOCTL_CDROM_CHECK_VERIFY        CTL_CODE(IOCTL_CDROM_BASE, 0x0200, METHOD_BUFFERED, FILE_READ_ACCESS)
24 #define IOCTL_CDROM_MEDIA_REMOVAL       CTL_CODE(IOCTL_CDROM_BASE, 0x0201, METHOD_BUFFERED, FILE_READ_ACCESS)
25 #define IOCTL_CDROM_EJECT_MEDIA         CTL_CODE(IOCTL_CDROM_BASE, 0x0202, METHOD_BUFFERED, FILE_READ_ACCESS)
26 #define IOCTL_CDROM_LOAD_MEDIA          CTL_CODE(IOCTL_CDROM_BASE, 0x0203, METHOD_BUFFERED, FILE_READ_ACCESS)
27 #define IOCTL_CDROM_RESERVE             CTL_CODE(IOCTL_CDROM_BASE, 0x0204, METHOD_BUFFERED, FILE_READ_ACCESS)
28 #define IOCTL_CDROM_RELEASE             CTL_CODE(IOCTL_CDROM_BASE, 0x0205, METHOD_BUFFERED, FILE_READ_ACCESS)
29 #define IOCTL_CDROM_FIND_NEW_DEVICES    CTL_CODE(IOCTL_CDROM_BASE, 0x0206, METHOD_BUFFERED, FILE_READ_ACCESS)
30
31 #include "ntddstor.h"
32
33 #define MAXIMUM_NUMBER_TRACKS 100
34 #define MAXIMUM_CDROM_SIZE 804
35
36 typedef struct _TRACK_DATA {
37     UCHAR               Reserved;
38     UCHAR               Control : 4;
39     UCHAR               Adr : 4;
40     UCHAR               TrackNumber;
41     UCHAR               Reserved1;
42     UCHAR               Address[4];
43 } TRACK_DATA, *PTRACK_DATA;
44
45 typedef struct _CDROM_TOC {
46     UCHAR               Length[2];
47     UCHAR               FirstTrack;
48     UCHAR               LastTrack;
49     TRACK_DATA TrackData[MAXIMUM_NUMBER_TRACKS];
50 } CDROM_TOC, *PCDROM_TOC;
51
52 #define CDROM_TOC_SIZE sizeof(CDROM_TOC)
53
54 typedef struct _CDROM_PLAY_AUDIO_MSF {
55     UCHAR               StartingM;
56     UCHAR               StartingS;
57     UCHAR               StartingF;
58     UCHAR               EndingM;
59     UCHAR               EndingS;
60     UCHAR               EndingF;
61 } CDROM_PLAY_AUDIO_MSF, *PCDROM_PLAY_AUDIO_MSF;
62
63 typedef struct _CDROM_SEEK_AUDIO_MSF {
64     UCHAR               M;
65     UCHAR               S;
66     UCHAR               F;
67 } CDROM_SEEK_AUDIO_MSF, *PCDROM_SEEK_AUDIO_MSF;
68
69 typedef struct _CDROM_DISK_DATA {
70     ULONG               DiskData;
71 } CDROM_DISK_DATA, *PCDROM_DISK_DATA;
72
73 #define CDROM_DISK_AUDIO_TRACK      (0x00000001)
74 #define CDROM_DISK_DATA_TRACK       (0x00000002)
75
76 #define IOCTL_CDROM_SUB_Q_CHANNEL    0x00
77 #define IOCTL_CDROM_CURRENT_POSITION 0x01
78 #define IOCTL_CDROM_MEDIA_CATALOG    0x02
79 #define IOCTL_CDROM_TRACK_ISRC       0x03
80
81 typedef struct _CDROM_SUB_Q_DATA_FORMAT {
82     UCHAR               Format;
83     UCHAR               Track;
84 } CDROM_SUB_Q_DATA_FORMAT, *PCDROM_SUB_Q_DATA_FORMAT;
85
86 typedef struct _SUB_Q_HEADER {
87     UCHAR               Reserved;
88     UCHAR               AudioStatus;
89     UCHAR               DataLength[2];
90 } SUB_Q_HEADER, *PSUB_Q_HEADER;
91
92 typedef struct _SUB_Q_CURRENT_POSITION {
93     SUB_Q_HEADER        Header;
94     UCHAR               FormatCode;
95     UCHAR               Control : 4;
96     UCHAR               ADR : 4;
97     UCHAR               TrackNumber;
98     UCHAR               IndexNumber;
99     UCHAR               AbsoluteAddress[4];
100     UCHAR               TrackRelativeAddress[4];
101 } SUB_Q_CURRENT_POSITION, *PSUB_Q_CURRENT_POSITION;
102
103 typedef struct _SUB_Q_MEDIA_CATALOG_NUMBER {
104     SUB_Q_HEADER        Header;
105     UCHAR               FormatCode;
106     UCHAR               Reserved[3];
107     UCHAR               Reserved1 : 7;
108     UCHAR               Mcval : 1;
109     UCHAR               MediaCatalog[15];
110 } SUB_Q_MEDIA_CATALOG_NUMBER, *PSUB_Q_MEDIA_CATALOG_NUMBER;
111
112 typedef struct _SUB_Q_TRACK_ISRC {
113     SUB_Q_HEADER        Header;
114     UCHAR               FormatCode;
115     UCHAR               Reserved0;
116     UCHAR               Track;
117     UCHAR               Reserved1;
118     UCHAR               Reserved2 : 7;
119     UCHAR               Tcval : 1;
120     UCHAR               TrackIsrc[15];
121 } SUB_Q_TRACK_ISRC, *PSUB_Q_TRACK_ISRC;
122
123 typedef union _SUB_Q_CHANNEL_DATA {
124     SUB_Q_CURRENT_POSITION      CurrentPosition;
125     SUB_Q_MEDIA_CATALOG_NUMBER  MediaCatalog;
126     SUB_Q_TRACK_ISRC            TrackIsrc;
127 } SUB_Q_CHANNEL_DATA, *PSUB_Q_CHANNEL_DATA;
128
129 #define AUDIO_STATUS_NOT_SUPPORTED      0x00
130 #define AUDIO_STATUS_IN_PROGRESS        0x11
131 #define AUDIO_STATUS_PAUSED             0x12
132 #define AUDIO_STATUS_PLAY_COMPLETE      0x13
133 #define AUDIO_STATUS_PLAY_ERROR         0x14
134 #define AUDIO_STATUS_NO_STATUS          0x15
135
136 #define ADR_NO_MODE_INFORMATION         0x0
137 #define ADR_ENCODES_CURRENT_POSITION    0x1
138 #define ADR_ENCODES_MEDIA_CATALOG       0x2
139 #define ADR_ENCODES_ISRC                0x3
140
141 #define AUDIO_WITH_PREEMPHASIS          0x0
142 #define DIGITAL_COPY_PERMITTED          0x2
143 #define AUDIO_DATA_TRACK                0x4
144 #define TWO_FOUR_CHANNEL_AUDIO          0x8
145
146 typedef struct _CDROM_AUDIO_CONTROL {
147     UCHAR               LbaFormat;
148     USHORT              LogicalBlocksPerSecond;
149 } CDROM_AUDIO_CONTROL, *PCDROM_AUDIO_CONTROL;
150
151 typedef struct _VOLUME_CONTROL {
152     UCHAR               PortVolume[4];
153 } VOLUME_CONTROL, *PVOLUME_CONTROL;
154
155 typedef enum _TRACK_MODE_TYPE {
156     YellowMode2,
157     XAForm2,
158     CDDA
159 } TRACK_MODE_TYPE, *PTRACK_MODE_TYPE;
160
161 typedef struct __RAW_READ_INFO {
162     LARGE_INTEGER       DiskOffset;
163     ULONG               SectorCount;
164     TRACK_MODE_TYPE     TrackMode;
165 } RAW_READ_INFO, *PRAW_READ_INFO;
166
167 #endif /* __NTDDCDRM_H */