EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Get the flags passed to CreateFile WinAPI

Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.
Posted: 03/14/2012 09:29:07
by Volodymyr Zinin (EldoS Corp.)

This property must be set before the MountMedia call.

Ivan P wrote:
And what about OnOpenFile callback?

Oh. Sorry. This parameter has been removed from this callback long time ago. It exists internally, but isn't visible to the user API. We will check what is possible to do. I'll write the answer here.
Posted: 03/14/2012 09:45:33
by Ivan P (Priority Standard support level)
Joined: 04/11/2011
Posts: 66

Vladimir Zinin wrote:
This property must be set before the MountMedia call.

Here's the snippet code where I set it:
        private void MapperForm_Load(object sender, EventArgs e)
            mCbFs           = new CallbackFileSystem();
            mCbFs.CallAllOpenCloseCallbacks = true;
            mCbFs.UseFileCreationFlags = true;
            mCbFs.OnMount   = new CbFsMountEvent(CbFsMount);
            mCbFs.OnUnmount = new CbFsUnmountEvent(CbFsUnmount);
Posted: 03/14/2012 11:44:52
by Eugene Mayevski (EldoS Corp.)

Unfortunately there's no way to pass file flags and attributes without introducing new parameter to OnCreateFile callback. And as introducing such changes will break existing code, we will keep them until CBFS 4 which is planned for summer. I am sorry about this but I don't see what we can do right now if we want to keep compatibility.

Sincerely yours
Eugene Mayevski
Posted: 03/14/2012 12:10:31
by Ivan P (Priority Standard support level)
Joined: 04/11/2011
Posts: 66

I'm not sure how CBFS works exactly.

As I understand callbacks are queued to a ThreadPool for execution. At this moment it should be possible to pass these flags (if it's a Create/Open file task) as additional argument for task execution.

And CallbackFilesystem could have a method GetCreateFileFlags() that would get flags from a current thread context.
Then from a callback the request to sender.GetCreateFileFlags() should return these flags.
The result is meaningful only when being called from OnOpenFile() or OnCreateFile(), and undefined when called from other callbacks.

Is that possible?

Posted: 03/14/2012 12:43:57
by Eugene Mayevski (EldoS Corp.)

Flags are available internally, there's just no interface to pass them. We considered a function similar to what you offer but that would be a temporary solution which would add burden to the code and would be needed for just 2-3 months until CBFS 4 after which we would have to remove it.

Sincerely yours
Eugene Mayevski
Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.



Topic viewed 3156 times

Number of guests: 2, 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!