dokan-dev / dokan-dotnet Goto Github PK
View Code? Open in Web Editor NEWDokan DotNet Wrapper
Home Page: http://dokan-dev.github.io
License: MIT License
Dokan DotNet Wrapper
Home Page: http://dokan-dev.github.io
License: MIT License
Is it possible to make changing of Volume label in Explorer? For now it says any new label is invalid.
Also there is some strange bug with volume labels in 1.1.0.0-rc2 with docany 1.0.0-RC2. For few seconds after mount when drive appears label is some random text, like part of some path. Then it changes to title I set in GetVolumeInformation. This is probably docany's problem. Tested in Windows 7
Hi,
using sample code (master branch):
1.open 1.jnt file
2.modify it
3.press save button
MS Journal.exe program is waiting for response always.
I test it in C mirror, and it work fine.
the log file in C mirror as follows:
c_mirror_log.txt
the log file in C# mirror as follows:
stdout:
c#_mirror_log_stdout.txt
stderr:
c#_mirror_log_stderr.txt
In c_mirror_log.txt a *.tmp file is created when saving 1.jnt, but in c#_mirror_log_stderr.txt,there is not temp file created, and the invalid handle error(6) occurs many times.
When I save the pdf on the dokany mirror, I get a valid CreateFile request:
CreateFile status = 3221225524 - lastError = 2
###Create 0135
CreateFile : C:\Temp\B\10.pdf
AccountName: , DomainName: -PC
ShareMode = 0x0
AccessMode = 0x12019f
FILE_READ_DATA
FILE_READ_ATTRIBUTES
FILE_READ_EA
READ_CONTROL
FILE_WRITE_DATA
FILE_WRITE_ATTRIBUTES
FILE_WRITE_EA
FILE_APPEND_DATA
SYNCHRONIZE
STANDARD_RIGHTS_READ
STANDARD_RIGHTS_WRITE
STANDARD_RIGHTS_EXECUTE
FlagsAndAttributes = 0x80
FILE_ATTRIBUTE_NORMAL
CREATE_ALWAYS
Whereas, when I try to save it on the dokannet mirror, I get:
CreateFile('\10.pdf', {<null>, False, False, False, False, #9876, False, False}, [ReadAttributes, Synchronize], [ReadWrite, Delete], [Open], [None], [Normal]) -> ObjectNameNotFound
Maybe CreateAlways is missing on DokanNet?
FindFilesWithPattern should be implemented in the wrapper.
Just a typo, but it might cause some confusion.
There is no problem with creating files and folders with long names. But when I try to rename file or folder in Explorer it does not allow names with spaces and longer 8 chars. Mirror is just pass through, it's hard to understand what exactly tells Explorer if long names supported or not.
Also small question about FindFile, maybe it's related. As I see Win32Api FindFirstFile supports wildcards. How important is implementing it. In my case I dont know about all files on Amazon CloudDrive and don't want to bother requesting all files. As I tried wildcards work in command line on my drive too.
Using the Mirror sample I experience an issue where thumbnails for picture files fail to generate correctly; only a smal horizontal stripe of the original image is visible and the rest of the thumbnail remains grey. Note that these pictures are JPEG files and fairly large in size (about 6Mb). Any clue as to why this happens?
Do note that thumbnails for these files generate correctly in their normal directory (not the mirror disk).
Hello,
Is there a way for me to request a bigger buffer from the OS at ReadFile?
I tried returning NtStatus.BufferTooSmall but it didn't make the OS request it again with a bigger buffer.
Thanks!
Maybe that's not Dokan.Net problem, but I'm not sure how it can be solved reliably and efficiently.
ReadFile has Offset parameter and presumes operation is atomic and buffer will be filled from that file offset even if another thread run ReadFile from different position.
But C# Streams have Position and Read separate.
In case of Windows Explorer file coping after one CreateFile calls ReadFile from multiple threads. In C# If another thread Stream.Position setter happens between other thread's Stream.Position and Stream.Read you get copied garbage from wrong positions of original file. I believe Mirror also has such problem, just try read files bigger 3Mb (Windows Explorer copy block size is about 500Kb) though in its case Position and Read gap is smaller than in mine.
For now I have two workarounds.
The following trace is the result of trying to copy the 3 MB file "BouncyCastle.1.7.0.nupkg" from a different drive into a Dokan.Net mirror volume (Mirror sample, drive D: mapped as R:, standard settings with 5 threads, Dokan 0.7.4 x64 on Windows 8.1 x64).
There is an epic failure at the end of the call sequence when Dokan tries to set the file date while the target file is still in use by another operation.
There is also at least one curious thread interference in the partial call sequence
CloseFileProxy : \Temp\Source
CreateFileProxy : \Temp\Source\BouncyCastle.1.7.0.nupkg
CreationDisposition Open
FileAccess ReadData, ReadExtendedAttributes, ReadAttributes, ReadPermissions, Synchronize
FileShare Read
Context
FileOptions None
FileAttributes Normal
Context
CreateFileProxy : \Temp\Source\BouncyCastle.1.7.0.nupkg Return : FileNotFound
CloseFileProxy : \Temp\Source Return : Success
Has anyone ever tested writing into a Mirror volume?
Trace below
D:\dokan-dotnet\sample\DokanNetMirror\bin\Debug>DokanNetMirror.exe
OpenDirectoryProxy :
Context
OpenDirectoryProxy : \ Return : SuccessGetVolumeInformationProxy
Context
VolumeNameBuffer DOKAN
FileSystemNameBuffer DOKAN
VolumeSerialNumber 21083178
FileSystemFlags CaseSensitiveSearch, CasePreservedNames, UnicodeOnDisk, PersistentAcls, SupportsRemoteStorage
GetVolumeInformationProxy Return : SuccessCleanupProxy :
Context
CleanupProxy : \ Return : SuccessCloseFileProxy :
Context
CloseFileProxy : \ Return : SuccessCreateFileProxy : \autorun.inf
CreationDisposition Open
FileAccess ReadAttributes
FileShare ReadWrite, Delete
FileOptions None
FileAttributes 0
Context
CreateFileProxy : \autorun.inf Return : FileNotFoundCreateFileProxy : \autorun.inf
CreationDisposition Open
FileAccess ReadData, ReadExtendedAttributes, ReadAttributes, ReadPermissions, Synchronize
FileShare ReadWrite, Delete
FileOptions None
FileAttributes 0
Context
CreateFileProxy : \autorun.inf Return : FileNotFoundCreateFileProxy : \autorun.inf
CreationDisposition Open
FileAccess ReadData, ReadExtendedAttributes, ReadAttributes, ReadPermissions, Synchronize
FileShare ReadWrite, Delete
FileOptions None
FileAttributes 0
Context
CreateFileProxy : \autorun.inf Return : FileNotFoundCreateFileProxy :
CreationDisposition Open
FileAccess ReadAttributes
FileShare ReadWrite, Delete
FileOptions None
FileAttributes 0
Context
CreateFileProxy : \ Return : SuccessGetFileInformationProxy :
Context Object
FileName
Attributes Hidden, System, Directory
CreationTime 08.10.2012 23:11:19
LastAccessTime 04.09.2015 20:53:03
LastWriteTime 04.09.2015 20:53:03
Length 0
GetFileInformationProxy : \ Return : SuccessCleanupProxy :
Context Object
CleanupProxy : \ Return : SuccessCloseFileProxy :
Context
CloseFileProxy : \ Return : SuccessCreateFileProxy : \AutoRun.inf
CreationDisposition Open
FileAccess ReadAttributes
FileShare ReadWrite, Delete
FileOptions None
FileAttributes 0
Context
CreateFileProxy : \AutoRun.inf Return : FileNotFoundOpenDirectoryProxy :
Context
OpenDirectoryProxy : \ Return : SuccessGetVolumeInformationProxy
Context
VolumeNameBuffer DOKAN
FileSystemNameBuffer DOKAN
VolumeSerialNumber 21083178
FileSystemFlags CaseSensitiveSearch, CasePreservedNames, UnicodeOnDisk, PersistentAcls, SupportsRemoteStorage
GetVolumeInformationProxy Return : SuccessCleanupProxy :
Context
CleanupProxy : \ Return : SuccessCloseFileProxy :
Context
CloseFileProxy : \ Return : SuccessCreateFileProxy : \Temp\Source
CreationDisposition Open
FileAccess ReadAttributes
FileShare ReadWrite, Delete
FileOptions None
FileAttributes 0
Context
CreateFileProxy : \Temp\Source Return : SuccessGetFileInformationProxy : \Temp\Source
Context Object
FileName \Temp\Source
Attributes Directory
CreationTime 30.05.2014 21:33:09
LastAccessTime 04.09.2015 22:12:28
LastWriteTime 04.09.2015 22:12:28
Length 0
GetFileInformationProxy : \Temp\Source Return : SuccessCleanupProxy : \Temp\Source
Context Object
CleanupProxy : \Temp\Source Return : SuccessCloseFileProxy : \Temp\Source
CreateFileProxy : \Temp\Source\BouncyCastle.1.7.0.nupkg
CreationDisposition Open
FileAccess ReadData, ReadExtendedAttributes, ReadAttributes, ReadPermissions, Synchronize
FileShare Read
Context
FileOptions None
FileAttributes Normal
Context
CreateFileProxy : \Temp\Source\BouncyCastle.1.7.0.nupkg Return : FileNotFound
CloseFileProxy : \Temp\Source Return : SuccessCreateFileProxy : \Temp\Source\BouncyCastle.1.7.0.nupkg
CreationDisposition Open
FileAccess ReadAttributes
FileShare ReadWrite, Delete
FileOptions None
FileAttributes 0
Context
CreateFileProxy : \Temp\Source\BouncyCastle.1.7.0.nupkg Return : FileNotFoundCreateFileProxy : \Temp\Source\BouncyCastle.1.7.0.nupkg
CreationDisposition Create
FileAccess ReadData, WriteData, AppendData, ReadExtendedAttributes, WriteExtendedAttributes, ReadAttributes, WriteAttributes, Delete, Rea
dPermissions, ChangePermissions, Synchronize
FileShare None
FileOptions None
FileAttributes Archive
Context
CreateFileProxy : \Temp\Source\BouncyCastle.1.7.0.nupkg Return : SuccessGetVolumeInformationProxy
Context
VolumeNameBuffer DOKAN
FileSystemNameBuffer DOKAN
VolumeSerialNumber 21083178
FileSystemFlags CaseSensitiveSearch, CasePreservedNames, UnicodeOnDisk, PersistentAcls, SupportsRemoteStorage
GetVolumeInformationProxy Return : SuccessGetFileInformationProxy : \Temp\Source\BouncyCastle.1.7.0.nupkg
Context FileStream
FileName \Temp\Source\BouncyCastle.1.7.0.nupkg
Attributes Archive
CreationTime 04.09.2015 22:12:47
LastAccessTime 04.09.2015 22:12:47
LastWriteTime 04.09.2015 22:12:47
Length 0
GetFileInformationProxy : \Temp\Source\BouncyCastle.1.7.0.nupkg Return : SuccessSetEndOfFileProxy : \Temp\Source\BouncyCastle.1.7.0.nupkg
ByteOffset 3234973
Context FileStream
SetEndOfFileProxy : \Temp\Source\BouncyCastle.1.7.0.nupkg Return : SuccessWriteFileProxy : \Temp\Source\BouncyCastle.1.7.0.nupkg
NumberOfBytesToWrite 524288
Offset 0
Context FileStream
WriteFileProxy : \Temp\Source\BouncyCastle.1.7.0.nupkg Return : Success NumberOfBytesWritten : 524288WriteFileProxy : \Temp\Source\BouncyCastle.1.7.0.nupkg
NumberOfBytesToWrite 524288
Offset 524288
Context FileStream
WriteFileProxy : \Temp\Source\BouncyCastle.1.7.0.nupkg Return : Success NumberOfBytesWritten : 524288WriteFileProxy : \Temp\Source\BouncyCastle.1.7.0.nupkg
NumberOfBytesToWrite 524288
Offset 1048576
Context FileStream
WriteFileProxy : \Temp\Source\BouncyCastle.1.7.0.nupkg Return : Success NumberOfBytesWritten : 524288WriteFileProxy : \Temp\Source\BouncyCastle.1.7.0.nupkg
NumberOfBytesToWrite 524288
Offset 1572864
Context FileStream
WriteFileProxy : \Temp\Source\BouncyCastle.1.7.0.nupkg Return : Success NumberOfBytesWritten : 524288WriteFileProxy : \Temp\Source\BouncyCastle.1.7.0.nupkg
NumberOfBytesToWrite 524288
Offset 2097152
Context FileStream
WriteFileProxy : \Temp\Source\BouncyCastle.1.7.0.nupkg Return : Success NumberOfBytesWritten : 524288WriteFileProxy : \Temp\Source\BouncyCastle.1.7.0.nupkg
NumberOfBytesToWrite 524288
Offset 2621440
Context FileStream
WriteFileProxy : \Temp\Source\BouncyCastle.1.7.0.nupkg Return : Success NumberOfBytesWritten : 524288WriteFileProxy : \Temp\Source\BouncyCastle.1.7.0.nupkg
NumberOfBytesToWrite 89245
Offset 3145728
Context FileStream
WriteFileProxy : \Temp\Source\BouncyCastle.1.7.0.nupkg Return : Success NumberOfBytesWritten : 89245SetFileAttributesProxy : \Temp\Source\BouncyCastle.1.7.0.nupkg
Attributes 0
Context FileStream
SetFileAttributesProxy : \Temp\Source\BouncyCastle.1.7.0.nupkg Return : SuccessSetFileTimeProxy : \Temp\Source\BouncyCastle.1.7.0.nupkg
CreateTime
AccessTime
WriteTime 12.08.2015 21:33:48
Context FileStream
SetFileTimeProxy : \Temp\Source\BouncyCastle.1.7.0.nupkg Throw : The process cannot access the file "D:\Temp\Source\BouncyCastle.1.7.0.nupkg" because it is being used by another process.Unhandled Exception: System.IO.IOException: The process cannot access the file "D:\Temp\Source\BouncyCastle.1.7.0.nupkg" because it is being used by another process.
in System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
in System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, Fi
leOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
in System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
in System.IO.File.OpenFile(String path, FileAccess access, SafeFileHandle& handle)
in System.IO.File.SetLastWriteTimeUtc(String path, DateTime lastWriteTimeUtc)
in System.IO.File.SetLastWriteTime(String path, DateTime lastWriteTime)
in DokanNetMirror.Mirror.SetFileTime(String fileName, Nullable1 creationTime, Nullable
1 lastAccessTime, Nullable`1 lastWriteTime, DokanFileInfo
info) in D:\dokan-dotnet\sample\DokanNetMirror\Mirror.cs:Line 296.
in DokanNet.DokanOperationProxy.SetFileTimeProxy(String rawFileName, FILETIME& rawCreationTime, FILETIME& rawLastAccessTime, FILETIME& rawLastWrit
eTime, DokanFileInfo rawFileInfo) in D:\dokan-dotnet\DokanNet\DokanOperationProxy.cs:Line 668.
Dokan version = v0.7.3-beta
DokanNet version = v1.0.6.0 (via NuGet)
When you call mount on the IDokanOperations instance the following error occurs:
An unhandled exception of type 'System.EntryPointNotFoundException' occurred in DokanNet.dll
Additional information: Unable to find an entry point named 'DokanMain' in DLL 'dokan.dll'.
I then downloaded the dokan-dotnet master branch and compiled the dokannet locally and then ran the sample successfully; however, the reference via the NuGet package still does not work.
I want to prevent users other than mounter from accessing folders structure and file content.
DokanFileInfo.GetRequestor() is too slow to use in security check in every FindFile or CreateFile as it takes 11 seconds on each execution.
Is there any other way to check if requestor is the same user as mounter?
In the last commit (b7f3670), where DokanError class has been renamed to DokanResult, the .csproj file wasn't updated. Then, the respective files wasn't renamed in the project and is now missing.
I'm not a project contributor to publish the solution, so I'm submitting this issue. Hope it helps.
By the way: nice project, guys! Congratulations on your effort!
Hello @viciousviper ,
Sorry to both you but I have some issue to move the tests to the next CreateFile, I was hopping you could help me a little ๐
Now CreateFile handle the create & open directory.
I have try to fix it here: caa2b18
But appveyor or my testing environnement are unable to start a single test :(
As I understood, the CreateFile operations has to be changed to handle the Create/Open directory request.
Here is the Mirror CreateFile output I got when creating and opening a folder:
//CreateDirectory New folder
CreateFile('\Users\liryna\Desktop\New folder', {<null>, False, True, False, False, #4264, False, False}, [ReadData, Synchronize], [ReadWrite], [CreateNew], [2097152], [Normal]) -> Success
//OpenDirectory New folder
CreateFile('\Users\liryna\Desktop\New folder', {<null>, False, True, False, False, #4264, False, False}, [Execute, Synchronize], [ReadWrite], [Open], [None], [0]) -> Success
Since CreateFile is the first function called, inside that function i set a value to info.Context.
On subsequent calls to other functions like SetEndOfFile, ReadFile or WriteFile that variable sometimes is null, sometimes is not.
I read on dokan documentation that the context should remain the same in everything between CreateFile and CloseFile so can you please help me understand how it actually works?
When I set the disk to removable drive, and change the following in the sample:
public NtStatus GetDiskFreeSpace(out long free, out long total, out long used, DokanFileInfo info)
{
used = 5497345047671;
total = 5497345047671;
free = 5497345047671;
return Trace("GetDiskFreeSpace", null, info, DokanResult.Success, "out " + free.ToString(), "out " + total.ToString(), "out " + used.ToString());
}
and try to execute:
xcopy C:\Temp\E\2\* H:\A\B\*
I get:
Insufficient disk space on current disk.
Insert another disk and type <Return> to continue...
This only happens with the removable drive option.
Both network and fixed work well, and only the removable option has a problem with 5TB disks...
I do think that NativeMethods.DokanMain
locking the thread while something happens is more annoing than useful and would be better if that function would return after having the file system mounted and then implement some error handling function in the IDokanOperations
for errors that could happen in the future while immediate errors could stay there
Hello, good afternoon!
It's possible just mount the drive without any operation feature (Create, Delete, etc)?
For example, if I try copy a file to mounted drive, nothing happens.
My idea is use another application to manage this operations, not the Windows Explorer.
I was understandable?
Thank you!
Hi Liryna,
I have some issue with regards to the DeleteOnClose flag. This was apparently fixed at driver level here: dokan-dev/dokany#18
My app though still fails to delete files that were opened with "Delete On Close" flag.
This is the procmon log for Excel 2010 on a normal NTFS drive, when opening 4.xlsx the temporay file ~$4.xlsx will be openend. It will be closed and deleted when Excel is closed.
I have noticed that in ZwCreateFileProxy if the fileOptions.DeleteOnClose is set, rawFileInfo.DeleteOnClose is still false.
Cleanup and Close for the file in my app's drive are never called with DeleteOnClose=true which I would expect should happen.
The DokanNet mirror still does it correctly though. I see this in the log when Excel is closed:
The code in Cleanup "if (info.DeleteOnClose)" is never executed, the mirror FileStream for "~$4.xlsx" is apparently only deleted on Close because it was created with relayed FileOptions.
Shouldn't the DeleteOnClose flag be set on Close/Cleanup by DokanNet in these cases?
DokanError no longer exists. Need to rewrite smaples with DokanResult.
Hi!
When I try to run either sample from visual studio 2015, I get a System.BadImageFormatException in Dokan.cs line 102:
int status = NativeMethods.DokanMain(ref dokanOptions, ref dokanOperations);
I tried with x86 and x64 build targets, but the error is the same.
What could be the reason behind this?
Some test are now disable for appveyor (tagged as [TestCategory.Manual]) because they are not properly working and need to be fixed.
@viciousviper , I will make a new version tomorrow for your test.
Is it possible to use dokany to create virtual files (or folders) at existing volumes?
In my case it can be read-only. (Redirect calls from an archive to the extracted files.)
Hello,
I tried copying a file from the dokan drive to my NTFS drive and got a weird error:
This error appears only when I try to do this action on Win8. On Win7 it works great.
This action worked on Win8 in previous versions (0.7.4 and earlier).
Also, I'll add that reading the file works perfectly. Just copying it to a different disk doesn't work, which is weird, because it still calls the same functions (CreateFile, GetFileInformation, ReadFile, Cleanup, Close).
Oh, and sometimes this action crashes the program...
Thanks!
Updated dokany to 1.0.0-RC1 with new setup engine.
On running DokanNet.Tests I get a DllNotFoundException
for dokan1.dll from DokanOperations.Mount().
After copying the two dokan1.dll
files to %SystemRoot%\System32\
and %SystemRoot%\SysWOW64
, respectively, starting the unit test suite results in a BSOD.
Used to work on 1.0.0-beta1 :-(
Now what?
This is on Windows 10 x64.
Hi!
I'm using dokan-dotnet version 1.0.8. When I try to create a folder, in the explorer context menu, under New, I only have the folder option with the admin rights icon (shield). If I click that, I won't be asked about the folder name, but a "New folder" will be automatically created. If I run the mirror example, it works as expected and I'll be prompted to give the folder a name.
What could be the reason behind this behavior?
Thanks in advance!
Hi,
I created a new word file on the Dokan drive, changed its name, opened it, wrote some text and clicked save.
When I clicked save, the word app crashed.
I tested this both in my app and in the Mirror app and the same thing happened.
I'll mention that this operation worked on prev version (0.7.4) and I suspect it has something to do with the EnumerateNamedStreams function.
(Tested on Win8)
Please help :\
UPDATE: It works on Win7.
I'm currently evaluating Dokan with the .Net adaptor as a solution for implementing a virtual file system.
When I create a virtual file system in my application, and then open a .png file in Photos, (Windows 10, double-clicked via explorer,) the image displayed is truncated.
In contrast, I can successfully open the same .png file from a virtual file system from the sample Mirror.cs.
This leads me to believe that the problem is my application.
Any suggestions? I assume I'm making a silly mistake.
Windows 10. I'm trying to eject my filesystem drive mounted with DokanOptions.RemovableDrive flag, but the unmount does not happen and Unmounted() is not called. I get "An error occured while ejecting ..." error.
As I see in device.c from dokany:
case IOCTL_STORAGE_EJECT_MEDIA: {
DDbgPrint(" IOCTL_STORAGE_EJECT_MEDIA\n");
DokanUnmount(dcb);
status = STATUS_SUCCESS;
} break;
There should happen an automatic unmount, I see, but it does not happen. I haven't tried dokany itself with C interface.
Is the nuspec that builds https://www.nuget.org/packages/DokanNet available?
From @viciousviper
During FileInfo.MoveTo(), DirectoryInfo.MoveTo(), and FileInfo.Replace() there is an irritating call to IDokanOperations.OpenDirectory() with a blank filename (string.Empty) and no associated cleanup calls.
Test Sample C#
FileInfo test = new FileInfo("M:\\test.txt");
test.MoveTo("M:\\test2.txt");
Mirror.c
###Create 0070
CreateDisposition 0x00000001
CreateFile : C:\Users\test.txt
AccountName: liryna, DomainName: DESKTOP-RBPTIQA
OPEN_EXISTING
ShareMode = 0x7
FILE_SHARE_READ
FILE_SHARE_WRITE
FILE_SHARE_DELETE
AccessMode = 0x110080
DELETE
FILE_READ_ATTRIBUTES
SYNCHRONIZE
FlagsAndAttributes = 0x0
CreateFile status = 0
###GetFileInfo 0070
GetFileInfo : C:\Users\test.txt
GetFileInformationByHandle success, file size = 3
###GetFileInfo 0070
GetFileInfo : C:\Users\test.txt
GetFileInformationByHandle success, file size = 3
SL_OPEN_TARGET_DIRECTORY specified
###Create 0071
OpenDirectory : C:\Users
CreateFile status = 0
###SetFileInfo 0070 10
MoveFile C:\Users\test.txt -> C:\Users\test2.txt
###Cleanup 0071
Cleanup: C:\Users\test2.txt
###Close 0071
Close: C:\Users\test2.txt
###Cleanup 0070
Cleanup: C:\Users\test2.txt
invalid handle
###Close 0070
Close: C:\Users\test2.txt
With the C mirror there is no OpenDirectory() with a blank filename (string.Empty).
EDIT: OpenDirectoryProxy is called with (string.Empty) so there should be a issue in C->C#
Hi Liryna,
WinFSTest with DokanNetMirror returns unstable results, between 131/171 and 144/171, later runs tend to do worse than earlier ones:
.\t\base\00.t .........................
not ok 21 - expect "CreateFile b:\tmp\c9e96b21\bar GENERIC_WRITE 0 0 CREATE_NEW FILE_ATTRIBUTE_NORMAL 0" ERROR_PATH_NOT_FOUND - got ERROR_GEN_FAILURE
not ok 1/21
.\t\base\01.t .........................
not ok 4 - expect "GetFileInformation b:\tmp\057b4f31" <lambda>
not ok 7 - expect "GetFileInformation b:\tmp\057b4f31" <lambda>
not ok 10 - expect "GetFileInformation b:\tmp\057b4f31" <lambda>
not ok 3/11
.\t\base\02.t .........................
not ok 2 - expect "CreateDirectory b:\tmp\0a51ef16 0" ERROR_ALREADY_EXISTS - got ERROR_GEN_FAILURE
not ok 3 - expect "RemoveDirectory b:\tmp\0a51ef16" ERROR_DIRECTORY - got ERROR_GEN_FAILURE
not ok 6 - expect "CreateDirectory b:\tmp\0a51ef16 0" ERROR_ALREADY_EXISTS - got 0
not ok 8 - expect "DeleteFile b:\tmp\0a51ef16" ERROR_ACCESS_DENIED - got 0
not ok 9 - expect "RemoveDirectory b:\tmp\0a51ef16" 0 - got ERROR_GEN_FAILURE
not ok 10 - expect "RemoveDirectory b:\tmp\0a51ef16" ERROR_FILE_NOT_FOUND - got ERROR_GEN_FAILURE
not ok 6/10
.\t\base\03.t .........................
not ok 4 - expect "RemoveDirectory b:\tmp\6ba882d7\foo" ERROR_DIRECTORY - got ERROR_GEN_FAILURE
not ok 1/18
.\t\base\04.t .........................
not ok 24 - expect "MoveFileEx b:\tmp\6600ee40\bar b:\tmp\6600ee40\baz MOVEFILE_REPLACE_EXISTING" ERROR_ACCESS_DENIED - got 0
not ok 25 - expect "GetFileInformation b:\tmp\6600ee40\bar" 0 - got ERROR_FILE_NOT_FOUND
not ok 28 - expect "MoveFileEx b:\tmp\6600ee40\bar b:\tmp\6600ee40\baz MOVEFILE_REPLACE_EXISTING" 0 - got ERROR_FILE_NOT_FOUND
not ok 30 - expect "GetFileInformation b:\tmp\6600ee40\baz" 0 - got ERROR_FILE_NOT_FOUND
not ok 31 - expect "RemoveDirectory b:\tmp\6600ee40\baz" 0 - got ERROR_GEN_FAILURE
not ok 5/43
.\t\base\05.t ......................... ok
.\t\base\06.t ......................... ok
.\t\base\07.t ......................... ok
.\t\base\08.t ......................... ok
.\t\base\09.t .........................
not ok 1 - expect "CreateFile b:\tmp\7860bc16 GENERIC_READ FILE_SHARE_READ 0 OPEN_EXISTING 0 0" ERROR_SHARING_VIOLATION - got ERROR_FILE_NOT_FOUND
not ok 2 - expect "CreateFile b:\tmp\7860bc16 GENERIC_READ FILE_SHARE_WRITE 0 OPEN_EXISTING 0 0" 0 - got ERROR_GEN_FAILURE
not ok 3 - expect "CreateFile b:\tmp\7860bc16 DELETE FILE_SHARE_DELETE 0 OPEN_EXISTING 0 0" ERROR_SHARING_VIOLATION - got 0
not ok 4 - expect "CreateFile b:\tmp\7860bc16 DELETE FILE_SHARE_WRITE 0 OPEN_EXISTING 0 0" ERROR_SHARING_VIOLATION - got 0
not ok 6 - expect "CreateFile b:\tmp\7860bc16 GENERIC_WRITE FILE_SHARE_WRITE 0 OPEN_EXISTING 0 0" ERROR_SHARING_VIOLATION - got 0
not ok 8 - expect "CreateFile b:\tmp\7860bc16 DELETE FILE_SHARE_DELETE 0 OPEN_EXISTING 0 0" ERROR_SHARING_VIOLATION - got 0
not ok 9 - expect "CreateFile b:\tmp\7860bc16 DELETE FILE_SHARE_WRITE 0 OPEN_EXISTING 0 0" ERROR_SHARING_VIOLATION - got 0
not ok 10 - expect_task "CreateFile b:\tmp\7860bc16 GENERIC_READ FILE_SHARE_WRITE 0 CREATE_ALWAYS FILE_ATTRIBUTE_NORMAL 0" 0 - got ERROR_GEN_FAILURE
not ok 11 - expect "CreateFile b:\tmp\7860bc16 GENERIC_WRITE FILE_SHARE_DELETE 0 OPEN_EXISTING 0 0" ERROR_SHARING_VIOLATION - got ERROR_GEN_FAILURE
not ok 12 - expect "CreateFile b:\tmp\7860bc16 DELETE FILE_SHARE_WRITE 0 OPEN_EXISTING 0 0" ERROR_SHARING_VIOLATION - got 0
not ok 17 - expect "CreateFile b:\tmp\7860bc16 GENERIC_READ 0 0 OPEN_EXISTING FILE_FLAG_BACKUP_SEMANTICS 0" ERROR_SHARING_VIOLATION - got 0
not ok 11/19
total ................................. ok 144/171 - not ok 27/171
`
.\t\base\00.t .........................
not ok 21 - expect "CreateFile b:\tmp\68bea04c\bar GENERIC_WRITE 0 0 CREATE_NEW FILE_ATTRIBUTE_NORMAL 0" ERROR_PATH_NOT_FOUND - got ERROR_GEN_FAILURE
not ok 1/21
.\t\base\01.t .........................
not ok 4 - expect "GetFileInformation b:\tmp\1bfc89b4" <lambda>
not ok 7 - expect "GetFileInformation b:\tmp\1bfc89b4" <lambda>
not ok 10 - expect "GetFileInformation b:\tmp\1bfc89b4" <lambda>
not ok 3/11
.\t\base\02.t .........................
not ok 2 - expect "CreateDirectory b:\tmp\fd660aed 0" ERROR_ALREADY_EXISTS - got ERROR_GEN_FAILURE
not ok 3 - expect "RemoveDirectory b:\tmp\fd660aed" ERROR_DIRECTORY - got ERROR_GEN_FAILURE
not ok 6 - expect "CreateDirectory b:\tmp\fd660aed 0" ERROR_ALREADY_EXISTS - got 0
not ok 8 - expect "DeleteFile b:\tmp\fd660aed" ERROR_ACCESS_DENIED - got 0
not ok 9 - expect "RemoveDirectory b:\tmp\fd660aed" 0 - got ERROR_GEN_FAILURE
not ok 10 - expect "RemoveDirectory b:\tmp\fd660aed" ERROR_FILE_NOT_FOUND - got ERROR_GEN_FAILURE
not ok 6/10
.\t\base\03.t .........................
not ok 4 - expect "RemoveDirectory b:\tmp\593a8158\foo" ERROR_DIRECTORY - got ERROR_GEN_FAILURE
not ok 1/18
.\t\base\04.t .........................
not ok 24 - expect "MoveFileEx b:\tmp\161c1518\bar b:\tmp\161c1518\baz MOVEFILE_REPLACE_EXISTING" ERROR_ACCESS_DENIED - got 0
not ok 25 - expect "GetFileInformation b:\tmp\161c1518\bar" 0 - got ERROR_FILE_NOT_FOUND
not ok 28 - expect "MoveFileEx b:\tmp\161c1518\bar b:\tmp\161c1518\baz MOVEFILE_REPLACE_EXISTING" 0 - got ERROR_FILE_NOT_FOUND
not ok 30 - expect "GetFileInformation b:\tmp\161c1518\baz" 0 - got ERROR_FILE_NOT_FOUND
not ok 31 - expect "RemoveDirectory b:\tmp\161c1518\baz" 0 - got ERROR_GEN_FAILURE
not ok 5/43
.\t\base\05.t ......................... ok
.\t\base\06.t ......................... ok
.\t\base\07.t ......................... ok
.\t\base\08.t .........................
not ok 5 - expect "CreateDirectory b:\tmp\b9d5684a 0" 0 - got ERROR_ACCESS_DENIED
not ok 6 - expect "DeleteFile b:\tmp\b9d5684a\foo" 0 - got ERROR_GEN_FAILURE
not ok 7 - expect "FindFiles b:\tmp\b9d5684a\*" 0 - got ERROR_ACCESS_DENIED
not ok 8 - testeval(len(s) == 3)
not ok 9 - testeval("." in s)
not ok 10 - testeval(".." in s)
not ok 11 - testeval("foo" in s)
not ok 12 - expect_task "CreateFile b:\tmp\b9d5684a\foo GENERIC_WRITE FILE_SHARE_READ+FILE_SHARE_WRITE+FILE_SHARE_DELETE 0 CREATE_NEW FILE_ATTRIBUTE_NORMAL 0" 0 - got ERROR_GEN_FAILURE
not ok 13 - expect "FindFiles b:\tmp\b9d5684a\*" 0 - got ERROR_ACCESS_DENIED
not ok 14 - testeval(len(s) == 2)
not ok 15 - testeval("." in s)
not ok 16 - testeval(".." in s)
not ok 17 - expect "RemoveDirectory b:\tmp\b9d5684a" 0 - got ERROR_ACCESS_DENIED
not ok 13/17
.\t\base\09.t .........................
not ok 1 - expect "CreateFile b:\tmp\2d4719e1 GENERIC_READ FILE_SHARE_READ 0 OPEN_EXISTING 0 0" ERROR_SHARING_VIOLATION - got ERROR_FILE_NOT_FOUND
not ok 2 - expect "CreateFile b:\tmp\2d4719e1 GENERIC_READ FILE_SHARE_WRITE 0 OPEN_EXISTING 0 0" 0 - got ERROR_GEN_FAILURE
not ok 3 - expect "CreateFile b:\tmp\2d4719e1 DELETE FILE_SHARE_DELETE 0 OPEN_EXISTING 0 0" ERROR_SHARING_VIOLATION - got 0
not ok 4 - expect "CreateFile b:\tmp\2d4719e1 DELETE FILE_SHARE_WRITE 0 OPEN_EXISTING 0 0" ERROR_SHARING_VIOLATION - got 0
not ok 6 - expect "CreateFile b:\tmp\2d4719e1 GENERIC_WRITE FILE_SHARE_WRITE 0 OPEN_EXISTING 0 0" ERROR_SHARING_VIOLATION - got 0
not ok 8 - expect "CreateFile b:\tmp\2d4719e1 DELETE FILE_SHARE_DELETE 0 OPEN_EXISTING 0 0" ERROR_SHARING_VIOLATION - got 0
not ok 9 - expect "CreateFile b:\tmp\2d4719e1 DELETE FILE_SHARE_WRITE 0 OPEN_EXISTING 0 0" ERROR_SHARING_VIOLATION - got 0
not ok 10 - expect_task "CreateFile b:\tmp\2d4719e1 GENERIC_READ FILE_SHARE_WRITE 0 CREATE_ALWAYS FILE_ATTRIBUTE_NORMAL 0" 0 - got ERROR_GEN_FAILURE
not ok 11 - expect "CreateFile b:\tmp\2d4719e1 GENERIC_WRITE FILE_SHARE_DELETE 0 OPEN_EXISTING 0 0" ERROR_SHARING_VIOLATION - got ERROR_GEN_FAILURE
not ok 12 - expect "CreateFile b:\tmp\2d4719e1 DELETE FILE_SHARE_WRITE 0 OPEN_EXISTING 0 0" ERROR_SHARING_VIOLATION - got 0
not ok 17 - expect "CreateFile b:\tmp\2d4719e1 GENERIC_READ 0 0 OPEN_EXISTING FILE_FLAG_BACKUP_SEMANTICS 0" ERROR_SHARING_VIOLATION - got 0
not ok 11/19
total ................................. ok 131/171 - not ok 40/171
Hello,
I translated the C# mirror example to VB.NET.
I don't understand the meaning of line 92
new DirectoryInfo(path).EnumerateFileSystemInfos().Any(); // you can't list the directory
As far as I see because the return value is not used, this line has no effect?
Martin
I'd like to throw in the constructor of my filesystem if the file I'm loading can't be found (e.g. to mount a tar file).
Hi,
Using the Mirror Example, with Office 2016.
1.) Create a new Word Document and Save it to a Mirror Drive - Works Fine
2.) Modify the new Word Document and Save it again (Same name and path). Get a permissions error.
Were just getting started with Dokan. Any / help suggestions would be appreciated.
Can you please add the latest ver 1.1.0.0-rc1
to Nuget?
I use installed DokanInstall_0.8.0_redist-RC2.exe with dokan-dotnet-master on Windows 8.1 Pro x64.
I develop my own file system. I need bypass DokanOperations function FindStreams because when i click with right mouse button on folder in mounted drive and select propreties, dokan crash on FindStreams function. I use DokanNetMirror example implementation.
public NtStatus FindStreams(string fileName, out IList streams, DokanFileInfo info)
{
streams = new FileInformation[0];
return Trace("EnumerateNamedStreams", fileName, info, DokanResult.NotImplemented);
}
Windows message: "Dokan has stopped working' Close program / Debug program.
Hello,
In my code, when someone tries to move one folder to another that already exists, with the replace boolean set to false,
he receives NtStatus.ObjectNameCollision, just like in the scenario with files.
When I run my code, and try to do this operation, it just fails, and there is no prompt window that asks me if I want to replace the existing directory.
The operation does work with files, just not with folders.
Maybe I should return a different error code?
Help will be appreciated.
Get rid of the SerializationExceptions that are sometimes thrown during unit test execution:
Unhandled Exception: System.Runtime.Serialization.SerializationException: Unable to find assembly 'Moq, Version=4.2.1507.118, Culture=neutral, PublicKeyToken=69f491c39445e920'.
at System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo assemblyInfo, String name)
at System.Runtime.Serialization.Formatters.Binary.ObjectMap..ctor(String objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryHeaderEnum binaryHeaderEnum)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.DeserializeObject(MemoryStream stm)
at System.AppDomain.Deserialize(Byte[] blob)
at System.AppDomain.UnmarshalObject(Byte[] blob)
see here: http://stackoverflow.com/questions/24675922/how-to-avoid-serializationexception-warnings-with-vstest-console-exe-and-moq for a possible solution
I have a timeout problem that only occurs on Win8, during a copy session:
"insufficient system resources exist to complete the requested service"
I've seen that from Dokan v. 0.8.0 you support:
The timeout per device has been implemented. The DokanOptions has a new property Timeout (Milliseconds)
Can I change this property in the .NET version? or is it editable only in the C version?
Thanks!
The behavior of DokanOperationsProxy
in build mode DEBUG should be changed to return one of the DokanResult
error values instead of rethrowing the .NET Exception back to the calling Dokan driver.
The present behavior leads to driver instabilities and an inacceptable number of BSODs when debugging Dokan.NET.
Originally suggested by voltagex in #16 (comment)
When trying to save a file in notepad, I won't be able to save the file in the mounted dokan mirror
I'm just trying to save it in a folder but nothing really happens when hitting "Save"
The log is from the point I hit Save
Log: http://pastebin.com/RHXNxm5d
I noticed as well that when hitting the "save" button, "." will append at the end of the save location
So when hitting the save a few times it will come out as "N:\PerfLogs...."
Using the latest release of Dokany, running windows 8.1 x64
Could you please release a -Pre version of Dokan .NET to NuGet that matches 0.8.0-RC2?
Hello,
Does the latest version of DokanNet support the latest version of Dokany, with MountManager?
Thanks
Can you please publish a new release in Git & Nuget?
The last one is from May.
Thanks!
If I try to launch programs through the mirror, I either end up with <program>.exe is not a valid Win32 application
or it manages to start and instantly crashes.
I've tried launching several different programs this way (also with the C mirror), but none of them have launched properly.
Haven't noticed anything suspicious in the debug output either.
I'm mirroring the whole C:\
drive, so it shouldn't matter if the programs use absolute or relative paths to locate their stuff, as it should map to the same place anyway.
Hi, I'm developing a filesystem application using the mirror demo as a reference and noticed that my application can't list files in the file system while browsing it in CMD.
I want back to see, and this do not work in the original examples ether.
$n:
$dir > "Insufficient system resources exist to complete the requested service."
and the c# mirror application crashed.
(Am developing on windows 7)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.