FileObject->Flags = FileObject->Flags | FO_DIRECT_DEVICE_OPEN;
FileObject->FileName.Buffer = 0;
FileObject->FileName.Length = FileObject->FileName.MaximumLength = 0;
+ FileObject->Vpb = DeviceObject->Vpb;
}
else
{
&& (DeviceObject->DeviceType != FILE_DEVICE_MAILSLOT))
{
CPRINT("Device was wrong type\n");
+ KeBugCheck(0);
return(STATUS_UNSUCCESSFUL);
}
Status);
return(Status);
}
+ if (!DeviceObject->Vpb)
+ KeBugCheck(0);
+ if (DeviceObject->Vpb->DeviceObject->Vpb)
+ KeBugCheck(0);
+ DeviceObject->Vpb->DeviceObject->Vpb=DeviceObject->Vpb;
+ DeviceObject->Vpb->Flags |= VPB_MOUNTED;
}
+
DeviceObject = DeviceObject->Vpb->DeviceObject;
DPRINT("FsDeviceObject %lx\n", DeviceObject);
}
RtlCreateUnicodeString(&(FileObject->FileName),
RemainingPath);
+ FileObject->Vpb = NULL;
}
DPRINT("FileObject->FileName %wZ\n",
DPRINT("FileObject %x DeviceObject %x\n",
FileObject,
DeviceObject);
- FileObject->Vpb = DeviceObject->Vpb;
FileObject->Type = InternalFileType;
FileObject->RelatedFileObject = NULL;
FileObject->FsContext2=NULL;
RtlZeroMemory(&AccessState, sizeof(AccessState));
- AccessState.RemainingDesiredAccess=0;
- AccessState.PreviouslyGrantedAccess=0;
+ AccessState.RemainingDesiredAccess=0; /* FIXME: Meaning? */
+ AccessState.PreviouslyGrantedAccess=DesiredAccess; /* FIXME: Meaning? */
+ /* 'OriginalDesiredAccess' is required during file create by ntfs.sys of NT-5.1sp1
+ * W32 undocumented.
+ */
+ AccessState.OriginalDesiredAccess=DesiredAccess; /* FIXME: Meaning? */
SecurityContext.SecurityQos = NULL; /* ?? */
SecurityContext.AccessState = &AccessState;
return (STATUS_UNSUCCESSFUL);
}
+#ifdef LIBCAPTIVE
+ /* Is it needed? What it means? It was seen in NT-5.1sp1 as
+ * IRP_DEFER_IO_COMPLETION | IRP_CREATE_OPERATION | IRP_SYNCHRONOUS_API
+ */
+ Irp->Flags = IRP_SYNCHRONOUS_API;
+#endif /* LIBCAPTIVE */
Irp->UserIosb = &IoSB; //return iostatus
Irp->AssociatedIrp.SystemBuffer = EaBuffer;
Irp->Tail.Overlay.AuxiliaryBuffer = (PCHAR)ExtraCreateParameters;
{
Irp->Overlay.AllocationSize = *AllocationSize;
}
+ /* Is it needed? What it means? It was seen in NT-5.1sp1 */
+ Irp->Tail.Overlay.OriginalFileObject = FileObject;
/*
* Get the stack location for the new
StackLoc->Parameters.Create.ShareAccess = ShareAccess;
StackLoc->Parameters.Create.EaLength = EaLength;
+#ifdef LIBCAPTIVE
+ /* Needed from libcaptive/client/init.c/dismount_volume()
+ * as we cannot pass just "\Devicename" as it would open the device
+ * itself instead of the filesystem; If passed "\Devicename\", the
+ * trailing '\' will remain in RemainingPath and such open will not
+ * be the VolumeOpen type we need for unmount.
+ */
+ if (FileObject->FileName.Length==13*2
+ && FileObject->FileName.Buffer[ 0]==L'\\'
+ && FileObject->FileName.Buffer[ 1]==L'!'
+ && FileObject->FileName.Buffer[ 2]==L'C'
+ && FileObject->FileName.Buffer[ 3]==L'a'
+ && FileObject->FileName.Buffer[ 4]==L'p'
+ && FileObject->FileName.Buffer[ 5]==L't'
+ && FileObject->FileName.Buffer[ 6]==L'i'
+ && FileObject->FileName.Buffer[ 7]==L'v'
+ && FileObject->FileName.Buffer[ 8]==L'e'
+ && FileObject->FileName.Buffer[ 9]==L'!'
+ && FileObject->FileName.Buffer[10]==L'd'
+ && FileObject->FileName.Buffer[11]==L'e'
+ && FileObject->FileName.Buffer[12]==L'l'
+ && FileObject->FileName.Buffer[13]==0)
+ {
+ FileObject->FileName.Length=0;
+ FileObject->FileName.Buffer=NULL;
+ }
+#endif /* LIBCAPTIVE */
+
/*
* Now call the driver and
* possibly wait if it can