PFSDNOTIFICATIONPROC FSDNotificationProc;
} FS_CHANGE_NOTIFY_ENTRY, *PFS_CHANGE_NOTIFY_ENTRY;
-
/* GLOBALS ******************************************************************/
static ERESOURCE FileSystemListLock;
#ifndef LIBCAPTIVE
+/*
+ * @implemented
+ */
NTSTATUS STDCALL
NtFsControlFile (
IN HANDLE DeviceHandle,
PFILE_OBJECT FileObject;
PDEVICE_OBJECT DeviceObject;
PIRP Irp;
- PIO_STACK_LOCATION StackPtr;
+ PEXTENDED_IO_STACK_LOCATION StackPtr;
PKEVENT ptrEvent;
IO_STATUS_BLOCK IoSB;
ptrEvent,
&IoSB);
+ //trigger FileObject/Event dereferencing
+ Irp->Tail.Overlay.OriginalFileObject = FileObject;
+
Irp->Overlay.AsynchronousParameters.UserApcRoutine = ApcRoutine;
Irp->Overlay.AsynchronousParameters.UserApcContext = ApcContext;
- StackPtr = IoGetNextIrpStackLocation(Irp);
+ StackPtr = (PEXTENDED_IO_STACK_LOCATION) IoGetNextIrpStackLocation(Irp);
StackPtr->FileObject = FileObject;
StackPtr->DeviceObject = DeviceObject;
StackPtr->Parameters.FileSystemControl.InputBufferLength = InputBufferSize;
current_entry = current_entry->Flink;
continue;
}
- Status = IopMountFileSystem(current->DeviceObject,
- DeviceObject);
+ /* If we are not allowed to mount this volume as a raw filesystem volume
+ then don't try this */
+#ifndef LIBCAPTIVE
+ if (!AllowRawMount && RawFsIsRawFileSystemDeviceObject(current->DeviceObject))
+ {
+ Status = STATUS_UNRECOGNIZED_VOLUME;
+ }
+ else
+#endif /* LIBCAPTIVE */
+ {
+ Status = IopMountFileSystem(current->DeviceObject,
+ DeviceObject);
+ }
switch (Status)
{
case STATUS_FS_DRIVER_REQUIRED:
*
* RETURN VALUE
* Status
+ *
+ * @implemented
*/
NTSTATUS STDCALL
IoVerifyVolume(IN PDEVICE_OBJECT DeviceObject,
KEVENT Event;
PIRP Irp;
NTSTATUS Status;
+ PDEVICE_OBJECT DevObject;
DPRINT("IoVerifyVolume(DeviceObject %x AllowRawMount %x)\n",
DeviceObject, AllowRawMount);
if (DeviceObject->Vpb->Flags & VPB_MOUNTED)
{
/* Issue verify request to the FSD */
+ DevObject = DeviceObject->Vpb->DeviceObject;
KeInitializeEvent(&Event,
NotificationEvent,
FALSE);
- Irp = IoAllocateIrp(DeviceObject->StackSize, TRUE);
+ Irp = IoAllocateIrp(DevObject->StackSize, TRUE);
if (Irp==NULL)
{
return(STATUS_INSUFFICIENT_RESOURCES);
StackPtr->MinorFunction = IRP_MN_VERIFY_VOLUME;
StackPtr->Flags = 0;
StackPtr->Control = 0;
- StackPtr->DeviceObject = DeviceObject;
+ StackPtr->DeviceObject = DevObject;
StackPtr->FileObject = NULL;
StackPtr->CompletionRoutine = NULL;
StackPtr->Parameters.VerifyVolume.Vpb = DeviceObject->Vpb;
StackPtr->Parameters.VerifyVolume.DeviceObject = DeviceObject;
- Status = IoCallDriver(DeviceObject,
+ Status = IoCallDriver(DevObject,
Irp);
if (Status==STATUS_PENDING)
{
}
+/*
+ * @implemented
+ */
PDEVICE_OBJECT STDCALL
IoGetDeviceToVerify(IN PETHREAD Thread)
/*
}
+/*
+ * @implemented
+ */
VOID STDCALL
IoSetDeviceToVerify(IN PETHREAD Thread,
IN PDEVICE_OBJECT DeviceObject)
#endif /* LIBCAPTIVE */
+/*
+ * @implemented
+ */
VOID STDCALL
IoSetHardErrorOrVerifyDevice(IN PIRP Irp,
IN PDEVICE_OBJECT DeviceObject)
}
+/*
+ * @implemented
+ */
VOID STDCALL
IoRegisterFileSystem(IN PDEVICE_OBJECT DeviceObject)
{
Fs->DeviceObject = DeviceObject;
ExAcquireResourceExclusiveLite(&FileSystemListLock, TRUE);
- InsertTailList(&FileSystemListHead,
+ /* The RAW filesystem device objects must be last in the list so the
+ raw filesystem driver is the last filesystem driver asked to mount
+ a volume. It is always the first filesystem driver registered so
+ we use InsertHeadList() here as opposed to the other alternative
+ InsertTailList(). */
+ InsertHeadList(&FileSystemListHead,
&Fs->Entry);
ExReleaseResourceLite(&FileSystemListLock);
}
+/*
+ * @implemented
+ */
VOID STDCALL
IoUnregisterFileSystem(IN PDEVICE_OBJECT DeviceObject)
{
*
* NOTE
* From Bo Branten's ntifs.h v13.
+ *
+ * @implemented
*/
PDEVICE_OBJECT STDCALL
IoGetBaseFileSystemDeviceObject(IN PFILE_OBJECT FileObject)
}
+/*
+ * @implemented
+ */
NTSTATUS STDCALL
IoRegisterFsRegistrationChange(IN PDRIVER_OBJECT DriverObject,
IN PFSDNOTIFICATIONPROC FSDNotificationProc)
}
+/*
+ * @implemented
+ */
VOID STDCALL
IoUnregisterFsRegistrationChange(IN PDRIVER_OBJECT DriverObject,
IN PFSDNOTIFICATIONPROC FSDNotificationProc)