Function: UDFFSControl()
Description:
- The I/O Manager will invoke this routine to handle a File System
+ The I/O Manager will invoke this routine to handle a File System
Control request (this is IRP_MJ_FILE_SYSTEM_CONTROL dispatch point)
*/
to be deferred to a worker thread context)
Return Value: STATUS_SUCCESS/Error
-*/
+*/
NTSTATUS
NTAPI
IrpSp = IoGetCurrentIrpStackLocation(Irp);
ASSERT(IrpSp);
- switch ((IrpSp)->MinorFunction)
+ switch ((IrpSp)->MinorFunction)
{
case IRP_MN_USER_FS_REQUEST:
UDFPrint((" UDFFSControl: UserFsReq request ....\n"));
-
+
RC = UDFUserFsCtrlRequest(PtrIrpContext,Irp);
break;
case IRP_MN_MOUNT_VOLUME:
UDFPrint((" UDFFSControl: MOUNT_VOLUME request ....\n"));
-
+
RC = UDFMountVolume(PtrIrpContext,Irp);
break;
case IRP_MN_VERIFY_VOLUME:
UDFPrint((" UDFFSControl: VERIFY_VOLUME request ....\n"));
- RC = UDFVerifyVolume(Irp);
+ RC = UDFVerifyVolume(Irp);
break;
default:
UDFPrintErr((" UDFFSControl: STATUS_INVALID_DEVICE_REQUEST MinorFunction %x\n", (IrpSp)->MinorFunction));
IoCompleteRequest(Irp, IO_DISK_INCREMENT);
break;
}
-
+
//try_exit: NOTHING;
} _SEH2_FINALLY {
if (!_SEH2_AbnormalTermination()) {
IoCompleteRequest(Irp,IO_DISK_INCREMENT);
return RC;
-
+
} // end UDFUserFsCtrlRequest()
_SEH2_TRY {
UDFScanForDismountedVcb(PtrIrpContext);
-
+
if(WrongMedia) try_return(RC = STATUS_UNRECOGNIZED_VOLUME);
if(RemovableMedia) {
KeDelayExecutionThread(KernelMode, FALSE, &delay);
}
}
-
+
// Now we can get device state via GET_EVENT (if supported)
// or still one TEST_UNIT_READY command
RC = UDFPhSendIOCTL( IOCTL_STORAGE_CHECK_VERIFY,
NULL,0,
&MediaChangeCount,sizeof(ULONG),
FALSE,&Iosb );
-
+
if(RC == STATUS_IO_DEVICE_ERROR) {
UDFPrint(("UDFMountVolume: retry check verify\n"));
RC = UDFPhSendIOCTL( IOCTL_STORAGE_CHECK_VERIFY,
Vcb->IsVolumeJustMounted = TRUE;
KeSetEvent(UDFGlobalData.MountEvent, 0, FALSE);
}
-
+
// The new mount is complete.
UDFReleaseResource( &(Vcb->VCBResource) );
VcbAcquired = FALSE;
/*
Vcb->CDBurnerVolumeValid = true;
- len =
+ len =
Vcb->CDBurnerVolume.Length = 256;
Vcb->CDBurnerVolume.MaximumLength = 256;
Vcb->CDBurnerVolume.Buffer = (PWCHAR)ExAllocatePool(NonPagedPool, 256);
DbgFreePool(Vcb->FSBM_OldBitmap);
Vcb->FSBM_OldBitmap = NULL;
}
-
+
MyFreeMemoryAndPointer(Vcb->Statistics);
MyFreeMemoryAndPointer(Vcb->NTRequiredFCB);
MyFreeMemoryAndPointer(Vcb->VolIdent.Buffer);
MyFreeMemoryAndPointer(Vcb->WParams);
MyFreeMemoryAndPointer(Vcb->Error);
MyFreeMemoryAndPointer(Vcb->TrackMap);
-
+
} // end UDFCleanupVCB()
/*
// Walk through all of the Vcb's attached to the global data.
Link = UDFGlobalData.VCBQueue.Flink;
-
+
while (Link != &(UDFGlobalData.VCBQueue)) {
Vcb = CONTAINING_RECORD( Link, VCB, NextVCB );
CurName.Buffer = PathName.Buffer - CurName.Length;
CurName.Length *= sizeof(WCHAR);
CurName.MaximumLength -= CurName.Length;
-
+
if (CurName.Length) {
// check path fragment size
if (CurName.Length > UDF_NAME_LEN*sizeof(WCHAR)) {
} else {
try_return(RC = STATUS_SUCCESS);
}
- }
+ }
try_exit: NOTHING;
} _SEH2_FINALLY {
Irp->IoStatus.Information = 0;
if(!NT_SUCCESS(RC)) {
UDFNotifyVolumeEvent(IrpSp->FileObject, FSRTL_VOLUME_LOCK_FAILED);
}
-
+
// Complete the request if there haven't been any exceptions.
Irp->IoStatus.Information = 0;
Irp->IoStatus.Status = RC;