EldoS | Feel safer!

Software components for data protection, secure storage and transfer

onOpenFile calls a lot of time for one dir

Also by EldoS: SecureBlackbox
200+ components and classes for digital security, signing, encryption and secure networking.
#20250
Posted: 05/25/2012 08:08:32
by szagriichuk  (Basic support level)
Joined: 03/28/2012
Posts: 51

Hi, the sequence of opening dir in normal way like this
Code
onOpenFile -> onEnumerateDirectory (with name of dir )

In may case I have
Code
onOpenFile -> onEnumerateDirectory (ALWAYS WITH ROOT folder )

After this I am receiving a lot of onOpenFile for my folder and error that name of folder is incorect
Can you help me to resolve this (always root folder) issue ?
Thanks
#20252
Posted: 05/25/2012 09:49:03
by Eugene Mayevski (EldoS Corp.)

Calling a callback handler many times is not a problem by itself. What the actual problem is? I.e. what doesn't work?


Sincerely yours
Eugene Mayevski
#20253
Posted: 05/25/2012 09:53:08
by Volodymyr Zinin (EldoS Corp.)

Run Process Monitor from sysinternals.com, set there a filter to show operations only for your virtual disk (the filter is: "Path"->"Begins with"->"X:", where "X:" is your drive letter), and look the logs.

Quote
szagriichuk wrote:
onOpenFile -> onEnumerateDirectory (ALWAYS WITH ROOT folder )

Do you mean that onEnumerateDirectory is always called only for root folder or the mask (i.e. a parameter of the onEnumerateDirectory call) is set to "\"?
#20259
Posted: 05/25/2012 11:28:53
by szagriichuk  (Basic support level)
Joined: 03/28/2012
Posts: 51

Yes, I mean that directoryInfo.getFileName always is // , but in OnOpenFile file name is correct like "// New Folder"
#20260
Posted: 05/25/2012 12:18:30
by szagriichuk  (Basic support level)
Joined: 03/28/2012
Posts: 51

Installed systemmonitor and found the same behavior as I've described,

The first time I can see

Quote
8:08:29.3005901 PM Explorer.EXE 2184 CreateFile S:\vmuser SUCCESS Desired Access: Read Data/List Directory, Read Attributes, Synchronize, Disposition: Open, Options: , Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened


Where vmuser is first folder after root, and it is OK, full path like
Code
\vmuser


So, next logs like this

Quote
9:35:50.3845619 PM Explorer.EXE 2184 QueryFileInternalInformationFile S:\vmuser SUCCESS IndexNumber: 0xbe
9:35:50.3845822 PM Explorer.EXE 2184 CloseFile S:\vmuser SUCCESS
9:35:50.3846270 PM Explorer.EXE 2184 IRP_MJ_CLOSE S:\vmuser SUCCESS
9:35:50.3862780 PM Explorer.EXE 2184 IRP_MJ_CLOSE S:\ SUCCESS
9:35:50.3869253 PM Explorer.EXE 2184 QueryFileInternalInformationFile S:\vmuser SUCCESS IndexNumber: 0xbe
9:35:50.3869418 PM Explorer.EXE 2184 CloseFile S:\vmuser SUCCESS
9:35:50.3869671 PM Explorer.EXE 2184 IRP_MJ_CLOSE S:\vmuser SUCCESS
9:35:50.3870633 PM Explorer.EXE 2184 CreateFile S:\ SUCCESS Desired Access: Synchronize, Disposition: Open, Options: Directory, Synchronous IO Non-Alert, Attributes: n/a, ShareMode: None, AllocationSize: n/a, OpenResult: Opened
9:35:50.3889807 PM Explorer.EXE 2184 QueryFileInternalInformationFile S:\vmuser SUCCESS IndexNumber: 0xbe
9:35:50.3889936 PM Explorer.EXE 2184 CloseFile S:\vmuser SUCCESS
9:35:50.3890139 PM Explorer.EXE 2184 IRP_MJ_CLOSE S:\vmuser SUCCESS
9:35:50.3890425 PM Explorer.EXE 2184 QueryNameInformationFile S:\ SUCCESS Name: \
9:35:50.3890528 PM Explorer.EXE 2184 QueryAttributeInformationVolume S:\ SUCCESS FileSystemAttributes: Case Preserved, Unicode, MaximumComponentNameLength: 260, FileSystemName: FAT32
9:35:50.3890765 PM Explorer.EXE 2184 CloseFile S:\ SUCCESS
9:35:50.3890951 PM Explorer.EXE 2184 IRP_MJ_CLOSE S:\ SUCCESS
9:35:51.7107704 PM Explorer.EXE 2184 CreateFile S:\ SUCCESS Desired Access: Synchronize, Disposition: Open, Options: Directory, Synchronous IO Non-Alert, Attributes: n/a, ShareMode: None, AllocationSize: n/a, OpenResult: Opened
9:35:52.2231049 PM Explorer.EXE 2184 QueryBasicInformationFile S:\vmuser SUCCESS CreationTime: 1/1/1970 3:00:00 AM, LastAccessTime: 1/16/1970 2:39:02 PM, LastWriteTime: 1/16/1970 2:39:02 PM, ChangeTime: 1/1/1601 3:00:00 AM, FileAttributes: N
9:35:52.2231161 PM Explorer.EXE 2184 CloseFile S:\vmuser SUCCESS
9:35:52.2231579 PM Explorer.EXE 2184 IRP_MJ_CLOSE S:\vmuser SUCCESS
9:35:52.2232678 PM Explorer.EXE 2184 QueryNameInformationFile S:\ SUCCESS Name: \
9:35:52.2232794 PM Explorer.EXE 2184 QueryAttributeInformationVolume S:\ SUCCESS FileSystemAttributes: Case Preserved, Unicode, MaximumComponentNameLength: 260, FileSystemName: FAT32
9:35:52.2232852 PM Explorer.EXE 2184 CloseFile S:\ SUCCESS
9:35:52.2233001 PM Explorer.EXE 2184 IRP_MJ_CLOSE S:\ SUCCESS
9:35:52.2233838 PM Explorer.EXE 2184 FileSystemControl S:\vmuser INVALID DEVICE REQUEST Control: FSCTL_LMR_QUERY_DEBUG_INFO
9:35:52.2233946 PM Explorer.EXE 2184 QueryDirectory S:\vmuser INVALID PARAMETER


......


Quote

9:35:54.5545420 PM Explorer.EXE 2184 IRP_MJ_CLOSE S:\ SUCCESS
9:35:54.5545536 PM Explorer.EXE 2184 CreateFile S:\vmuser NOT A DIRECTORY Desired Access: Read Data/List Directory, Synchronize, Disposition: Open, Options: Directory, Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
9:35:54.5555797 PM Explorer.EXE 2184 CreateFile S:\ SUCCESS Desired Access: Synchronize, Disposition: Open, Options: Directory, Synchronous IO Non-Alert, Attributes: n/a, ShareMode: None, AllocationSize: n/a, OpenResult: Opened


.....

Quote

9:35:55.8947460 PM Explorer.EXE 2184 CreateFile S:\vmuser SUCCESS Desired Access: Read Data/List Directory, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Non-Directory File, Complete If Oplocked, Attributes: n/a, ShareMode: Read, AllocationSize: n/a, OpenResult: Opened
9:35:56.3724574 PM Explorer.EXE 2184 QueryFileInternalInformationFile S:\vmuser SUCCESS IndexNumber: 0xbe
9:35:56.3724711 PM Explorer.EXE 2184 CloseFile S:\vmuser SUCCESS
9:35:56.3725150 PM Explorer.EXE 2184 IRP_MJ_CLOSE S:\vmuser SUCCESS
9:35:58.3972283 PM Explorer.EXE 2184 QueryBasicInformationFile S:\vmuser SUCCESS CreationTime: 1/1/1970 3:00:00 AM, LastAccessTime: 1/16/1970 2:39:02 PM, LastWriteTime: 1/16/1970 2:39:02 PM, ChangeTime: 1/1/1601 3:00:00 AM, FileAttributes: N
9:35:58.3972399 PM Explorer.EXE 2184 CloseFile S:\vmuser SUCCESS
9:35:58.3972842 PM Explorer.EXE 2184 IRP_MJ_CLOSE S:\vmuser SUCCESS
9:35:58.5905998 PM ekrn.exe 1484 CreateFile S:\vmuser SUCCESS Desired Access: Generic Read, Disposition: Open, Options: Synchronous IO Non-Alert, Attributes: N, ShareMode: Read, Write, Delete, AllocationSize: n/a, Impersonating: VM732\vmuser, OpenResult: Opened
9:35:59.5531840 PM ekrn.exe 1484 QueryStandardInformationFile S:\vmuser SUCCESS AllocationSize: 0, EndOfFile: 0, NumberOfLinks: 1, DeletePending: False, Directory: False
9:35:59.5531940 PM ekrn.exe 1484 CloseFile S:\vmuser SUCCESS
9:35:59.5532396 PM ekrn.exe 1484 IRP_MJ_CLOSE S:\vmuser SUCCESS
9:36:00.6000097 PM Explorer.EXE 2184 FileSystemControl S:\vmuser INVALID DEVICE REQUEST Control: FSCTL_LMR_QUERY_DEBUG_INFO
9:36:00.6000255 PM Explorer.EXE 2184 QueryDirectory S:\vmuser INVALID PARAMETER
9:36:00.6000325 PM Explorer.EXE 2184 CloseFile S:\vmuser SUCCESS
9:36:00.6000769 PM Explorer.EXE 2184 IRP_MJ_CLOSE S:\vmuser SUCCESS
9:36:02.6603978 PM ekrn.exe 1484 CreateFile S:\vmuser SUCCESS Desired Access: Read Attributes, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Attributes: N, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
9:36:02.6610725 PM Explorer.EXE 2184 CreateFile S:\vmuser NOT A DIRECTORY Desired Access: Read Data/List Directory, Synchronize, Disposition: Open, Options: Directory, Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
9:36:03.2001301 PM ekrn.exe 1484 CloseFile S:\vmuser SUCCESS
9:36:03.2001815 PM ekrn.exe 1484 IRP_MJ_CLOSE S:\vmuser SUCCESS
9:36:03.8554136 PM Explorer.EXE 2184 QueryOpen S:\vmuser FAST IO DISALLOWED
9:36:06.2369275 PM Explorer.EXE 2184 CreateFile S:\vmuser SUCCESS Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
9:36:06.7978253 PM ekrn.exe 1484 CreateFile S:\vmuser SUCCESS Desired Access: Generic Read, Disposition: Open, Options: Synchronous IO Non-Alert, Attributes: N, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
9:36:06.7980943 PM Explorer.EXE 2184 IRP_MJ_CLOSE S:\vmuser SUCCESS
9:36:06.7982596 PM ekrn.exe 1484 QueryStandardInformationFile S:\vmuser SUCCESS AllocationSize: 0, EndOfFile: 0, NumberOfLinks: 1, DeletePending: False, Directory: False
9:36:06.7983180 PM ekrn.exe 1484 CloseFile S:\vmuser SUCCESS
9:36:06.7983408 PM ekrn.exe 1484 IRP_MJ_CLOSE S:\vmuser SUCCESS
9:36:06.7995235 PM Explorer.EXE 2184 QueryBasicInformationFile S:\vmuser SUCCESS CreationTime: 1/1/1970 3:00:00 AM, LastAccessTime: 1/16/1970 2:39:02 PM, LastWriteTime: 1/16/1970 2:39:02 PM, ChangeTime: 1/1/1601 3:00:00 AM, FileAttributes: N
9:36:06.7995310 PM Explorer.EXE 2184 CloseFile S:\vmuser SUCCESS
9:36:08.6742482 PM ekrn.exe 1484 CreateFile S:\vmuser SUCCESS Desired Access: Read Attributes, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Attributes: N, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
9:36:09.2717304 PM ekrn.exe 1484 CloseFile S:\vmuser SUCCESS
9:36:09.2722244 PM ekrn.exe 1484 IRP_MJ_CLOSE S:\vmuser SUCCESS
9:36:10.8792347 PM ekrn.exe 1484 CreateFile S:\vmuser SUCCESS Desired Access: Generic Read, Disposition: Open, Options: Synchronous IO Non-Alert, Attributes: N, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
9:36:11.5038756 PM ekrn.exe 1484 QueryStandardInformationFile S:\vmuser SUCCESS AllocationSize: 0, EndOfFile: 0, NumberOfLinks: 1, DeletePending: False, Directory: False
9:36:11.5038859 PM ekrn.exe 1484 CloseFile S:\vmuser SUCCESS
9:36:11.5039423 PM ekrn.exe 1484 IRP_MJ_CLOSE S:\vmuser SUCCESS
9:36:13.2163749 PM ekrn.exe 1484 CreateFile S:\vmuser SUCCESS Desired Access: Read Attributes, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Attributes: N, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
9:36:13.7841552 PM ekrn.exe 1484 CloseFile S:\vmuser SUCCESS
9:36:13.7842004 PM ekrn.exe 1484 IRP_MJ_CLOSE S:\vmuser SUCCESS
9:36:15.1864297 PM ekrn.exe 1484 CreateFile S:\vmuser SUCCESS Desired Access: Generic Read, Disposition: Open, Options: Synchronous IO Non-Alert, Attributes: N, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
9:36:15.8023419 PM ekrn.exe 1484 QueryStandardInformationFile S:\vmuser SUCCESS AllocationSize: 0, EndOfFile: 0, NumberOfLinks: 1, DeletePending: False, Directory: False
9:36:15.8023527 PM ekrn.exe 1484 CloseFile S:\vmuser SUCCESS
9:36:15.8024070 PM ekrn.exe 1484 IRP_MJ_CLOSE S:\vmuser SUCCESS


ONE MANDATORY NOTE, I forgot to write all folders structure were created in DB and I've read it and try to show
#20261
Posted: 05/25/2012 14:41:46
by Volodymyr Zinin (EldoS Corp.)

It seems that your callbacks (more probably it's either OnEnumerateDirectory or OnGetFileInfo) say that "\vmuser" is a file, not a directory. Please check if the attribute FILE_ATTRIBUTE_DIRECTORY is returned for it.
#20262
Posted: 05/26/2012 11:46:52
by szagriichuk  (Basic support level)
Joined: 03/28/2012
Posts: 51

Yes, you are right, I've re-checked method OnGetFileInfo, and found that in some time (for some folders) I am receiving attribute 128 (NORMAL_FILE) but should 16 (FILE_ATTRIBUTE_DIRECTORY), changed this part all works good.

Thank you a lot!!!
Also by EldoS: SecureBlackbox
200+ components and classes for digital security, signing, encryption and secure networking.

Reply

Statistics

Topic viewed 2643 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!