File not found

38 views
Skip to first unread message

Lucas

unread,
Feb 24, 2021, 7:00:38 PM2/24/21
to Dokan
Hi everyone,

I'm having two problems and I think these errors have the same cause 

I already can read/write/list/delete the content of my virtual drive.
I have already tested the consistency of the data copying to and from my drive.


When I open a .TXT file with notepad (Windows Notepad), I get the message error: 'Cannot open the file H:\teste.txt. Check for a disk in the specified drive'
If I use another program like Notepad++/WordPad ... the file opens successfully. 
The dokanOperations.ReadFile is NOT CALLED at any time.



When I try to execute a .EXE, I get these messages:
 - With ADMINISTRATOR privileges: "H:\teste1.exe. The specified path does not exist. Check the path and try again. "
 - Whitout ADMINISTRATOR privileges: "The application could not be initialized correctly (0xc0000006)"

 

I see in my log that dokanOperations.GetFileSecurity is called in this case (.EXE) but I return STATUS_NOT_IMPLEMENTED to let Dokan
create a security basic information for me.


This is my dokanOptions.Options:  DOKAN_OPTION_NETWORK | DOKAN_OPTION_ENABLE_UNMOUNT_NETWORK_DRIVE | DOKAN_OPTION_CASE_SENSITIVE
This is my FileSystemFlags in return in GetVolumeInformation: FILE_CASE_SENSITIVE_SEARCH | FILE_CASE_PRESERVED_NAMES


Can anyone help me in any way ? Ideas, tips ....


If necessary, I send the Dokan debug
Thanks

This is my program log:
---------------------------
Th[6952] ### Mounted
Th[7420] ### CreateFile: [/]  CreateDisposion:1  FileAttr: 0
Th[7420]    ------> HANDLER CREATED --> 0
Th[7892]    ### GetFileInformation  HANDLER: 0  [/]
Th[2104]    ### GetFileInformation  HANDLER: 0  [/]
Th[6584] ### Cleannup HANDLER: 0
Th[7420] ### CloseFile
Th[7892] ### CreateFile: [/]  CreateDisposion:1  FileAttr: 0
Th[7892]    ------> HANDLER CREATED --> 0
Th[2104]    ### GetFileInformation  HANDLER: 0  [/]
Th[6584] ### Cleannup HANDLER: 0
Th[7420] ### CloseFile
Th[7892] ### CreateFile: [/]  CreateDisposion:1  FileAttr: 0
Th[7892]    ------> HANDLER CREATED --> 0
Th[2104]    ### GetFileInformation  HANDLER: 0  [/]
Th[8020]    ### GetFileInformation  HANDLER: 0  [/]
Th[6584] ### Cleannup HANDLER: 0
Th[7420] ### CloseFile
Th[7892] ### CreateFile: [/]  CreateDisposion:1  FileAttr: 0
Th[7892]    ------> HANDLER CREATED --> 0
Th[2104]    ### GetFileInformation  HANDLER: 0  [/]
Th[7420] ### Cleannup HANDLER: 0
Th[7892] ### CloseFile
Th[2104] ### CreateFile: [/]  CreateDisposion:1  FileAttr: 0
Th[2104]    ------> HANDLER CREATED --> 0
Th[8020]    ### GetFileInformation  HANDLER: 0  [/]
Th[7420] ### Cleannup HANDLER: 0
Th[2104] ### CreateFile: [/]  CreateDisposion:1  FileAttr: 0
Th[7420] ### CloseFile
Th[2104]    ------> HANDLER CREATED --> 0
Th[8020]    ### GetFileInformation  HANDLER: 0  [/]
Th[7892] ### Cleannup HANDLER: 0
Th[2104] ### CreateFile: [/]  CreateDisposion:1  FileAttr: 0
Th[7420] ### CloseFile
Th[2104]    ------> HANDLER CREATED --> 0
Th[8020]    ### GetFileInformation  HANDLER: 0  [/]
Th[7892] ### Cleannup HANDLER: 0
Th[7420] ### CreateFile: [/]  CreateDisposion:1  FileAttr: 0
Th[2104] ### CloseFile
Th[7420]    ------> HANDLER CREATED --> 0
Th[8020] ### CreateFile: [/desktop.ini]  CreateDisposion:1  FileAttr: 0
Th[8020]         <<<<< FILE NOT FOUND >>>>   --> STATUS_OBJECT_NAME_NOT_FOUND
Th[6584] ### CreateFile: [/]  CreateDisposion:1  FileAttr: 0
Th[6584]    ------> HANDLER CREATED --> 1
Th[7892]   ### FindFilesWithPattern  [*]  --> STATUS_NOT_IMPLEMENTED
Th[7892]    ### FindFiles HANDLER 1  [/]
Th[7892]        ------------> [teste.txt] 65401
Th[7420] ### Cleannup HANDLER: 1
Th[8020] ### CloseFile
Th[6584] ### CreateFile: [/]  CreateDisposion:1  FileAttr: 0
Th[6584]    ------> HANDLER CREATED --> 1
Th[7892]   ### FindFilesWithPattern  [teste.txt]  --> STATUS_NOT_IMPLEMENTED
Th[7892]    ### FindFiles HANDLER 1  [/]
Th[7892]        ------------> [teste.txt] 65401
Th[2104] ### Cleannup HANDLER: 1
Th[7420] ### CloseFile
Th[8020] ### CreateFile: [/]  CreateDisposion:1  FileAttr: 0
Th[8020]    ------> HANDLER CREATED --> 1
Th[6584]   ### FindFilesWithPattern  [teste.txt]  --> STATUS_NOT_IMPLEMENTED
Th[6584]    ### FindFiles HANDLER 1  [/]
Th[6584]        ------------> [teste.txt] 65401
Th[7892] ### Cleannup HANDLER: 1
Th[2104] ### CloseFile
Th[7420] ### CreateFile: [/]  CreateDisposion:1  FileAttr: 0
Th[7420]    ------> HANDLER CREATED --> 1
Th[8020]    ### GetFileInformation  HANDLER: 1  [/]
Th[6584] ### Cleannup HANDLER: 1
Th[6584] ### CloseFile
Th[2104] ### CreateFile: [/]  CreateDisposion:1  FileAttr: 0
Th[7420] ### CreateFile: [/teste.txt]  CreateDisposion:1  FileAttr: 0
Th[2104]    ------> HANDLER CREATED --> 1
Th[7420]    ------> HANDLER CREATED --> 2
Th[8020]    ### GetFileInformation  HANDLER: 2  [/teste.txt]
Th[8020]       INFO ---> TYPE: F    SIZE:65401   ID:4724
Th[7892]    ### GetFileInformation  HANDLER: 2  [/teste.txt]
Th[7892]       INFO ---> TYPE: F    SIZE:65401   ID:4724
Th[6584] ### Cleannup HANDLER: 2
Th[6584] ### CloseFile
Th[7420] ### CreateFile: [/teste.txt]  CreateDisposion:1  FileAttr: 0
Th[7420]    ------> HANDLER CREATED --> 2
Th[8020]    ### GetFileInformation  HANDLER: 2  [/teste.txt]
Th[8020]       INFO ---> TYPE: F    SIZE:65401   ID:4724
Th[7892]    ### GetFileInformation  HANDLER: 2  [/teste.txt]
Th[7892]       INFO ---> TYPE: F    SIZE:65401   ID:4724
Th[2104] ### Cleannup HANDLER: 2
Th[6584] ### CloseFile
Th[7420] ### CreateFile: [/]  CreateDisposion:1  FileAttr: 0
Th[8020] ### CreateFile: [/]  CreateDisposion:1  FileAttr: 0
Th[7420]    ------> HANDLER CREATED --> 2
Th[8020]    ------> HANDLER CREATED --> 3
Th[7892]   ### FindFilesWithPattern  [teste.txt]  --> STATUS_NOT_IMPLEMENTED
Th[2104]   ### FindFilesWithPattern  [teste.txt]  --> STATUS_NOT_IMPLEMENTED
Th[7892]    ### FindFiles HANDLER 2  [/]
Th[2104]    ### FindFiles HANDLER 3  [/]
Th[7892]        ------------> [teste.txt] 65401
Th[6584] ### Cleannup HANDLER: 2
Th[2104]        ------------> [teste.txt] 65401
Th[8020] ### CreateFile: [/]  CreateDisposion:1  FileAttr: 0
Th[7892] ### Cleannup HANDLER: 3
Th[7420] ### CloseFile
Th[8020]    ------> HANDLER CREATED --> 2
Th[2104] ### CreateFile: [/teste.txt]  CreateDisposion:1  FileAttr: 128
Th[6584] ### CloseFile
Th[7892]   ### FindFilesWithPattern  [teste.txt]  --> STATUS_NOT_IMPLEMENTED
Th[2104]    ------> HANDLER CREATED --> 3
Th[7892]    ### FindFiles HANDLER 2  [/]
Th[7420]    ### GetFileInformation  HANDLER: 3  [/teste.txt]
Th[7892]        ------------> [teste.txt] 65401
Th[7420]       INFO ---> TYPE: F    SIZE:65401   ID:4724
Th[8020] ### Cleannup HANDLER: 2
Th[2104]    ### GetFileInformation  HANDLER: 3  [/teste.txt]
Th[7892] ### CloseFile
Th[2104]       INFO ---> TYPE: F    SIZE:65401   ID:4724
Th[7420] ### CreateFile: [/]  CreateDisposion:1  FileAttr: 0
Th[6584]    ### GetFileInformation  HANDLER: 3  [/teste.txt]
Th[7420]    ------> HANDLER CREATED --> 2
Th[6584]       INFO ---> TYPE: F    SIZE:65401   ID:4724
Th[8020]   ### FindFilesWithPattern  [teste.txt]  --> STATUS_NOT_IMPLEMENTED
Th[7892] ### Cleannup HANDLER: 3
Th[8020]    ### FindFiles HANDLER 2  [/]
Th[8020]        ------------> [teste.txt] 65401
Th[7420] ### Cleannup HANDLER: 2
Th[6584] ### CloseFile
Th[7892] ### CreateFile: [/teste.txt]  CreateDisposion:1  FileAttr: 128
Th[7892]    ------> HANDLER CREATED --> 2
Th[8020]    ### GetFileInformation  HANDLER: 2  [/teste.txt]
Th[8020]       INFO ---> TYPE: F    SIZE:65401   ID:4724
Th[7420] ### Cleannup HANDLER: 2
Th[6584] ### CloseFile
Th[7892] ### CreateFile: [/]  CreateDisposion:1  FileAttr: 0
Th[7892]    ------> HANDLER CREATED --> 2
Th[2104]   ### FindFilesWithPattern  [teste.txt]  --> STATUS_NOT_IMPLEMENTED
Th[2104]    ### FindFiles HANDLER 2  [/]
Th[2104]        ------------> [teste.txt] 65401
Th[8020] ### Cleannup HANDLER: 2
Th[7420] ### CloseFile
Th[6584] ### CreateFile: [/teste.txt]  CreateDisposion:1  FileAttr: 128
Th[6584]    ------> HANDLER CREATED --> 2
Th[2104]    ### GetFileInformation  HANDLER: 2  [/teste.txt]
Th[2104]       INFO ---> TYPE: F    SIZE:65401   ID:4724
Th[8020] ### Cleannup HANDLER: 2
Th[7420] ### CloseFile
Th[6584] ### CreateFile: [/]  CreateDisposion:1  FileAttr: 128
Th[6584]    ------> HANDLER CREATED --> 2
Th[2104]    ### GetFileInformation  HANDLER: 2  [/]
Th[8020] ### Cleannup HANDLER: 2
Th[7420] ### CloseFile
Th[6584] ### CreateFile: [/]  CreateDisposion:1  FileAttr: 128
Th[6584]    ------> HANDLER CREATED --> 2
Th[2104]    ### GetFileInformation  HANDLER: 2  [/]
Th[8020] ### Cleannup HANDLER: 2
Th[7420] ### CloseFile
Th[6584] ### CreateFile: [/teste.txt]  CreateDisposion:1  FileAttr: 128
Th[6584]    ------> HANDLER CREATED --> 2
Th[2104]    ### GetFileInformation  HANDLER: 2  [/teste.txt]
Th[2104]       INFO ---> TYPE: F    SIZE:65401   ID:4724
Th[8020] ### Cleannup HANDLER: 2
Th[7420] ### CloseFile
Th[6584] ### CreateFile: [/]  CreateDisposion:1  FileAttr: 128
Th[6584]    ------> HANDLER CREATED --> 2
Th[2104]    ### GetFileInformation  HANDLER: 2  [/]
Th[8020] ### Cleannup HANDLER: 2
Th[7420] ### CloseFile
Th[7892] ### CreateFile: [/]  CreateDisposion:1  FileAttr: 0
Th[6584] ### CloseFile
Th[7892]    ------> HANDLER CREATED --> 2
Th[2104]   ### FindFilesWithPattern  [teste.txt]  --> STATUS_NOT_IMPLEMENTED
Th[2104]    ### FindFiles HANDLER 2  [/]
Th[2104]        ------------> [teste.txt] 65401
Th[8020] ### Cleannup HANDLER: 2
Th[7420] ### CloseFile
Th[6584] ### Cleannup HANDLER: 1
Th[7892] ### CloseFile



Lucas

unread,
Feb 24, 2021, 10:06:20 PM2/24/21
to Dokan
I found the problem.  =)
In my ReadFile function, I only write the log if a valid handler (DokanFileInfo->Context) is passed.

I was reading the Dokan documentation, calmly, and I came across this:
"Note: when applications make use of memory mapped files, WriteFile or ReadFile functions may be invoked after Cleanup in order to complete the I/O operations. The file system application should also properly work in this case."

I thought: "Oooowww..."


.. and I changed my ReadFile and I see that the function is called with an invalid HANDLER.
Now, my ReadFile and WriteFile are accepting this situation and both problems have been solved.


I've been trying to solve this for a few days and it was only writing here that I found the problem.
Writing here brings luck.
Reply all
Reply to author
Forward
0 new messages