6 * This file is part of the w32api package.
9 * Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
11 * THIS SOFTWARE IS NOT COPYRIGHTED
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
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.
27 #pragma GCC system_header
37 #define IOCTL_DVD_BASE FILE_DEVICE_DVD
39 #define IOCTL_DVD_END_SESSION \
40 CTL_CODE(IOCTL_DVD_BASE, 0x0403, METHOD_BUFFERED, FILE_READ_ACCESS)
42 #define IOCTL_DVD_GET_REGION \
43 CTL_CODE(IOCTL_DVD_BASE, 0x0405, METHOD_BUFFERED, FILE_READ_ACCESS)
45 #define IOCTL_DVD_READ_KEY \
46 CTL_CODE(IOCTL_DVD_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS)
48 #define IOCTL_DVD_READ_STRUCTURE \
49 CTL_CODE(IOCTL_DVD_BASE, 0x0450, METHOD_BUFFERED, FILE_READ_ACCESS)
51 #define IOCTL_DVD_SEND_KEY \
52 CTL_CODE(IOCTL_DVD_BASE, 0x0402, METHOD_BUFFERED, FILE_READ_ACCESS)
54 #define IOCTL_DVD_START_SESSION \
55 CTL_CODE(IOCTL_DVD_BASE, 0x0400, METHOD_BUFFERED, FILE_READ_ACCESS)
57 #define IOCTL_DVD_SET_READ_AHEAD \
58 CTL_CODE(IOCTL_DVD_BASE, 0x0404, METHOD_BUFFERED, FILE_READ_ACCESS)
61 typedef ULONG DVD_SESSION_ID
, *PDVD_SESSION_ID
;
63 typedef struct _STORAGE_SET_READ_AHEAD
{
64 LARGE_INTEGER TriggerAddress
;
65 LARGE_INTEGER TargetAddress
;
66 } STORAGE_SET_READ_AHEAD
, *PSTORAGE_SET_READ_AHEAD
;
68 typedef enum DVD_STRUCTURE_FORMAT
{
69 DvdPhysicalDescriptor
,
70 DvdCopyrightDescriptor
,
73 DvdManufacturerDescriptor
,
75 } DVD_STRUCTURE_FORMAT
, *PDVD_STRUCTURE_FORMAT
;
78 typedef struct DVD_READ_STRUCTURE
{
79 LARGE_INTEGER BlockByteOffset
;
80 DVD_STRUCTURE_FORMAT Format
;
81 DVD_SESSION_ID SessionId
;
83 } DVD_READ_STRUCTURE
, *PDVD_READ_STRUCTURE
;
86 typedef struct _DVD_DESCRIPTOR_HEADER
{
90 } DVD_DESCRIPTOR_HEADER
, *PDVD_DESCRIPTOR_HEADER
;
93 typedef struct _DVD_LAYER_DESCRIPTOR
{
94 UCHAR BookVersion
: 4;
96 UCHAR MinimumRate
: 4;
100 UCHAR NumberOfLayers
: 2;
102 UCHAR TrackDensity
: 4;
103 UCHAR LinearDensity
: 4;
104 ULONG StartingDataSector
;
106 ULONG EndLayerZeroSector
;
110 } DVD_LAYER_DESCRIPTOR
, *PDVD_LAYER_DESCRIPTOR
;
113 typedef struct _DVD_COPYRIGHT_DESCRIPTOR
{
114 UCHAR CopyrightProtectionType
;
115 UCHAR RegionManagementInformation
;
117 } DVD_COPYRIGHT_DESCRIPTOR
, *PDVD_COPYRIGHT_DESCRIPTOR
;
119 typedef struct _DVD_DISK_KEY_DESCRIPTOR
{
120 UCHAR DiskKeyData
[2048];
121 } DVD_DISK_KEY_DESCRIPTOR
, *PDVD_DISK_KEY_DESCRIPTOR
;
123 typedef enum _DVD_KEY_TYPE
{
124 DvdChallengeKey
= 0x01,
132 DvdInvalidateAGID
= 0x3f
135 typedef struct _DVD_COPY_PROTECT_KEY
{
137 DVD_SESSION_ID SessionId
;
138 DVD_KEY_TYPE KeyType
;
142 LARGE_INTEGER TitleOffset
;
145 } DVD_COPY_PROTECT_KEY
, *PDVD_COPY_PROTECT_KEY
;
147 #define DVD_CHALLENGE_KEY_LENGTH (12 + sizeof(DVD_COPY_PROTECT_KEY))
148 #define DVD_BUS_KEY_LENGTH (8 + sizeof(DVD_COPY_PROTECT_KEY))
149 #define DVD_TITLE_KEY_LENGTH (8 + sizeof(DVD_COPY_PROTECT_KEY))
150 #define DVD_DISK_KEY_LENGTH (2048 + sizeof(DVD_COPY_PROTECT_KEY))
151 #define DVD_RPC_KEY_LENGTH (sizeof(DVD_RPC_KEY) + sizeof(DVD_COPY_PROTECT_KEY))
152 #define DVD_SET_RPC_KEY_LENGTH (sizeof(DVD_SET_RPC_KEY) + sizeof(DVD_COPY_PROTECT_KEY))
153 #define DVD_ASF_LENGTH (sizeof(DVD_ASF) + sizeof(DVD_COPY_PROTECT_KEY))
155 #define DVD_END_ALL_SESSIONS ((DVD_SESSION_ID) 0xffffffff)
158 #define DVD_CGMS_RESERVED_MASK 0x00000078
160 #define DVD_CGMS_COPY_PROTECT_MASK 0x00000018
161 #define DVD_CGMS_COPY_PERMITTED 0x00000000
162 #define DVD_CGMS_COPY_ONCE 0x00000010
163 #define DVD_CGMS_NO_COPY 0x00000018
165 #define DVD_COPYRIGHT_MASK 0x00000040
166 #define DVD_NOT_COPYRIGHTED 0x00000000
167 #define DVD_COPYRIGHTED 0x00000040
169 #define DVD_SECTOR_PROTECT_MASK 0x00000020
170 #define DVD_SECTOR_NOT_PROTECTED 0x00000000
171 #define DVD_SECTOR_PROTECTED 0x00000020
174 typedef struct _DVD_BCA_DESCRIPTOR
{
175 UCHAR BCAInformation
[0];
176 } DVD_BCA_DESCRIPTOR
, *PDVD_BCA_DESCRIPTOR
;
178 typedef struct _DVD_MANUFACTURER_DESCRIPTOR
{
179 UCHAR ManufacturingInformation
[2048];
180 } DVD_MANUFACTURER_DESCRIPTOR
, *PDVD_MANUFACTURER_DESCRIPTOR
;
182 typedef struct _DVD_RPC_KEY
{
183 UCHAR UserResetsAvailable
: 3;
184 UCHAR ManufacturerResetsAvailable
: 3;
189 } DVD_RPC_KEY
, *PDVD_RPC_KEY
;
191 typedef struct _DVD_SET_RPC_KEY
{
192 UCHAR PreferredDriveRegionCode
;
194 } DVD_SET_RPC_KEY
, *PDVD_SET_RPC_KEY
;
196 typedef struct _DVD_ASF
{
198 UCHAR SuccessFlag
: 1;
200 } DVD_ASF
, *PDVD_ASF
;
202 typedef struct _DVD_REGION
{
207 } DVD_REGION
, *PDVD_REGION
;
213 #endif /* __NTDDCDVD_H */