AW: Question: Q34 Opening files during IRP_MJ_CREATE processing

After having understood the device name stuff, implementing the shadow
device logic and setting the StackSize correctly (I had firstly some
bluescreens with NO_MORE_IRP_STACK_LOCATIONS) - it works!

Thank you for your help.

J?rgen.

-----Urspr?ngliche Nachricht-----
Von: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] Im Auftrag von Tony Mason
Gesendet: Dienstag, 3. Oktober 2006 19:16
An: Windows File Systems Devs Interest List
Betreff: RE: [ntfsd] Question: Q34 Opening files during IRP_MJ_CREATE
processing

For local drives, names do not normally include a drive letter (network
drives sometimes do, however.) For example, a drive letter such as “c:”
will be a symbolic link (\Device\HarddiskVolume24 for example) and it is
THIS that you are replacing with the name of your shadow device.

Thus, the original name (after the symlinks are all resolved) is
\Device\HarddiskVolume3\temp\test.txt and the name that is in the File
object is \temp\test.txt. Thus, the name you use for the shadow is
\Device\Shadow\temp\test.txt.

If your device is \Device\Shadow, the file object you receive will have
\temp\test.txt as its name. If you decide to change it so you have
\Device\Shadow\c:\temp\test.txt then the name that shows up in your driver
(in the file object) will be \c:\temp\test.txt.

I suggested the simplest possible algorithm here but you can transform the
name however you want - you just have to know how to process it when it
arrives at your shadow device.

Tony

Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

There is one side effect with my shadow device implementation. Calling
ZwCreate and ZwReadFile and ZwClose during IRP_MJ_CREATE, sometimes the
IRP_MJ_CLOSE is missing. Thus, there are a open handles -> and my stick
cannot be removed safely. What could be the reason for that?

-----Urspr?ngliche Nachricht-----
Von: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] Im Auftrag von J?rgen Falk
Gesendet: Donnerstag, 5. Oktober 2006 18:04
An: Windows File Systems Devs Interest List
Betreff: AW: [ntfsd] Question: Q34 Opening files during IRP_MJ_CREATE
processing

After having understood the device name stuff, implementing the shadow
device logic and setting the StackSize correctly (I had firstly some
bluescreens with NO_MORE_IRP_STACK_LOCATIONS) - it works!

Thank you for your help.

J?rgen.

-----Urspr?ngliche Nachricht-----
Von: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] Im Auftrag von Tony Mason
Gesendet: Dienstag, 3. Oktober 2006 19:16
An: Windows File Systems Devs Interest List
Betreff: RE: [ntfsd] Question: Q34 Opening files during IRP_MJ_CREATE
processing

For local drives, names do not normally include a drive letter (network
drives sometimes do, however.) For example, a drive letter such as “c:”
will be a symbolic link (\Device\HarddiskVolume24 for example) and it is
THIS that you are replacing with the name of your shadow device.

Thus, the original name (after the symlinks are all resolved) is
\Device\HarddiskVolume3\temp\test.txt and the name that is in the File
object is \temp\test.txt. Thus, the name you use for the shadow is
\Device\Shadow\temp\test.txt.

If your device is \Device\Shadow, the file object you receive will have
\temp\test.txt as its name. If you decide to change it so you have
\Device\Shadow\c:\temp\test.txt then the name that shows up in your driver
(in the file object) will be \c:\temp\test.txt.

I suggested the simplest possible algorithm here but you can transform the
name however you want - you just have to know how to process it when it
arrives at your shadow device.

Tony

Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com