-
Notifications
You must be signed in to change notification settings - Fork 674
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use IoRegisterFileSystem #47
Comments
After setting up a Checked Win8.1 OS, I end up to the same assertion than describe on OSROnline thread. We should focus on the workaround provided by Max. |
Return fake drive layout/partition information
Return fake drive layout/partition information
I fixed it on temporary mountmanager branch. But this didn't resolve mini filter driver attachment. I believe it will not work as long we don't really support mount manager. I will create a specific issue for mount manager as it could require discussion. |
@Maxhy Just as info, dokan has some duplicate code in the start (DokanCreateDiskDevice) and IRP_MN_MOUNT_VOLUME. |
I agree this is not explicitly said somewhere by Microsoft. After hours of testing that's my conclusion but maybe I missed something :). I don't know any project outside Dokan that was working this way, all projects/samples that I'm aware of use a different device for file system and volume. But if I take a look again on the documentation https://msdn.microsoft.com/en-us/library/windows/hardware/ff543147(v=vs.85).aspx, Vpb field: |
The documentation is correct. So when the IRP_MN_MOUNT_VOLUME occures the command of creating device should look the following way.
or in our case the secure method should be used. So the fix may be just to leave the name NULL like in my example. The system checks if the Vpb has a device associated. If not or the Device is not mounted, it executes the IRP_MN_MOUNT_VOLUME on the dokan driver. Dokan creates then the device without name and makes the association to Vpb. |
That's it. But some additional stuffs are required to handle correctly the independent file system object which will also receive IOCTL on his own. |
@Maxhy |
@marinkobabic I got your point but for me:
I will do the test later but I think file system should be named for IoRegisterFileSystem registration (not sure) and anyway it would be an issue if it is not named for network file system (see Line 335 in 62447bf
|
|
Oh... I didn't saw it that way... |
Hi.
FsRtlRegisterUncProvider makes a chance to catch UNC path access:
Currently dokan seems not to implement UNC support things. Line 457 in 08b09a3
|
I can just confirm what kenjiuno described above. Dokan has some methods already ( Line 331 in 62447bf
For the network drive the FILE_DEVICE_NETWORK_FILE_SYSTEM should be used, in my opinion. |
That's right. Maybe this should be removed from stable code and a specific branch created for this development purpose if requested. |
@marinkobabic after testing your assumptions I'm not sure you're right as the issue remains with your unique set of changes. Did you have a chance to test it on your side? |
Haven't tested it yet. On which operating system are you testing? Do I need any special configuration to get it failed. |
I'm testing on Win8.1 x64. Or see following patch that I used for my latest test: https://gist.github.com/Maxhy/5bcfec9c4350352c45aa |
I have done some research and here the results explained: "If somebody tries to open a file the I/O manager checks to see whether \Device This means that IoRegisterFileSystem for dokan is not a must. If you want to register the filesystem, so please do it in DriverEntry like in the example of fastfat and cdfs. The name you will use there will be RtlInitUnicodeString( &UnicodeString, L"\Dokan" ); This process is totally independent of other stuff we do in the driver. The device used for the IoRegisterFileSystem does not represent the Volume nor Disk Device. Inside of the MountVolume routine IoCreateDevice should create a file system device without a name. The pointer of the file system device, which in this case represents the Volume must be set on DeviceObject of the vpb. The vpb->RealDevice is the device created using the option FILE_DEVICE_DISK and it is not the created volume device. |
Mhhh good that's a progress but I still have some points to discuss.
|
It makes sense to finish this task. I would suggest to go on with this task and to complete it. From my point of view the highest priority has the oplock implementation, to be able to support Windows 8 and following systems properly. Please let me know, whenever you want me to make a review of the code. |
That's a way to do it indeed :) I will make the change on the branch (https://github.com/dokan-dev/dokany/blob/master/sys/fscontrol.c#L326 check will need to be changed too, maybe based on disk device name through ObQueryNameString) and let you know. EDIT: about priorities, mount manager support is really important for me, then yes maybe oplock. PR are also highly appreciated ;) |
Will see what I can do ;-) |
Return fake drive layout/partition information
Return fake drive layout/partition information
@marinkobabic @Liryna @kenjiuno I had the opportunity to work again on mount manager support. The part related to this specific issue is completed and I would love to have your feedback on this before going further on mount manager support (mntmgr is basically working but improvements are still required to work 100% as excepted). See current changes on https://github.com/dokan-dev/dokany/tree/mountmanager branch. Thanks. |
@Maxhy |
Ok thanks for the quick review. |
Return fake drive layout/partition information
Ok closing this here as it is part of #50, continue discussion on this last thread. |
File system driver should be registered using
IoRegisterFileSystem
.This was disabled in 2010 on svn r139 by Hiroki Asakawa, see https://code.google.com/p/dokan/source/diff?spec=svn139&r=139&format=side&path=/trunk/sys/init.c
This is bad practice ; mini filter drivers, process monitor, ... cannot be used over Dokan because of that which today result to breaking several applications.
With current code base the BSOD remains if using IoRegisterFileSystem. According to my investigation it has nothing to do with Asakawa statement FS_FILTER_CALLBACKS.PreAcquireForSectionSynchronization is not correctly called in that case but seems to be related to http://www.osronline.com/showThread.cfm?link=74100
The text was updated successfully, but these errors were encountered: