81{
86
88
90
95
97 {
100 (
PVOID*)&outputBuffer,
102 }
103
105 {
107 {
108
110 }
111
112 if (transferSize > DeviceExtension->ScratchContext.ScratchBufferSize)
113 {
114
116 }
117 }
118
120 {
121 UCHAR rmdBlockNumber = 0;
125
127
129
131
132
137
138 while (sendChangedCommand)
139 {
140
141
143
144 if (shouldRetry)
145 {
146 status = ScratchBuffer_ExecuteCdb(DeviceExtension,
Request, transferSize,
TRUE, &cdb, 12);
147 }
148
149 #ifdef ENABLE_AACS_TESTING
151 {
152 static const UCHAR results[] = { 0x80, 0x02, 0x00, 0x02 };
155 }
157 {
158 static const UCHAR results[] = { 0x80, 0x02, 0x00, 0x02 };
159 static const UCHAR defaultFill = 0x30;
160 RtlFillMemory(DeviceExtension->ScratchContext.ScratchBuffer, 0x8004, defaultFill);
163 }
164 #endif
165
167 {
168
172
173
174 if (otherPacks == 0)
175 {
177 "AACS: Device is reporting zero total packs (invalid)\n"));
180 }
181 else
182 {
183 otherPacks--;
184
186 {
187
188 if (otherPacks != thisPackNumber)
189 {
190
191
192
193
194
195
197
198
199 rmdBlockNumber = otherPacks;
200
202
203
205
206
207 sendChangedCommand =
TRUE;
209 }
210 else
211 {
212
213
216 {
219 }
220 else
221 {
223
224
227
228
229 *((
PULONG)outputBuffer) = totalSize;
232 }
233
234 sendChangedCommand =
FALSE;
236 }
237 }
239 {
240
242
243
245 {
248 }
249 else
250 {
251
253 size_t originalBufferSize;
254
255
256
258
259
261
262
264
266 {
267
270 }
271 else
272 {
274
275 whereToCopy = outputBuffer;
277
279
280
281
284
285
286 if (thisPackNumber != otherPacks)
287 {
288
289
290
291
292
293
295
296
298
299
300
302
303
305
306
307 sendChangedCommand =
TRUE;
309 }
310 else
311 {
312
313 sendChangedCommand =
FALSE;
314 }
315 }
316 }
317
318 }
319 }
320 }
321
323 {
324
325 sendChangedCommand =
FALSE;
326 }
327 }
328
330 }
331
333}
static struct _test_info results[8]
#define AACS_MKB_PACK_SIZE
_In_ ULONG _In_opt_ WDFREQUEST _In_opt_ PVOID _In_ size_t _In_ PVOID _In_ size_t _Out_ size_t * DataLength
#define SCSIOP_READ_DVD_STRUCTURE
#define NT_SUCCESS(StatCode)
_In_opt_ WDFREQUEST _In_opt_ PWDF_REQUEST_PARAMETERS RequestParameters
struct _DVD_DESCRIPTOR_HEADER DVD_DESCRIPTOR_HEADER
#define RtlFillMemory(Dest, Length, Fill)
#define RTL_SIZEOF_THROUGH_FIELD(type, field)
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define STATUS_INTERNAL_ERROR
#define IOCTL_AACS_READ_MEDIA_KEY_BLOCK
#define IOCTL_AACS_READ_MEDIA_KEY_BLOCK_SIZE
VOID ScratchBuffer_ResetItems(_Inout_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ BOOLEAN ResetRequestHistory)
FORCEINLINE VOID ScratchBuffer_EndUse(_Inout_ PCDROM_DEVICE_EXTENSION DeviceExtension)
#define ScratchBuffer_BeginUse(context)
struct _READ_DVD_STRUCTURES_HEADER READ_DVD_STRUCTURES_HEADER
#define REVERSE_SHORT(Short)
#define STATUS_BUFFER_TOO_SMALL
#define TRACE_LEVEL_WARNING
union _WDF_REQUEST_PARAMETERS::@3883 Parameters
struct _WDF_REQUEST_PARAMETERS::@3883::@3887 DeviceIoControl
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define STATUS_IO_DEVICE_ERROR
struct _CDB::_READ_DVD_STRUCTURE READ_DVD_STRUCTURE