161{
167 ULONG MediaChangeCount = 0;
171
172
173
174
176
177
178
179
182
184
185 UDFPrint((
"UDFVerifyVolume: Modified=%d\n",
Vcb->Modified));
186
187
188
189
192 UDFPrint((
"UDFVerifyVolume: STATUS_SUCCESS (1)\n"));
194 }
195 Vcb->VCBFlags &= ~UDF_VCB_FLAGS_UNSAFE_IOCTL;
196
198 Vcb->TargetDeviceObject,
200 &MediaChangeCount,
sizeof(
ULONG),
202
204
205
207 UDFPrint((
"UDFVerifyVolume: STATUS_WRONG_VOLUME (1)\n"));
209 }
210
212 UDFPrint((
"UDFVerifyVolume: STATUS_WRONG_VOLUME (2)\n"));
214 }
216 }
217
219
220 MediaChangeCount = 0;
221 }
222
223 UDFPrint((
"UDFVerifyVolume: Modified=%d\n",
Vcb->Modified));
224 UDFPrint((
"UDFVerifyVolume: MediaChangeCount=%x, Vcb->MediaChangeCount=%x, UnsafeIoctl=%x\n",
225 MediaChangeCount,
Vcb->MediaChangeCount, UnsafeIoctl));
226
227
228 if(MediaChangeCount == 0 ||
229 (
Vcb->MediaChangeCount != MediaChangeCount) ||
230 UnsafeIoctl ) {
231
232 UDFPrint((
"UDFVerifyVolume: compare\n"));
233
235 if(!NewVcb)
238
239 NewVcb->TargetDeviceObject =
Vcb->TargetDeviceObject;
241
242
243
246 }
247
250
253
254 UDFPrint((
"UDFVerifyVolume: Modified=%d\n",
Vcb->Modified));
257
260 UDFPrint((
"UDFVerifyVolume: it was very BAD volume. Do not perform Logical check\n"));
261 goto skip_logical_check;
262 }
263
264
266
270 NewVcb->WriteBlockSize,
271 5, NewVcb->BlockSizeBits,
273 0, NewVcb->LastPossibleLBA,
Mode,
274 0 |
279#ifdef UDF_ASYNC_IO
280 UDFTWriteAsync, UDFTReadAsync,
281#else
283#endif
287
288 UDFPrint((
"UDFVerifyVolume: Modified=%d\n",
Vcb->Modified));
290 UDFPrint((
" NewVcb->NSRDesc=%x\n", NewVcb->NSRDesc));
295 UDFPrint((
"UDFVerifyVolume: both are RAW -> remount\n",
Vcb->Modified));
297 goto skip_logical_check;
298 }
301 }
303 }
304
308
310
311 UDFPrint((
"UDFVerifyVolume: Modified=%d\n",
Vcb->Modified));
314
315
318
319skip_logical_check:;
320
321 }
322
323 UDFPrint((
"UDFVerifyVolume: compared\n"));
324 UDFPrint((
"UDFVerifyVolume: Modified=%d\n",
Vcb->Modified));
326 UDFPrint((
"UDFVerifyVolume: set UDF_VCB_FLAGS_VOLUME_MOUNTED\n"));
329 }
331
333
335
336
337
338 Vcb->MediaChangeCount = MediaChangeCount;
339
340
342 UDFPrint((
"UDFVerifyVolume: clear UDF_VCB_FLAGS_VOLUME_MOUNTED\n"));
343 Vcb->VCBFlags &= ~UDF_VCB_FLAGS_VOLUME_MOUNTED;
345
346 if(
Vcb->EjectWaiter) {
350 }
351 } else
355 UDFPrint((
" !!! VerifyVolume - QUICK REMOUNT !!!\n"));
356
358 if(!CacheInitialized) {
361 Vcb->WCacheMaxFrames,
362 Vcb->WCacheMaxBlocks,
364 5,
Vcb->BlockSizeBits,
365 Vcb->WCacheBlocksPerFrameSh,
367 0 |
370 Vcb->WCacheFramesToKeepFree,
371
373#ifdef UDF_ASYNC_IO
374 UDFTWriteAsync, UDFTReadAsync,
375#else
377#endif
380 }
382 if(!
Vcb->VerifyCtx.VInited) {
384 }
385 }
387
388 if(!CacheInitialized) {
393 UDFPrint((
"UDFMountVolume: RAM mode\n"));
395 } else {
396 UDFPrint((
"UDFMountVolume: RW mode\n"));
398 }
399
400
401
402
403 } else {
405 }
406 }
408
412 }
413
417 }
418 UDFPrint((
"UDFVerifyVolume: try start EjectWaiter\n"));
421 UDFPrint((
"UDFVerifyVolume: start EjectWaiter failed\n"));
422 Vcb->VCBFlags &= ~UDF_VCB_FLAGS_VOLUME_MOUNTED;
424 }
425 }
426 }
427
428 if(NewVcb) {
429
430 UDFPrint((
"UDFVerifyVolume: delete NewVcb\n"));
433
434 ASSERT(!(NewVcb->EjectWaiter));
435
436
438
441 }
445
446
447 Irp->IoStatus.Information = 0;
448
449 Irp->IoStatus.Status = RC;
451
452 UDFPrint((
"UDFVerifyVolume: RC = %x\n", RC));
453
454 return RC;
455}
uint32 UDFIsBlockAllocated(IN void *_Vcb, IN uint32 Lba)
#define CdrwMediaClassEx_IsRAM(MediaClassEx)
NTSTATUS UDFWCacheErrorHandler(IN PVOID Context, IN PWCACHE_ERROR_CONTEXT ErrorInfo)
NTSTATUS NTAPI UDFPhSendIOCTL(IN ULONG IoControlCode, IN PDEVICE_OBJECT DeviceObject, IN PVOID InputBuffer, IN ULONG InputBufferLength, OUT PVOID OutputBuffer, IN ULONG OutputBufferLength, IN BOOLEAN OverrideVerify, OUT PIO_STATUS_BLOCK Iosb OPTIONAL)
#define UDFAcquireResourceShared(Resource, CanWait)
IN OUT PVCB IN PDEVICE_OBJECT IN PVPB Vpb
NTSTATUS UDFStartEjectWaiter(IN PVCB Vcb)
VOID UDFCleanupVCB(IN PVCB Vcb)
OSSTATUS UDFGetDiskInfoAndVerify(IN PDEVICE_OBJECT DeviceObject, IN PVCB Vcb)
#define FILE_REMOVABLE_MEDIA
OSSTATUS UDFTWrite(IN void *_Vcb, IN void *Buffer, IN SIZE_T Length, IN uint32 LBA, OUT PSIZE_T WrittenBytes, IN uint32 Flags)
OSSTATUS UDFTRead(IN void *_Vcb, IN void *Buffer, IN SIZE_T Length, IN uint32 LBA, OUT PSIZE_T ReadBytes, IN uint32 Flags)
OSSTATUS UDFGetDiskInfo(IN PDEVICE_OBJECT DeviceObject, IN PVCB Vcb)
OSSTATUS UDFTReadVerify(IN void *_Vcb, IN void *Buffer, IN SIZE_T Length, IN uint32 LBA, OUT PSIZE_T ReadBytes, IN uint32 Flags)
OSSTATUS UDFTWriteVerify(IN void *_Vcb, IN void *Buffer, IN SIZE_T Length, IN uint32 LBA, OUT PSIZE_T WrittenBytes, IN uint32 Flags)
OSSTATUS UDFVInit(IN PVCB Vcb)
union _IO_STACK_LOCATION::@1580 Parameters
struct _IO_STACK_LOCATION::@3979::@4000 VerifyVolume
ULONG WCacheFramesToKeepFree
ULONG WCacheBlocksPerFrameSh
#define UDF_VCB_FLAGS_VOLUME_LOCKED
#define UDF_VCB_FLAGS_VOLUME_READ_ONLY
#define UDF_VCB_FLAGS_RAW_DISK
#define UDF_VCB_FLAGS_MEDIA_READ_ONLY
OSSTATUS UDFUpdateVAT(IN void *_Vcb, IN uint32 Lba, IN uint32 *RelocTab, IN uint32 BCount)
#define UDFNtAclSupported(Vcb)
#define VRS_ISO9660_FOUND
#define STATUS_UNRECOGNIZED_VOLUME
#define STATUS_INSUFFICIENT_RESOURCES
#define MOUNT_ERR_THRESHOLD
#define UDFSetFlag(Flag, Value)
#define UDFClearFlag(Flag, Value)
NTSTATUS UDFCompareVcb(IN PVCB OldVcb, IN PVCB NewVcb, IN BOOLEAN PhysicalOnly)
VOID WCacheFlushAll__(IN PW_CACHE Cache, IN PVOID Context)
BOOLEAN WCacheIsInitialized__(IN PW_CACHE Cache)
VOID WCacheRelease__(IN PW_CACHE Cache)
OSSTATUS WCacheInit__(IN PW_CACHE Cache, IN ULONG MaxFrames, IN ULONG MaxBlocks, IN SIZE_T MaxBytesToRead, IN ULONG PacketSizeSh, IN ULONG BlockSizeSh, IN ULONG BlocksPerFrameSh, IN lba_t FirstLba, IN lba_t LastLba, IN ULONG Mode, IN ULONG Flags, IN ULONG FramesToKeepFree, IN PWRITE_BLOCK WriteProc, IN PREAD_BLOCK ReadProc, IN PWRITE_BLOCK_ASYNC WriteProcAsync, IN PREAD_BLOCK_ASYNC ReadProcAsync, IN PCHECK_BLOCK CheckUsedProc, IN PUPDATE_RELOC UpdateRelocProc, IN PWC_ERROR_HANDLER ErrorHandlerProc)
OSSTATUS WCacheSetMode__(IN PW_CACHE Cache, IN ULONG Mode)
ULONG WCacheChFlags__(IN PW_CACHE Cache, IN ULONG SetFlags, IN ULONG ClrFlags)
#define WCACHE_RO_BAD_BLOCKS
#define WCACHE_CACHE_WHOLE_PACKET
#define WCACHE_MARK_BAD_BLOCKS
#define WCACHE_DO_NOT_COMPARE
#define WCACHE_CHAINED_IO
#define SL_ALLOW_RAW_MOUNT