ReactOS 0.4.15-dev-7924-g5949c20
ntddcdvd.h
Go to the documentation of this file.
1/*
2 * DDK information for DVD
3 *
4 * Copyright (C) 2004 Uwe Bonnes
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#ifndef __NTDDCDVD_H
22#define __NTDDCDVD_H
23
24/* definitions taken from libdvdcss, modified to reflect Windows names and data types in places */
25
26#define IOCTL_DVD_BASE FILE_DEVICE_DVD
27
28#define IOCTL_DVD_START_SESSION CTL_CODE(IOCTL_DVD_BASE, 0x0400, METHOD_BUFFERED, FILE_READ_ACCESS)
29#define IOCTL_DVD_READ_KEY CTL_CODE(IOCTL_DVD_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS)
30#define IOCTL_DVD_SEND_KEY CTL_CODE(IOCTL_DVD_BASE, 0x0402, METHOD_BUFFERED, FILE_READ_ACCESS)
31#define IOCTL_DVD_END_SESSION CTL_CODE(IOCTL_DVD_BASE, 0x0403, METHOD_BUFFERED, FILE_READ_ACCESS)
32#define IOCTL_DVD_SET_READ_AHEAD CTL_CODE(IOCTL_DVD_BASE, 0x0404, METHOD_BUFFERED, FILE_READ_ACCESS)
33#define IOCTL_DVD_GET_REGION CTL_CODE(IOCTL_DVD_BASE, 0x0405, METHOD_BUFFERED, FILE_READ_ACCESS)
34#define IOCTL_DVD_SEND_KEY2 CTL_CODE(IOCTL_DVD_BASE, 0x0406, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
35
36#define IOCTL_DVD_READ_STRUCTURE CTL_CODE(IOCTL_DVD_BASE, 0x0450, METHOD_BUFFERED, FILE_READ_ACCESS)
37
38typedef enum {
46 DvdDiskKey = 0x80,
49
51
52#include <pshpack1.h>
53
54typedef struct _DVD_COPY_PROTECT_KEY {
59 union {
60 struct {
62 ULONG Reserved; /* used for NT alignment */
63 } s;
66 UCHAR KeyData[1];
68
69typedef struct _DVD_RPC_KEY {
77
78typedef struct _DVD_ASF {
83
84typedef struct _DVD_REGION
85{
87 UCHAR RegionData; /* current media region (not playable when set) */
88 UCHAR SystemRegion; /* current drive region (playable when set) */
89 UCHAR ResetCount; /* number of resets available */
91
93{
101
102typedef struct DVD_READ_STRUCTURE {
103 /* Contains an offset to the logical block address of the descriptor to be retrieved. */
105
106 /* 0:Physical descriptor, 1:Copyright descriptor, 2:Disk key descriptor
107 3:BCA descriptor, 4:Manufacturer descriptor, 5:Max descriptor
108 */
110
111 /* Session ID, that is obtained by IOCTL_DVD_START_SESSION */
113
114 /* From 0 to 4 */
117
118typedef struct _DVD_DESCRIPTOR_HEADER {
120 UCHAR Reserved[2];
123
124typedef struct _DVD_LAYER_DESCRIPTOR
125{
126 UCHAR BookVersion : 4;
127
128 /* 0:DVD-ROM, 1:DVD-RAM, 2:DVD-R, 3:DVD-RW, 9:DVD-RW */
129 UCHAR BookType : 4;
130
131 UCHAR MinimumRate : 4;
132
133 /* The physical size of the media. 0:120 mm, 1:80 mm. */
134 UCHAR DiskSize : 4;
135
136 /* 1:Read-only layer, 2:Recordable layer, 4:Rewritable layer */
137 UCHAR LayerType : 4;
138
139 /* 0:parallel track path, 1:opposite track path */
140 UCHAR TrackPath : 1;
141
142 /* 0:one layers, 1:two layers, and so on */
144
145 UCHAR Reserved1 : 1;
146
147 /* 0:0.74 µm/track, 1:0.80 µm/track, 2:0.615 µm/track */
149
150 /* 0:0.267 µm/bit, 1:0.293 µm/bit, 2:0.409 to 0.435 µm/bit, 4:0.280 to 0.291 µm/bit, 8:0.353 µm/bit */
152
153 /* Must be either 0x30000:DVD-ROM or DVD-R/-RW or 0x31000:DVD-RAM or DVD+RW */
155
158 UCHAR Reserved5 : 7;
159
160 /* 0 indicates no BCA data */
161 UCHAR BCAFlag : 1;
164
165typedef struct _DVD_COPYRIGHT_DESCRIPTOR
166{
171
172typedef struct _DVD_DISK_KEY_DESCRIPTOR
173{
174 UCHAR DiskKeyData[2048];
176
177typedef struct _DVD_BCA_DESCRIPTOR
178{
181
182typedef struct _DVD_MANUFACTURER_DESCRIPTOR
183{
186
187#define DVD_CHALLENGE_KEY_LENGTH (12 + sizeof(DVD_COPY_PROTECT_KEY) - sizeof(UCHAR))
188
189#define DVD_DISK_KEY_LENGTH (2048 + sizeof(DVD_COPY_PROTECT_KEY) - sizeof(UCHAR))
190
191#define DVD_KEY_SIZE 5
192#define DVD_CHALLENGE_SIZE 10
193#define DVD_DISCKEY_SIZE 2048
194#define DVD_SECTOR_PROTECTED 0x00000020
195
196#include <poppack.h>
197
198#endif /* __NTDDCDVD_H */
ULONG DVD_SESSION_ID
Definition: cdrw_usr.h:1544
#define C_ASSERT(e)
Definition: intsafe.h:73
unsigned short USHORT
Definition: pedump.c:61
struct _DVD_BCA_DESCRIPTOR * PDVD_BCA_DESCRIPTOR
struct _DVD_DESCRIPTOR_HEADER DVD_DESCRIPTOR_HEADER
struct _DVD_DESCRIPTOR_HEADER * PDVD_DESCRIPTOR_HEADER
ULONG DVD_SESSION_ID
Definition: ntddcdvd.h:101
@ DvdAsf
Definition: ntddcdvd.h:168
@ DvdDiskKey
Definition: ntddcdvd.h:171
@ DvdInvalidateAGID
Definition: ntddcdvd.h:172
@ DvdTitleKey
Definition: ntddcdvd.h:167
@ DvdSetRpcKey
Definition: ntddcdvd.h:169
@ DvdBusKey1
Definition: ntddcdvd.h:165
@ DvdBusKey2
Definition: ntddcdvd.h:166
@ DvdChallengeKey
Definition: ntddcdvd.h:164
@ DvdGetRpcKey
Definition: ntddcdvd.h:170
DVD_STRUCTURE_FORMAT
Definition: ntddcdvd.h:108
@ DvdPhysicalDescriptor
Definition: ntddcdvd.h:109
@ DvdMaxDescriptor
Definition: ntddcdvd.h:114
@ DvdManufacturerDescriptor
Definition: ntddcdvd.h:113
@ DvdBCADescriptor
Definition: ntddcdvd.h:112
@ DvdCopyrightDescriptor
Definition: ntddcdvd.h:110
@ DvdDiskKeyDescriptor
Definition: ntddcdvd.h:111
struct _DVD_COPY_PROTECT_KEY DVD_COPY_PROTECT_KEY
struct DVD_READ_STRUCTURE * PDVD_READ_STRUCTURE
struct _DVD_DISK_KEY_DESCRIPTOR DVD_DISK_KEY_DESCRIPTOR
struct _DVD_ASF * PDVD_ASF
ULONG * PDVD_SESSION_ID
Definition: ntddcdvd.h:101
struct _DVD_LAYER_DESCRIPTOR DVD_LAYER_DESCRIPTOR
enum DVD_STRUCTURE_FORMAT * PDVD_STRUCTURE_FORMAT
struct _DVD_MANUFACTURER_DESCRIPTOR DVD_MANUFACTURER_DESCRIPTOR
struct _DVD_COPYRIGHT_DESCRIPTOR DVD_COPYRIGHT_DESCRIPTOR
struct _DVD_RPC_KEY * PDVD_RPC_KEY
struct _DVD_MANUFACTURER_DESCRIPTOR * PDVD_MANUFACTURER_DESCRIPTOR
struct _DVD_ASF DVD_ASF
struct _DVD_REGION * PDVD_REGION
struct _DVD_REGION DVD_REGION
struct _DVD_COPY_PROTECT_KEY * PDVD_COPY_PROTECT_KEY
struct _DVD_BCA_DESCRIPTOR DVD_BCA_DESCRIPTOR
struct _DVD_RPC_KEY DVD_RPC_KEY
struct DVD_READ_STRUCTURE DVD_READ_STRUCTURE
struct _DVD_LAYER_DESCRIPTOR * PDVD_LAYER_DESCRIPTOR
struct _DVD_DISK_KEY_DESCRIPTOR * PDVD_DISK_KEY_DESCRIPTOR
enum _DVD_KEY_TYPE DVD_KEY_TYPE
struct _DVD_COPYRIGHT_DESCRIPTOR * PDVD_COPYRIGHT_DESCRIPTOR
_DVD_STRUCTURE_FORMAT
Definition: ntddcdvd.h:93
DVD_KEY_TYPE
Definition: ntddcdvd.h:38
LARGE_INTEGER BlockByteOffset
Definition: ntddcdvd.h:119
DVD_SESSION_ID SessionId
Definition: ntddcdvd.h:121
DVD_STRUCTURE_FORMAT Format
Definition: ntddcdvd.h:120
UCHAR SuccessFlag
Definition: ntddcdvd.h:238
UCHAR Reserved1
Definition: ntddcdvd.h:239
UCHAR Reserved0[3]
Definition: ntddcdvd.h:237
UCHAR BCAInformation[0]
Definition: ntddcdvd.h:215
struct _DVD_COPY_PROTECT_KEY::@3563::@3564 s
union _DVD_COPY_PROTECT_KEY::@3163 Parameters
DVD_SESSION_ID SessionId
Definition: ntddcdvd.h:177
LARGE_INTEGER TitleOffset
Definition: ntddcdvd.h:182
DVD_KEY_TYPE KeyType
Definition: ntddcdvd.h:178
UCHAR DiskKeyData[2048]
Definition: ntddcdvd.h:160
UCHAR EndDataSector[4]
Definition: scsi.h:2856
UCHAR NumberOfLayers
Definition: scsi.h:2851
UCHAR StartingDataSector[4]
Definition: scsi.h:2855
UCHAR EndLayerZeroSector[4]
Definition: scsi.h:2857
UCHAR ManufacturingInformation[2048]
Definition: ntddcdvd.h:219
UCHAR ResetCount
Definition: ntddcdvd.h:246
UCHAR CopySystem
Definition: ntddcdvd.h:243
UCHAR RegionData
Definition: ntddcdvd.h:244
UCHAR SystemRegion
Definition: ntddcdvd.h:245
UCHAR UserResetsAvailable
Definition: scsi.h:2923
UCHAR TypeCode
Definition: scsi.h:2925
UCHAR RpcScheme
Definition: scsi.h:2927
UCHAR ManufacturerResetsAvailable
Definition: scsi.h:2924
UCHAR RegionMask
Definition: scsi.h:2926
UCHAR Reserved2[1]
Definition: scsi.h:2928
uint32_t ULONG
Definition: typedefs.h:59
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
unsigned char UCHAR
Definition: xmlstorage.h:181