ReactOS  0.4.14-dev-297-g23e575c
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
29 extern "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_END_SESSION \
38  CTL_CODE(IOCTL_DVD_BASE, 0x0403, METHOD_BUFFERED, FILE_READ_ACCESS)
39 
40 #define IOCTL_DVD_GET_REGION \
41  CTL_CODE(IOCTL_DVD_BASE, 0x0405, METHOD_BUFFERED, FILE_READ_ACCESS)
42 
43 #define IOCTL_DVD_SEND_KEY2 \
44  CTL_CODE(IOCTL_DVD_BASE, 0x0406, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
45 
46 #define IOCTL_DVD_READ_KEY \
47  CTL_CODE(IOCTL_DVD_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS)
48 
49 #define IOCTL_DVD_READ_STRUCTURE \
50  CTL_CODE(IOCTL_DVD_BASE, 0x0450, METHOD_BUFFERED, FILE_READ_ACCESS)
51 
52 #define IOCTL_DVD_SEND_KEY \
53  CTL_CODE(IOCTL_DVD_BASE, 0x0402, METHOD_BUFFERED, FILE_READ_ACCESS)
54 
55 #define IOCTL_DVD_START_SESSION \
56  CTL_CODE(IOCTL_DVD_BASE, 0x0400, METHOD_BUFFERED, FILE_READ_ACCESS)
57 
58 #define IOCTL_DVD_SET_READ_AHEAD \
59  CTL_CODE(IOCTL_DVD_BASE, 0x0404, METHOD_BUFFERED, FILE_READ_ACCESS)
60 
61 
63 
64 typedef struct _STORAGE_SET_READ_AHEAD {
68 
69 typedef enum DVD_STRUCTURE_FORMAT {
77 
78 #include <pshpack1.h>
79 typedef struct DVD_READ_STRUCTURE {
85 #include <poppack.h>
86 
87 typedef struct _DVD_DESCRIPTOR_HEADER {
89  UCHAR Reserved[2];
90  UCHAR Data[0];
92 
93 #include <pshpack1.h>
94 typedef struct _DVD_LAYER_DESCRIPTOR {
95  UCHAR BookVersion : 4;
96  UCHAR BookType : 4;
97  UCHAR MinimumRate : 4;
98  UCHAR DiskSize : 4;
99  UCHAR LayerType : 4;
100  UCHAR TrackPath : 1;
101  UCHAR NumberOfLayers : 2;
102  UCHAR Reserved1 : 1;
103  UCHAR TrackDensity : 4;
104  UCHAR LinearDensity : 4;
108  UCHAR Reserved5 : 7;
109  UCHAR BCAFlag : 1;
112 #include <poppack.h>
113 
114 typedef struct _DVD_COPYRIGHT_DESCRIPTOR {
119 
120 typedef struct _DVD_DISK_KEY_DESCRIPTOR {
123 
124 typedef enum _DVD_KEY_TYPE {
132  DvdDiskKey = 0x80,
134 } DVD_KEY_TYPE;
135 
136 typedef struct _DVD_COPY_PROTECT_KEY {
141  union {
144  } Parameters;
147 
148 #define DVD_CHALLENGE_KEY_LENGTH (12 + sizeof(DVD_COPY_PROTECT_KEY))
149 #define DVD_BUS_KEY_LENGTH (8 + sizeof(DVD_COPY_PROTECT_KEY))
150 #define DVD_TITLE_KEY_LENGTH (8 + sizeof(DVD_COPY_PROTECT_KEY))
151 #define DVD_DISK_KEY_LENGTH (2048 + sizeof(DVD_COPY_PROTECT_KEY))
152 #define DVD_RPC_KEY_LENGTH (sizeof(DVD_RPC_KEY) + sizeof(DVD_COPY_PROTECT_KEY))
153 #define DVD_SET_RPC_KEY_LENGTH (sizeof(DVD_SET_RPC_KEY) + sizeof(DVD_COPY_PROTECT_KEY))
154 #define DVD_ASF_LENGTH (sizeof(DVD_ASF) + sizeof(DVD_COPY_PROTECT_KEY))
155 
156 #define DVD_END_ALL_SESSIONS ((DVD_SESSION_ID) 0xffffffff)
157 
158 
159 #define DVD_CGMS_RESERVED_MASK 0x00000078
160 
161 #define DVD_CGMS_COPY_PROTECT_MASK 0x00000018
162 #define DVD_CGMS_COPY_PERMITTED 0x00000000
163 #define DVD_CGMS_COPY_ONCE 0x00000010
164 #define DVD_CGMS_NO_COPY 0x00000018
165 
166 #define DVD_COPYRIGHT_MASK 0x00000040
167 #define DVD_NOT_COPYRIGHTED 0x00000000
168 #define DVD_COPYRIGHTED 0x00000040
169 
170 #define DVD_SECTOR_PROTECT_MASK 0x00000020
171 #define DVD_SECTOR_NOT_PROTECTED 0x00000000
172 #define DVD_SECTOR_PROTECTED 0x00000020
173 
174 
175 typedef struct _DVD_BCA_DESCRIPTOR {
178 
182 
183 typedef struct _DVD_RPC_KEY {
186  UCHAR TypeCode : 2;
189  UCHAR Reserved2[1];
191 
192 typedef struct _DVD_SET_RPC_KEY {
196 
197 typedef struct _DVD_ASF {
201 } DVD_ASF, *PDVD_ASF;
202 
203 typedef struct _DVD_REGION {
209 
210 #ifdef __cplusplus
211 }
212 #endif
213 
214 #endif /* _NTDDCDVD_ */
struct _DVD_MANUFACTURER_DESCRIPTOR * PDVD_MANUFACTURER_DESCRIPTOR
UCHAR BCAInformation[0]
Definition: ntddcdvd.h:176
_DVD_KEY_TYPE
Definition: ntddcdvd.h:124
struct _DVD_LAYER_DESCRIPTOR DVD_LAYER_DESCRIPTOR
struct _DVD_DESCRIPTOR_HEADER DVD_DESCRIPTOR_HEADER
struct _DVD_DISK_KEY_DESCRIPTOR DVD_DISK_KEY_DESCRIPTOR
struct _STORAGE_SET_READ_AHEAD STORAGE_SET_READ_AHEAD
union _DVD_COPY_PROTECT_KEY::@3045 Parameters
LARGE_INTEGER TriggerAddress
Definition: ntddcdvd.h:65
DVD_STRUCTURE_FORMAT
Definition: ntddcdvd.h:69
UCHAR PreferredDriveRegionCode
Definition: ntddcdvd.h:193
struct _DVD_ASF * PDVD_ASF
UCHAR NumberOfLayers
Definition: scsi.h:2851
LARGE_INTEGER BlockByteOffset
Definition: ntddcdvd.h:80
UCHAR SystemRegion
Definition: ntddcdvd.h:206
UCHAR RpcScheme
Definition: scsi.h:2927
DVD_SESSION_ID SessionId
Definition: ntddcdvd.h:82
struct _DVD_COPYRIGHT_DESCRIPTOR DVD_COPYRIGHT_DESCRIPTOR
struct _DVD_BCA_DESCRIPTOR * PDVD_BCA_DESCRIPTOR
UCHAR SuccessFlag
Definition: ntddcdvd.h:199
struct _DVD_SET_RPC_KEY DVD_SET_RPC_KEY
UCHAR UserResetsAvailable
Definition: scsi.h:2923
LARGE_INTEGER TitleOffset
Definition: ntddcdvd.h:143
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
UCHAR Reserved0[3]
Definition: ntddcdvd.h:198
struct _DVD_DISK_KEY_DESCRIPTOR * PDVD_DISK_KEY_DESCRIPTOR
struct _DVD_RPC_KEY DVD_RPC_KEY
struct _DVD_RPC_KEY * PDVD_RPC_KEY
struct _DVD_REGION DVD_REGION
UCHAR ManufacturerResetsAvailable
Definition: scsi.h:2924
enum DVD_STRUCTURE_FORMAT * PDVD_STRUCTURE_FORMAT
struct _DVD_COPY_PROTECT_KEY DVD_COPY_PROTECT_KEY
UCHAR ManufacturingInformation[2048]
Definition: ntddcdvd.h:180
ULONG * PDVD_SESSION_ID
Definition: ntddcdvd.h:62
UCHAR CopySystem
Definition: ntddcdvd.h:204
struct _DVD_COPYRIGHT_DESCRIPTOR * PDVD_COPYRIGHT_DESCRIPTOR
ULONG DVD_SESSION_ID
Definition: ntddcdvd.h:62
DVD_KEY_TYPE KeyType
Definition: ntddcdvd.h:139
unsigned char UCHAR
Definition: xmlstorage.h:181
struct _DVD_ASF DVD_ASF
ULONG DVD_SESSION_ID
Definition: cdrw_usr.h:1544
struct DVD_READ_STRUCTURE DVD_READ_STRUCTURE
UCHAR RegionMask
Definition: scsi.h:2926
struct _DVD_DESCRIPTOR_HEADER * PDVD_DESCRIPTOR_HEADER
DVD_SESSION_ID SessionId
Definition: ntddcdvd.h:138
struct _DVD_LAYER_DESCRIPTOR * PDVD_LAYER_DESCRIPTOR
unsigned short USHORT
Definition: pedump.c:61
struct _DVD_COPY_PROTECT_KEY * PDVD_COPY_PROTECT_KEY
struct _DVD_SET_RPC_KEY * PDVD_SET_RPC_KEY
UCHAR Reserved2[1]
Definition: scsi.h:2928
struct _STORAGE_SET_READ_AHEAD * PSTORAGE_SET_READ_AHEAD
UCHAR DiskKeyData[2048]
Definition: ntddcdvd.h:121
UCHAR ResetCount
Definition: ntddcdvd.h:207
DVD_STRUCTURE_FORMAT Format
Definition: ntddcdvd.h:81
unsigned int ULONG
Definition: retypes.h:1
DVD_KEY_TYPE
Definition: ntddcdvd.h:38
UCHAR Reserved1
Definition: ntddcdvd.h:200
struct _DVD_BCA_DESCRIPTOR DVD_BCA_DESCRIPTOR
struct _DVD_MANUFACTURER_DESCRIPTOR DVD_MANUFACTURER_DESCRIPTOR
LARGE_INTEGER TargetAddress
Definition: ntddcdvd.h:66
UCHAR RegionData
Definition: ntddcdvd.h:205
struct _DVD_REGION * PDVD_REGION
struct DVD_READ_STRUCTURE * PDVD_READ_STRUCTURE
UCHAR TypeCode
Definition: scsi.h:2925