+NTSTATUS
+AfdQueryFsDeviceInfo(PDEVICE_OBJECT DeviceObject, PFILE_FS_DEVICE_INFORMATION Buffer, PULONG Length)
+{
+ if (*Length >= sizeof(FILE_FS_DEVICE_INFORMATION))
+ {
+ Buffer->Characteristics = 0;
+ Buffer->DeviceType = FILE_DEVICE_NAMED_PIPE;
+
+ *Length -= sizeof(FILE_FS_DEVICE_INFORMATION);
+
+ return STATUS_SUCCESS;
+ }
+ else
+ {
+ ASSERT(*Length >= sizeof(FILE_FS_DEVICE_INFORMATION));
+ return STATUS_INFO_LENGTH_MISMATCH;
+ }
+}
+
+static NTSTATUS NTAPI
+AfdQueryVolumeInformation(PDEVICE_OBJECT DeviceObject, PIRP Irp, PIO_STACK_LOCATION IrpSp)
+{
+ FS_INFORMATION_CLASS InfoClass;
+ PVOID Buffer;
+ ULONG Length;
+ NTSTATUS Status = STATUS_INVALID_INFO_CLASS;
+
+ Buffer = Irp->AssociatedIrp.SystemBuffer;
+ Length = IrpSp->Parameters.QueryVolume.Length;
+ InfoClass = IrpSp->Parameters.QueryVolume.FsInformationClass;
+
+ switch (InfoClass)
+ {
+ case FileFsDeviceInformation:
+ Status = AfdQueryFsDeviceInfo(DeviceObject, Buffer, &Length);
+ break;
+ default:
+ break;
+ }
+
+ Irp->IoStatus.Status = Status;
+ Irp->IoStatus.Information = IrpSp->Parameters.QueryVolume.Length - Length;
+ IoCompleteRequest(Irp, IO_NETWORK_INCREMENT);
+
+ return Status;
+}
+