ReactOS 0.4.16-dev-197-g92996da
ntddcdvd.h
Go to the documentation of this file.
1/*
2 * ntddcdvd.h
3 *
4 * DVD IOCTL interface.
5 *
6 * This file is part of the w32api package.
7 *
8 * Contributors:
9 * Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
10 *
11 * THIS SOFTWARE IS NOT COPYRIGHTED
12 *
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
15 *
16 * This code is distributed in the hope that it will be useful but
17 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18 * DISCLAIMED. This includes but is not limited to warranties of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 *
21 */
22
23#ifndef _NTDDCDVD_
24#define _NTDDCDVD_
25
26#include "ntddstor.h"
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
32#define IOCTL_DVD_BASE FILE_DEVICE_DVD
33
34#define IOCTL_STORAGE_SET_READ_AHEAD \
35 CTL_CODE(IOCTL_STORAGE_BASE, 0x0100, METHOD_BUFFERED, FILE_READ_ACCESS)
36
37#define IOCTL_DVD_START_SESSION \
38 CTL_CODE(IOCTL_DVD_BASE, 0x0400, METHOD_BUFFERED, FILE_READ_ACCESS)
39
40#define IOCTL_DVD_READ_KEY \
41 CTL_CODE(IOCTL_DVD_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS)
42
43#define IOCTL_DVD_SEND_KEY \
44 CTL_CODE(IOCTL_DVD_BASE, 0x0402, METHOD_BUFFERED, FILE_READ_ACCESS)
45
46#define IOCTL_DVD_END_SESSION \
47 CTL_CODE(IOCTL_DVD_BASE, 0x0403, METHOD_BUFFERED, FILE_READ_ACCESS)
48
49#define IOCTL_DVD_SET_READ_AHEAD \
50 CTL_CODE(IOCTL_DVD_BASE, 0x0404, METHOD_BUFFERED, FILE_READ_ACCESS)
51
52#define IOCTL_DVD_GET_REGION \
53 CTL_CODE(IOCTL_DVD_BASE, 0x0405, METHOD_BUFFERED, FILE_READ_ACCESS)
54
55#define IOCTL_DVD_SEND_KEY2 \
56 CTL_CODE(IOCTL_DVD_BASE, 0x0406, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
57
58#define IOCTL_AACS_READ_MEDIA_KEY_BLOCK_SIZE \
59 CTL_CODE(IOCTL_DVD_BASE, 0x430, METHOD_BUFFERED, FILE_READ_ACCESS)
60
61#define IOCTL_AACS_READ_MEDIA_KEY_BLOCK \
62 CTL_CODE(IOCTL_DVD_BASE, 0x431, METHOD_BUFFERED, FILE_READ_ACCESS)
63
64#define IOCTL_AACS_START_SESSION \
65 CTL_CODE(IOCTL_DVD_BASE, 0x432, METHOD_BUFFERED, FILE_READ_ACCESS)
66
67#define IOCTL_AACS_END_SESSION \
68 CTL_CODE(IOCTL_DVD_BASE, 0x433, METHOD_BUFFERED, FILE_READ_ACCESS)
69
70#define IOCTL_AACS_SEND_CERTIFICATE \
71 CTL_CODE(IOCTL_DVD_BASE, 0x434, METHOD_BUFFERED, FILE_READ_ACCESS)
72
73#define IOCTL_AACS_GET_CERTIFICATE \
74 CTL_CODE(IOCTL_DVD_BASE, 0x435, METHOD_BUFFERED, FILE_READ_ACCESS)
75
76#define IOCTL_AACS_GET_CHALLENGE_KEY \
77 CTL_CODE(IOCTL_DVD_BASE, 0x436, METHOD_BUFFERED, FILE_READ_ACCESS)
78
79#define IOCTL_AACS_SEND_CHALLENGE_KEY \
80 CTL_CODE(IOCTL_DVD_BASE, 0x437, METHOD_BUFFERED, FILE_READ_ACCESS)
81
82#define IOCTL_AACS_READ_VOLUME_ID \
83 CTL_CODE(IOCTL_DVD_BASE, 0x438, METHOD_BUFFERED, FILE_READ_ACCESS)
84
85#define IOCTL_AACS_READ_SERIAL_NUMBER \
86 CTL_CODE(IOCTL_DVD_BASE, 0x439, METHOD_BUFFERED, FILE_READ_ACCESS)
87
88#define IOCTL_AACS_READ_MEDIA_ID \
89 CTL_CODE(IOCTL_DVD_BASE, 0x43A, METHOD_BUFFERED, FILE_READ_ACCESS)
90
91#define IOCTL_AACS_READ_BINDING_NONCE \
92 CTL_CODE(IOCTL_DVD_BASE, 0x43B, METHOD_BUFFERED, FILE_READ_ACCESS)
93
94#define IOCTL_AACS_GENERATE_BINDING_NONCE \
95 CTL_CODE(IOCTL_DVD_BASE, 0x43C, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
96
97#define IOCTL_DVD_READ_STRUCTURE \
98 CTL_CODE(IOCTL_DVD_BASE, 0x0450, METHOD_BUFFERED, FILE_READ_ACCESS)
99
100
102
107
116
117#include <pshpack1.h>
118typedef struct DVD_READ_STRUCTURE {
124#include <poppack.h>
125
126typedef struct _DVD_DESCRIPTOR_HEADER {
128 UCHAR Reserved[2];
131
132#include <pshpack1.h>
133typedef struct _DVD_LAYER_DESCRIPTOR {
134 UCHAR BookVersion : 4;
135 UCHAR BookType : 4;
136 UCHAR MinimumRate : 4;
137 UCHAR DiskSize : 4;
138 UCHAR LayerType : 4;
139 UCHAR TrackPath : 1;
141 UCHAR Reserved1 : 1;
147 UCHAR Reserved5 : 7;
148 UCHAR BCAFlag : 1;
151#include <poppack.h>
152
153typedef struct _DVD_COPYRIGHT_DESCRIPTOR {
158
162
163typedef enum _DVD_KEY_TYPE {
172 DvdInvalidateAGID = 0x3f
174
175typedef struct _DVD_COPY_PROTECT_KEY {
180 union {
186
187#define DVD_CHALLENGE_KEY_LENGTH (12 + sizeof(DVD_COPY_PROTECT_KEY))
188#define DVD_BUS_KEY_LENGTH (8 + sizeof(DVD_COPY_PROTECT_KEY))
189#define DVD_TITLE_KEY_LENGTH (8 + sizeof(DVD_COPY_PROTECT_KEY))
190#define DVD_DISK_KEY_LENGTH (2048 + sizeof(DVD_COPY_PROTECT_KEY))
191#define DVD_RPC_KEY_LENGTH (sizeof(DVD_RPC_KEY) + sizeof(DVD_COPY_PROTECT_KEY))
192#define DVD_SET_RPC_KEY_LENGTH (sizeof(DVD_SET_RPC_KEY) + sizeof(DVD_COPY_PROTECT_KEY))
193#define DVD_ASF_LENGTH (sizeof(DVD_ASF) + sizeof(DVD_COPY_PROTECT_KEY))
194
195#define DVD_END_ALL_SESSIONS ((DVD_SESSION_ID) 0xffffffff)
196
197
198#define DVD_CGMS_RESERVED_MASK 0x00000078
199
200#define DVD_CGMS_COPY_PROTECT_MASK 0x00000018
201#define DVD_CGMS_COPY_PERMITTED 0x00000000
202#define DVD_CGMS_COPY_ONCE 0x00000010
203#define DVD_CGMS_NO_COPY 0x00000018
204
205#define DVD_COPYRIGHT_MASK 0x00000040
206#define DVD_NOT_COPYRIGHTED 0x00000000
207#define DVD_COPYRIGHTED 0x00000040
208
209#define DVD_SECTOR_PROTECT_MASK 0x00000020
210#define DVD_SECTOR_NOT_PROTECTED 0x00000000
211#define DVD_SECTOR_PROTECTED 0x00000020
212
213
214typedef struct _DVD_BCA_DESCRIPTOR {
217
221
222typedef struct _DVD_RPC_KEY {
225 UCHAR TypeCode : 2;
228 UCHAR Reserved2[1];
230
231typedef struct _DVD_SET_RPC_KEY {
235
236typedef struct _DVD_ASF {
241
242typedef struct _DVD_REGION {
248
249#ifdef __cplusplus
250}
251#endif
252
253// for IOCTLS_AACS_*
254
255typedef _Field_range_(0,255) ULONG AACS_LAYER_NUMBER, *PAACS_LAYER_NUMBER;
256typedef _Field_range_(0,255) const ULONG CAACS_LAYER_NUMBER, *PCAACS_LAYER_NUMBER;
257
259{
260 UCHAR Nonce[20];
265
267{
273
274typedef struct _AACS_VOLUME_ID
275{
281
283{
289
290typedef struct _AACS_MEDIA_ID
291{
296C_ASSERT(sizeof(AACS_MEDIA_ID) == 32);
297
299{
304
306{
311
313{
319
321{
323 _Field_range_(0,255) ULONG NumberOfSectors;
325 union
326 {
329 };
331
332#endif /* _NTDDCDVD_ */
static const WCHAR Certificate[]
Definition: register.c:76
#define C_ASSERT(e)
Definition: intsafe.h:73
#define _Field_range_(min, max)
Definition: ms_sal.h:609
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
* PCAACS_LAYER_NUMBER
Definition: ntddcdvd.h:256
ULONG DVD_SESSION_ID
Definition: ntddcdvd.h:101
const AACS_BINDING_NONCE * PCAACS_BINDING_NONCE
Definition: ntddcdvd.h:317
_DVD_KEY_TYPE
Definition: ntddcdvd.h:163
@ 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
struct _AACS_SEND_CERTIFICATE AACS_SEND_CERTIFICATE
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 _AACS_SERIAL_NUMBER * PAACS_SERIAL_NUMBER
struct _DVD_COPY_PROTECT_KEY DVD_COPY_PROTECT_KEY
struct DVD_READ_STRUCTURE * PDVD_READ_STRUCTURE
const AACS_BINDING_NONCE CAACS_BINDING_NONCE
Definition: ntddcdvd.h:317
const AACS_SERIAL_NUMBER * PCAACS_SERIAL_NUMBER
Definition: ntddcdvd.h:287
struct _AACS_SERIAL_NUMBER AACS_SERIAL_NUMBER
const AACS_VOLUME_ID * PCAACS_VOLUME_ID
Definition: ntddcdvd.h:279
const AACS_SERIAL_NUMBER CAACS_SERIAL_NUMBER
Definition: ntddcdvd.h:287
struct _AACS_READ_BINDING_NONCE AACS_READ_BINDING_NONCE
struct _DVD_DISK_KEY_DESCRIPTOR DVD_DISK_KEY_DESCRIPTOR
struct _AACS_VOLUME_ID * PAACS_VOLUME_ID
const AACS_CHALLENGE_KEY * PCAACS_CHALLENGE_KEY
Definition: ntddcdvd.h:271
const AACS_MEDIA_ID * PCAACS_MEDIA_ID
Definition: ntddcdvd.h:295
struct _AACS_BINDING_NONCE AACS_BINDING_NONCE
struct _AACS_CHALLENGE_KEY * PAACS_CHALLENGE_KEY
const AACS_SEND_CERTIFICATE CAACS_SEND_CERTIFICATE
Definition: ntddcdvd.h:303
struct _AACS_SEND_CHALLENGE_KEY AACS_SEND_CHALLENGE_KEY
struct _AACS_MEDIA_ID AACS_MEDIA_ID
* PAACS_LAYER_NUMBER
Definition: ntddcdvd.h:255
struct _DVD_ASF * PDVD_ASF
ULONG * PDVD_SESSION_ID
Definition: ntddcdvd.h:101
const AACS_SEND_CHALLENGE_KEY CAACS_SEND_CHALLENGE_KEY
Definition: ntddcdvd.h:310
const AACS_VOLUME_ID CAACS_VOLUME_ID
Definition: ntddcdvd.h:279
struct _DVD_LAYER_DESCRIPTOR DVD_LAYER_DESCRIPTOR
struct _AACS_SEND_CHALLENGE_KEY * PAACS_SEND_CHALLENGE_KEY
const AACS_CERTIFICATE CAACS_CERTIFICATE
Definition: ntddcdvd.h:263
const AACS_SEND_CERTIFICATE * PCAACS_SEND_CERTIFICATE
Definition: ntddcdvd.h:303
const AACS_MEDIA_ID CAACS_MEDIA_ID
Definition: ntddcdvd.h:295
struct _AACS_VOLUME_ID AACS_VOLUME_ID
enum DVD_STRUCTURE_FORMAT * PDVD_STRUCTURE_FORMAT
struct _DVD_MANUFACTURER_DESCRIPTOR DVD_MANUFACTURER_DESCRIPTOR
struct _DVD_COPYRIGHT_DESCRIPTOR DVD_COPYRIGHT_DESCRIPTOR
struct _DVD_SET_RPC_KEY * PDVD_SET_RPC_KEY
struct _AACS_CERTIFICATE * PAACS_CERTIFICATE
struct _DVD_RPC_KEY * PDVD_RPC_KEY
const AACS_CHALLENGE_KEY CAACS_CHALLENGE_KEY
Definition: ntddcdvd.h:271
struct _DVD_MANUFACTURER_DESCRIPTOR * PDVD_MANUFACTURER_DESCRIPTOR
struct _AACS_CERTIFICATE AACS_CERTIFICATE
struct _DVD_ASF DVD_ASF
struct _AACS_SEND_CERTIFICATE * PAACS_SEND_CERTIFICATE
struct _DVD_REGION * PDVD_REGION
struct _AACS_CHALLENGE_KEY AACS_CHALLENGE_KEY
struct _DVD_REGION DVD_REGION
struct _AACS_BINDING_NONCE * PAACS_BINDING_NONCE
struct _DVD_COPY_PROTECT_KEY * PDVD_COPY_PROTECT_KEY
struct _DVD_BCA_DESCRIPTOR DVD_BCA_DESCRIPTOR
struct _AACS_MEDIA_ID * PAACS_MEDIA_ID
struct _DVD_RPC_KEY DVD_RPC_KEY
struct _STORAGE_SET_READ_AHEAD * PSTORAGE_SET_READ_AHEAD
const AACS_SEND_CHALLENGE_KEY * PCAACS_SEND_CHALLENGE_KEY
Definition: ntddcdvd.h:310
struct DVD_READ_STRUCTURE DVD_READ_STRUCTURE
struct _STORAGE_SET_READ_AHEAD STORAGE_SET_READ_AHEAD
struct _DVD_SET_RPC_KEY DVD_SET_RPC_KEY
const AACS_CERTIFICATE * PCAACS_CERTIFICATE
Definition: ntddcdvd.h:263
struct _DVD_LAYER_DESCRIPTOR * PDVD_LAYER_DESCRIPTOR
struct _AACS_READ_BINDING_NONCE * PAACS_READ_BINDING_NONCE
struct _DVD_DISK_KEY_DESCRIPTOR * PDVD_DISK_KEY_DESCRIPTOR
enum _DVD_KEY_TYPE DVD_KEY_TYPE
struct _DVD_COPYRIGHT_DESCRIPTOR * PDVD_COPYRIGHT_DESCRIPTOR
ULONG DVD_SESSION_ID
Definition: ntddcdvd.h:50
DVD_KEY_TYPE
Definition: ntddcdvd.h:38
enum _DVD_STRUCTURE_FORMAT DVD_STRUCTURE_FORMAT
LARGE_INTEGER BlockByteOffset
Definition: ntddcdvd.h:119
DVD_SESSION_ID SessionId
Definition: ntddcdvd.h:121
DVD_STRUCTURE_FORMAT Format
Definition: ntddcdvd.h:120
UCHAR BindingNonce[16]
Definition: ntddcdvd.h:314
UCHAR EllipticCurvePoint[40]
Definition: ntddcdvd.h:268
UCHAR Signature[40]
Definition: ntddcdvd.h:269
UCHAR MediaID[16]
Definition: ntddcdvd.h:292
UCHAR MAC[16]
Definition: ntddcdvd.h:293
DVD_SESSION_ID SessionId
Definition: ntddcdvd.h:322
_Field_range_(0, 255) ULONG NumberOfSectors
ULONGLONG ForceStructureLengthToMatch64bit
Definition: ntddcdvd.h:328
AACS_CERTIFICATE Certificate
Definition: ntddcdvd.h:301
DVD_SESSION_ID SessionId
Definition: ntddcdvd.h:300
AACS_CHALLENGE_KEY ChallengeKey
Definition: ntddcdvd.h:308
DVD_SESSION_ID SessionId
Definition: ntddcdvd.h:307
UCHAR PrerecordedSerialNumber[16]
Definition: ntddcdvd.h:284
UCHAR VolumeID[16]
Definition: ntddcdvd.h:276
UCHAR MAC[16]
Definition: ntddcdvd.h:277
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
union _DVD_COPY_PROTECT_KEY::@3153 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 NumberOfLayers
Definition: scsi.h:2851
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
UCHAR PreferredDriveRegionCode
Definition: ntddcdvd.h:232
LARGE_INTEGER TriggerAddress
Definition: ntddcdvd.h:104
LARGE_INTEGER TargetAddress
Definition: ntddcdvd.h:105
uint32_t ULONG
Definition: typedefs.h:59
uint64_t ULONGLONG
Definition: typedefs.h:67
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
unsigned char UCHAR
Definition: xmlstorage.h:181
#define const
Definition: zconf.h:233