virtual driver issue

Hello everyone,
I want to write a driver for securing data in such a way that I have to access a file from another location rather than from its own location. i.e., if a file is in C drive, I have to access that file from another drive like Z:.…
Ex: my file is C:~\abc.txt
I should access it like Z:~\C:~\abc.txt

This file is launched using winword .
If I give winword - “Z:\~\C:\~\abc.txt”, word should read from the file’s original location i.e., on C drive.

Is it possible any way…
please help me…

xxxxx@atc.tcs.com wrote:

Hello everyone,
I want to write a driver for securing data in such a way that I have to access a file from another location rather than from its own location. i.e., if a file is in C drive, I have to access that file from another drive like Z:.…
Ex: my file is C:~\abc.txt
I should access it like Z:~\C:~\abc.txt

This file is launched using winword .
If I give winword - “Z:\~\C:\~\abc.txt”, word should read from the file’s original location i.e., on C drive.

This question is more in the area of file systems and should be posted
on NTFsd.

But to answer your question, yes, this is possible. There are several
ways to do this including filter redirection where you redirect the
target of the request either by opening your own target or mangling the
name or through reparse processing. The problem with the latter approach
is that it breaks targeted opens from other filters above you whereas
the former mechanism is much more complicated.

Pete

Is it possible any way…
please help me…


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


Kernel Drivers
Windows File System and Device Driver Consulting
www.KernelDrivers.com
866.263.9295

Thank You Peter for your reply.

I have one more doubt regarding filter redirection. Whenever EvtFileDeviceCreate is called, FileObject is ending up in Null eventhough that argument is being passed. In EvtFileDeviceCreate callback, I want to implement file redirection. Is this a correct approach?

xxxxx@atc.tcs.com wrote:

Thank You Peter for your reply.

I have one more doubt regarding filter redirection. Whenever EvtFileDeviceCreate is called, FileObject is ending up in Null eventhough that argument is being passed. In EvtFileDeviceCreate callback, I want to implement file redirection. Is this a correct approach?

Well, from the name of your callback I am guessing you are implementing
this in KMDF? KMDF is not used for file system filtering, Filter
Manager, or the mini-filter framework, is used for file system filters.

If you are trying to redirect ‘file’ access such as redirecting access
to foo.txt when you open it in notepad, then you need a mini-filter
driver not a KMDF driver.

Pete


Kernel Drivers
Windows File System and Device Driver Consulting
www.KernelDrivers.com
866.263.9295

Actually I’m new to driver programming. I dont know how to program a mini-filter driver. Can you please throw some light on this.

My actual requirement is that I have to write a virtual driver such that whenever it is loaded, it should map to a drive and then have to perform read and write accesses. There is an encrypted file and whenever a file is accessed through notepad which is assumed to be in Z:\ but not, it should decrypt it and open the file and if any modifications are made to it, that should be reflected back to the original file.

For this, I have written a KMDF driver that creates a ramdisk (Z:) which is a non pnp driver. After creating the drive I tried to redirect the read and write accesses for Z:\ to the original location of the files in which I failed.
Can you please suggest me a solution for this and also how should I write a minifilter for this?

xxxxx@atc.tcs.com wrote:

Actually I’m new to driver programming. I dont know how to program a mini-filter driver. Can you please throw some light on this.

My actual requirement is that I have to write a virtual driver such that whenever it is loaded, it should map to a drive and then have to perform read and write accesses. There is an encrypted file and whenever a file is accessed through notepad which is assumed to be in Z:\ but not, it should decrypt it and open the file and if any modifications are made to it, that should be reflected back to the original file.

For this, I have written a KMDF driver that creates a ramdisk (Z:) which is a non pnp driver. After creating the drive I tried to redirect the read and write accesses for Z:\ to the original location of the files in which I failed.
Can you please suggest me a solution for this and also how should I write a minifilter for this?

Right, OK. It sounds like you require a file system filter driver to
allow per file control over the access. The driver you have implemented
sits below the file system and therefore you have no direct knowledge of
whether any given IO is for a file or some other metadata structure.

I would switch your questions to the NTFsd forum. And because your
questions have been covered at length in that forum, you should spend a
little time going through the FAQ and archives available at OSROnline.

Pete


Kernel Drivers
Windows File System and Device Driver Consulting
www.KernelDrivers.com
866.263.9295

You wrote:

My actual requirement is that I have to write a virtual driver such
that whenever it is loaded, it should map to a drive and then have to
perform read and write accesses. There is an encrypted file and
whenever a file is accessed through notepad which is assumed to be
in Z:\ but not, it should decrypt it and open the file and if any
modifications are made to it, that should be reflected back to the
original file.

Windows has already this ability, completely built-in to the operating system, since XP. Bring up an Explorer window, right-click on a file, bring up Properties, click Advanced, and there is an “Encrypt” option that does exactly this.

Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.