question about filter driver IRP_MJ_CREATE

Hi,

I am developing a Win2K filter driver. One of the functions of the filter
driver is to re-route the file object handles of the IRP_MJ_CREATE function
for certain programs. For example, say I have got a program A which is
trying to obtain a file handle for c:\file1.ext, I would like to re-route
this to c:\temp\file1.ext for the program A. Other programs may be routed
to other directories or even access the c:\file1.ext itself.

It is my understanding that when the I/O Manager calls the filesystem driver
to obtain a file handle, one of the parameters that would be passed is the
ObjectAttributes structure. One of the fields in this is the ObjectName
field that contains the full path name to the file that it would like to
obtain the file handle for. I would like to change the value of the
ObjectName field so that its value changes from “c:\file1.ext” to
“c:\temp\file1.ext” when program A tries to access the file. Theoretically
speaking, if the value of this field is changed, then the file handle
returned to program A will have been correctly routed. However, I am unsure
of how to change the value for the ObjectName string. I would appreciate it
if someone could tell me how I can do this. Is it possible or do I need to
call InitializeObjectAttributes and create a new ObjectAttributes instead?

Appreciate your help in this matter. Thanks.


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

I think that requesting reparse is something that you will have to do. If
you will search for archive e-mails in this list (search for STATUS_REPARSE
in messages body) you will find a lot of answers to your problem. NTFSD
archives are accessible on http://www.osr.com/listserver_main.htm and on
http://www.ntfsd.org/index.html.
Wbr Primoz

-----Original Message-----
From: Loh Lik Yong Winston [mailto:xxxxx@nus.edu.sg]
Sent: Tuesday, February 19, 2002 11:31 AM
To: File Systems Developers
Subject: [ntfsd] question about filter driver IRP_MJ_CREATE

Hi,

I am developing a Win2K filter driver. One of the functions of the filter
driver is to re-route the file object handles of the IRP_MJ_CREATE function
for certain programs. For example, say I have got a program A which is
trying to obtain a file handle for c:\file1.ext, I would like to re-route
this to c:\temp\file1.ext for the program A. Other programs may be routed
to other directories or even access the c:\file1.ext itself.

It is my understanding that when the I/O Manager calls the filesystem driver
to obtain a file handle, one of the parameters that would be passed is the
ObjectAttributes structure. One of the fields in this is the ObjectName
field that contains the full path name to the file that it would like to
obtain the file handle for. I would like to change the value of the
ObjectName field so that its value changes from “c:\file1.ext” to
“c:\temp\file1.ext” when program A tries to access the file. Theoretically
speaking, if the value of this field is changed, then the file handle
returned to program A will have been correctly routed. However, I am unsure
of how to change the value for the ObjectName string. I would appreciate it
if someone could tell me how I can do this. Is it possible or do I need to
call InitializeObjectAttributes and create a new ObjectAttributes instead?

Appreciate your help in this matter. Thanks.


You are currently subscribed to ntfsd as: xxxxx@hermes.si
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

There is one side effect with using STATUS_REPARSE. The effect is that when
application
queries file name information (IRP_MJ_QUERYINFORMATION/FileNameInformation)
it will get
the “real” path to the file. I.e. \temp\file1.ext and not \file1.ext This
may be not
important but in some cases this can be important. Lets say the app uses
path to the file
as a place where it should look for other files or something like that.

Regards,

Vladimir

-----Original Message-----
From: Primoz Beltram [mailto:xxxxx@hermes.si]
Sent: Tuesday, February 19, 2002 2:56 AM
To: File Systems Developers
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

I think that requesting reparse is something that you will have to do. If
you will search for archive e-mails in this list (search for STATUS_REPARSE
in messages body) you will find a lot of answers to your problem. NTFSD
archives are accessible on http://www.osr.com/listserver_main.htm and on
http://www.ntfsd.org/index.html.
Wbr Primoz

-----Original Message-----
From: Loh Lik Yong Winston [mailto:xxxxx@nus.edu.sg]
Sent: Tuesday, February 19, 2002 11:31 AM
To: File Systems Developers
Subject: [ntfsd] question about filter driver IRP_MJ_CREATE

Hi,

I am developing a Win2K filter driver. One of the functions of the filter
driver is to re-route the file object handles of the IRP_MJ_CREATE function
for certain programs. For example, say I have got a program A which is
trying to obtain a file handle for c:\file1.ext, I would like to re-route
this to c:\temp\file1.ext for the program A. Other programs may be routed
to other directories or even access the c:\file1.ext itself.

It is my understanding that when the I/O Manager calls the filesystem driver
to obtain a file handle, one of the parameters that would be passed is the
ObjectAttributes structure. One of the fields in this is the ObjectName
field that contains the full path name to the file that it would like to
obtain the file handle for. I would like to change the value of the
ObjectName field so that its value changes from “c:\file1.ext” to
“c:\temp\file1.ext” when program A tries to access the file. Theoretically
speaking, if the value of this field is changed, then the file handle
returned to program A will have been correctly routed. However, I am unsure
of how to change the value for the ObjectName string. I would appreciate it
if someone could tell me how I can do this. Is it possible or do I need to
call InitializeObjectAttributes and create a new ObjectAttributes instead?

Appreciate your help in this matter. Thanks.


You are currently subscribed to ntfsd as: xxxxx@hermes.si
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: xxxxx@Starbase.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Easy…

On the create call, change the filename in the file object, set
IoStatus.Infomation to IO_REPARSE and return STATUS_REPARSE; look Mom,
no hands :slight_smile:

Jamey

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Loh Lik Yong
Winston
Sent: Tuesday, February 19, 2002 2:31 AM
To: File Systems Developers
Subject: [ntfsd] question about filter driver IRP_MJ_CREATE

Hi,

I am developing a Win2K filter driver. One of the functions of the
filter driver is to re-route the file object handles of the
IRP_MJ_CREATE function for certain programs. For example, say I have
got a program A which is trying to obtain a file handle for
c:\file1.ext, I would like to re-route this to c:\temp\file1.ext for the
program A. Other programs may be routed to other directories or even
access the c:\file1.ext itself.

It is my understanding that when the I/O Manager calls the filesystem
driver to obtain a file handle, one of the parameters that would be
passed is the ObjectAttributes structure. One of the fields in this is
the ObjectName field that contains the full path name to the file that
it would like to obtain the file handle for. I would like to change the
value of the ObjectName field so that its value changes from
“c:\file1.ext” to “c:\temp\file1.ext” when program A tries to access the
file. Theoretically speaking, if the value of this field is changed,
then the file handle returned to program A will have been correctly
routed. However, I am unsure of how to change the value for the
ObjectName string. I would appreciate it if someone could tell me how I
can do this. Is it possible or do I need to call
InitializeObjectAttributes and create a new ObjectAttributes instead?

Appreciate your help in this matter. Thanks.


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com To
unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

I have no such problem.If the file is opened from the reparsed path,
querying the information (name) will return the proper information; how
can it not?

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Chtchetkine,
Vladimir
Sent: Tuesday, February 19, 2002 8:02 AM
To: File Systems Developers
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

There is one side effect with using STATUS_REPARSE. The effect is that
when application
queries file name information
(IRP_MJ_QUERYINFORMATION/FileNameInformation) it will get
the “real” path to the file. I.e. \temp\file1.ext and not \file1.ext
This may be not
important but in some cases this can be important. Lets say the app uses
path to the file
as a place where it should look for other files or something like that.

Regards,

Vladimir

-----Original Message-----
From: Primoz Beltram [mailto:xxxxx@hermes.si]
Sent: Tuesday, February 19, 2002 2:56 AM
To: File Systems Developers
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

I think that requesting reparse is something that you will have to do.
If
you will search for archive e-mails in this list (search for
STATUS_REPARSE
in messages body) you will find a lot of answers to your problem. NTFSD
archives are accessible on http://www.osr.com/listserver_main.htm and on

http://www.ntfsd.org/index.html.
Wbr Primoz

-----Original Message-----
From: Loh Lik Yong Winston [mailto:xxxxx@nus.edu.sg]
Sent: Tuesday, February 19, 2002 11:31 AM
To: File Systems Developers
Subject: [ntfsd] question about filter driver IRP_MJ_CREATE

Hi,

I am developing a Win2K filter driver. One of the functions of the
filter
driver is to re-route the file object handles of the IRP_MJ_CREATE
function
for certain programs. For example, say I have got a program A which is
trying to obtain a file handle for c:\file1.ext, I would like to
re-route
this to c:\temp\file1.ext for the program A. Other programs may be
routed
to other directories or even access the c:\file1.ext itself.

It is my understanding that when the I/O Manager calls the filesystem
driver
to obtain a file handle, one of the parameters that would be passed is
the
ObjectAttributes structure. One of the fields in this is the ObjectName

field that contains the full path name to the file that it would like to

obtain the file handle for. I would like to change the value of the
ObjectName field so that its value changes from “c:\file1.ext” to
“c:\temp\file1.ext” when program A tries to access the file.
Theoretically
speaking, if the value of this field is changed, then the file handle
returned to program A will have been correctly routed. However, I am
unsure
of how to change the value for the ObjectName string. I would
appreciate it
if someone could tell me how I can do this. Is it possible or do I need
to
call InitializeObjectAttributes and create a new ObjectAttributes
instead?

Appreciate your help in this matter. Thanks.


You are currently subscribed to ntfsd as: xxxxx@hermes.si
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as:
xxxxx@Starbase.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Sorry. I miss-read your message. Yes. You will get the name of the
reparsed file; as you should. I read your message backwards; little
dyslexic this morning :slight_smile:

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Jamey Kirby
Sent: Monday, February 18, 2002 8:36 PM
To: File Systems Developers
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

I have no such problem.If the file is opened from the reparsed path,
querying the information (name) will return the proper information; how
can it not?

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Chtchetkine,
Vladimir
Sent: Tuesday, February 19, 2002 8:02 AM
To: File Systems Developers
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

There is one side effect with using STATUS_REPARSE. The effect is that
when application
queries file name information
(IRP_MJ_QUERYINFORMATION/FileNameInformation) it will get
the “real” path to the file. I.e. \temp\file1.ext and not \file1.ext
This may be not
important but in some cases this can be important. Lets say the app uses
path to the file
as a place where it should look for other files or something like that.

Regards,

Vladimir

-----Original Message-----
From: Primoz Beltram [mailto:xxxxx@hermes.si]
Sent: Tuesday, February 19, 2002 2:56 AM
To: File Systems Developers
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

I think that requesting reparse is something that you will have to do.
If
you will search for archive e-mails in this list (search for
STATUS_REPARSE
in messages body) you will find a lot of answers to your problem. NTFSD
archives are accessible on http://www.osr.com/listserver_main.htm and on

http://www.ntfsd.org/index.html.
Wbr Primoz

-----Original Message-----
From: Loh Lik Yong Winston [mailto:xxxxx@nus.edu.sg]
Sent: Tuesday, February 19, 2002 11:31 AM
To: File Systems Developers
Subject: [ntfsd] question about filter driver IRP_MJ_CREATE

Hi,

I am developing a Win2K filter driver. One of the functions of the
filter
driver is to re-route the file object handles of the IRP_MJ_CREATE
function
for certain programs. For example, say I have got a program A which is
trying to obtain a file handle for c:\file1.ext, I would like to
re-route
this to c:\temp\file1.ext for the program A. Other programs may be
routed
to other directories or even access the c:\file1.ext itself.

It is my understanding that when the I/O Manager calls the filesystem
driver
to obtain a file handle, one of the parameters that would be passed is
the
ObjectAttributes structure. One of the fields in this is the ObjectName

field that contains the full path name to the file that it would like to

obtain the file handle for. I would like to change the value of the
ObjectName field so that its value changes from “c:\file1.ext” to
“c:\temp\file1.ext” when program A tries to access the file.
Theoretically
speaking, if the value of this field is changed, then the file handle
returned to program A will have been correctly routed. However, I am
unsure
of how to change the value for the ObjectName string. I would
appreciate it
if someone could tell me how I can do this. Is it possible or do I need
to
call InitializeObjectAttributes and create a new ObjectAttributes
instead?

Appreciate your help in this matter. Thanks.


You are currently subscribed to ntfsd as: xxxxx@hermes.si
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as:
xxxxx@Starbase.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Well, it depends on your system what would be considered “proper
information”. At least there could be a place for concern when app opens
file
“\Path\file.ext” and querying file name returns
“\AnotherPath\AnotherFile.noext”. For example (I don’t remember by now exact
scenario)
when you open a project in MSDEV by dblclicking on a .dsw file in Explorer
MSDEV will query filename information and use it instead of the
parameter passed in by Explorer. I guess this was happening because Explorer
passes a short name and path as a parameter and MSDEV tries to get the long
ones.

Regards,

Vladimir

-----Original Message-----
From: Jamey Kirby [mailto:xxxxx@storagecraft.com]
Sent: Monday, February 18, 2002 8:36 PM
To: File Systems Developers
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

I have no such problem.If the file is opened from the reparsed path,
querying the information (name) will return the proper information; how can
it not?

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Chtchetkine, Vladimir
Sent: Tuesday, February 19, 2002 8:02 AM
To: File Systems Developers
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

There is one side effect with using STATUS_REPARSE. The effect is that when
application
queries file name information (IRP_MJ_QUERYINFORMATION/FileNameInformation)
it will get
the “real” path to the file. I.e. \temp\file1.ext and not \file1.ext This
may be not
important but in some cases this can be important. Lets say the app uses
path to the file
as a place where it should look for other files or something like that.

Regards,

Vladimir

-----Original Message-----
From: Primoz Beltram [ mailto:xxxxx@hermes.si
mailto:xxxxx ]
Sent: Tuesday, February 19, 2002 2:56 AM
To: File Systems Developers
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

I think that requesting reparse is something that you will have to do. If
you will search for archive e-mails in this list (search for STATUS_REPARSE
in messages body) you will find a lot of answers to your problem. NTFSD
archives are accessible on http://www.osr.com/listserver_main.htm
http: and on
http://www.ntfsd.org/index.html http: .
Wbr Primoz

-----Original Message-----
From: Loh Lik Yong Winston [mailto:xxxxx@nus.edu.sg
mailto:xxxxx]
Sent: Tuesday, February 19, 2002 11:31 AM
To: File Systems Developers
Subject: [ntfsd] question about filter driver IRP_MJ_CREATE

Hi,

I am developing a Win2K filter driver. One of the functions of the filter
driver is to re-route the file object handles of the IRP_MJ_CREATE function
for certain programs. For example, say I have got a program A which is
trying to obtain a file handle for c:\file1.ext, I would like to re-route
this to c:\temp\file1.ext for the program A. Other programs may be routed
to other directories or even access the c:\file1.ext itself.

It is my understanding that when the I/O Manager calls the filesystem driver

to obtain a file handle, one of the parameters that would be passed is the
ObjectAttributes structure. One of the fields in this is the ObjectName
field that contains the full path name to the file that it would like to
obtain the file handle for. I would like to change the value of the
ObjectName field so that its value changes from “c:\file1.ext” to
“c:\temp\file1.ext” when program A tries to access the file. Theoretically
speaking, if the value of this field is changed, then the file handle
returned to program A will have been correctly routed. However, I am unsure

of how to change the value for the ObjectName string. I would appreciate it

if someone could tell me how I can do this. Is it possible or do I need to
call InitializeObjectAttributes and create a new ObjectAttributes instead?

Appreciate your help in this matter. Thanks.


You are currently subscribed to ntfsd as: xxxxx@hermes.si
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: xxxxx@Starbase.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: xxxxx@Starbase.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com</mailto:xxxxx></http:></http:></mailto:xxxxx>

> It is my understanding that when the I/O Manager calls the filesystem driver

to obtain a file handle, one of the parameters that would be passed is the
ObjectAttributes structure. One of the fields in this is the ObjectName

No.
In CREATE path, update the name in the file object, and then complete with STATUS_REPARSE/IO_REPARSE.
That’s all.

Max


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

This ought to be easy enough to address since you’re already filtering the file system. Filter IRP_MJ_QUERY_INFORMATION where FileInformationClass is equal to FileNameInformation. Return whatever name you like.

-----Original Message-----
From: Chtchetkine, Vladimir [mailto:xxxxx@Starbase.com]
Sent: Tuesday, February 19, 2002 11:55 AM
To: File Systems Developers
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

Well, it depends on your system what would be considered “proper information”. At least there could be a place for concern when app opens file
“\Path\file.ext” and querying file name returns “\AnotherPath\AnotherFile.noext”. For example (I don’t remember by now exact scenario)
when you open a project in MSDEV by dblclicking on a .dsw file in Explorer MSDEV will query filename information and use it instead of the
parameter passed in by Explorer. I guess this was happening because Explorer passes a short name and path as a parameter and MSDEV tries to get the long ones.

Regards,

Vladimir

-----Original Message-----
From: Jamey Kirby [mailto:xxxxx@storagecraft.com]
Sent: Monday, February 18, 2002 8:36 PM
To: File Systems Developers
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

I have no such problem.If the file is opened from the reparsed path, querying the information (name) will return the proper information; how can it not?

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Chtchetkine, Vladimir
Sent: Tuesday, February 19, 2002 8:02 AM
To: File Systems Developers
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

There is one side effect with using STATUS_REPARSE. The effect is that when application
queries file name information (IRP_MJ_QUERYINFORMATION/FileNameInformation) it will get
the “real” path to the file. I.e. \temp\file1.ext and not \file1.ext This may be not
important but in some cases this can be important. Lets say the app uses path to the file
as a place where it should look for other files or something like that.

Regards,

Vladimir

-----Original Message-----
From: Primoz Beltram [mailto:xxxxx@hermes.si]
Sent: Tuesday, February 19, 2002 2:56 AM
To: File Systems Developers
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

I think that requesting reparse is something that you will have to do. If
you will search for archive e-mails in this list (search for STATUS_REPARSE
in messages body) you will find a lot of answers to your problem. NTFSD
archives are accessible on http://www.osr.com/listserver_main.htm and on
http://www.ntfsd.org/index.html.
Wbr Primoz

-----Original Message-----
From: Loh Lik Yong Winston [mailto:xxxxx@nus.edu.sg]
Sent: Tuesday, February 19, 2002 11:31 AM
To: File Systems Developers
Subject: [ntfsd] question about filter driver IRP_MJ_CREATE

Hi,

I am developing a Win2K filter driver. One of the functions of the filter
driver is to re-route the file object handles of the IRP_MJ_CREATE function
for certain programs. For example, say I have got a program A which is
trying to obtain a file handle for c:\file1.ext, I would like to re-route
this to c:\temp\file1.ext for the program A. Other programs may be routed
to other directories or even access the c:\file1.ext itself.

It is my understanding that when the I/O Manager calls the filesystem driver
to obtain a file handle, one of the parameters that would be passed is the
ObjectAttributes structure. One of the fields in this is the ObjectName
field that contains the full path name to the file that it would like to
obtain the file handle for. I would like to change the value of the
ObjectName field so that its value changes from “c:\file1.ext” to
“c:\temp\file1.ext” when program A tries to access the file. Theoretically
speaking, if the value of this field is changed, then the file handle
returned to program A will have been correctly routed. However, I am unsure
of how to change the value for the ObjectName string. I would appreciate it
if someone could tell me how I can do this. Is it possible or do I need to
call InitializeObjectAttributes and create a new ObjectAttributes instead?

Appreciate your help in this matter. Thanks.


You are currently subscribed to ntfsd as: xxxxx@hermes.si
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: xxxxx@Starbase.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: xxxxx@Starbase.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: xxxxx@inin.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

… which rises another question: how to differ between file
“\AnotherPath\AnotherFile.noext” opened in a “regular” way and same file
opened as a result of redirection?
I’m not saying it’s impossible. It’s just not that simple as returning
STATUS_REPARSE. :slight_smile:

Regards,

Vladimir

-----Original Message-----
From: Fuller, Rob [mailto:xxxxx@inin.com]
Sent: Tuesday, February 19, 2002 10:10 AM
To: File Systems Developers
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

This ought to be easy enough to address since you’re already filtering the
file system. Filter IRP_MJ_QUERY_INFORMATION where FileInformationClass is
equal to FileNameInformation. Return whatever name you like.

-----Original Message-----
From: Chtchetkine, Vladimir [mailto:xxxxx@Starbase.com]
Sent: Tuesday, February 19, 2002 11:55 AM
To: File Systems Developers
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

Well, it depends on your system what would be considered “proper
information”. At least there could be a place for concern when app opens
file
“\Path\file.ext” and querying file name returns
“\AnotherPath\AnotherFile.noext”. For example (I don’t remember by now exact
scenario)
when you open a project in MSDEV by dblclicking on a .dsw file in Explorer
MSDEV will query filename information and use it instead of the
parameter passed in by Explorer. I guess this was happening because Explorer
passes a short name and path as a parameter and MSDEV tries to get the long
ones.

Regards,

Vladimir

-----Original Message-----
From: Jamey Kirby [mailto:xxxxx@storagecraft.com]
Sent: Monday, February 18, 2002 8:36 PM
To: File Systems Developers
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

I have no such problem.If the file is opened from the reparsed path,
querying the information (name) will return the proper information; how can
it not?

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Chtchetkine, Vladimir
Sent: Tuesday, February 19, 2002 8:02 AM
To: File Systems Developers
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

There is one side effect with using STATUS_REPARSE. The effect is that when
application
queries file name information (IRP_MJ_QUERYINFORMATION/FileNameInformation)
it will get
the “real” path to the file. I.e. \temp\file1.ext and not \file1.ext This
may be not
important but in some cases this can be important. Lets say the app uses
path to the file
as a place where it should look for other files or something like that.

Regards,

Vladimir

-----Original Message-----
From: Primoz Beltram [ mailto:xxxxx@hermes.si
mailto:xxxxx ]
Sent: Tuesday, February 19, 2002 2:56 AM
To: File Systems Developers
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

I think that requesting reparse is something that you will have to do. If
you will search for archive e-mails in this list (search for STATUS_REPARSE
in messages body) you will find a lot of answers to your problem. NTFSD
archives are accessible on http://www.osr.com/listserver_main.htm
http: and on
http://www.ntfsd.org/index.html http: .
Wbr Primoz

-----Original Message-----
From: Loh Lik Yong Winston [mailto:xxxxx@nus.edu.sg
mailto:xxxxx]
Sent: Tuesday, February 19, 2002 11:31 AM
To: File Systems Developers
Subject: [ntfsd] question about filter driver IRP_MJ_CREATE

Hi,

I am developing a Win2K filter driver. One of the functions of the filter
driver is to re-route the file object handles of the IRP_MJ_CREATE function
for certain programs. For example, say I have got a program A which is
trying to obtain a file handle for c:\file1.ext, I would like to re-route
this to c:\temp\file1.ext for the program A. Other programs may be routed
to other directories or even access the c:\file1.ext itself.

It is my understanding that when the I/O Manager calls the filesystem driver

to obtain a file handle, one of the parameters that would be passed is the
ObjectAttributes structure. One of the fields in this is the ObjectName
field that contains the full path name to the file that it would like to
obtain the file handle for. I would like to change the value of the
ObjectName field so that its value changes from “c:\file1.ext” to
“c:\temp\file1.ext” when program A tries to access the file. Theoretically
speaking, if the value of this field is changed, then the file handle
returned to program A will have been correctly routed. However, I am unsure

of how to change the value for the ObjectName string. I would appreciate it

if someone could tell me how I can do this. Is it possible or do I need to
call InitializeObjectAttributes and create a new ObjectAttributes instead?

Appreciate your help in this matter. Thanks.


You are currently subscribed to ntfsd as: xxxxx@hermes.si
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: xxxxx@Starbase.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: xxxxx@Starbase.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: xxxxx@inin.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: xxxxx@Starbase.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com</mailto:xxxxx></http:></http:></mailto:xxxxx>

MessageIt will return the information from the FSD from the real file’s FCB. The original name (before reparse) is lost forever.
Nevertheless, the filter can intercept this query.

Max

----- Original Message -----
From: Jamey Kirby
To: File Systems Developers
Sent: Tuesday, February 19, 2002 7:36 AM
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

I have no such problem.If the file is opened from the reparsed path, querying the information (name) will return the proper information; how can it not?
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Chtchetkine, Vladimir
Sent: Tuesday, February 19, 2002 8:02 AM
To: File Systems Developers
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

There is one side effect with using STATUS_REPARSE. The effect is that when application
queries file name information (IRP_MJ_QUERYINFORMATION/FileNameInformation) it will get
the “real” path to the file. I.e. \temp\file1.ext and not \file1.ext This may be not
important but in some cases this can be important. Lets say the app uses path to the file
as a place where it should look for other files or something like that.

Regards,

Vladimir

-----Original Message-----
From: Primoz Beltram [mailto:xxxxx@hermes.si]
Sent: Tuesday, February 19, 2002 2:56 AM
To: File Systems Developers
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

I think that requesting reparse is something that you will have to do. If
you will search for archive e-mails in this list (search for STATUS_REPARSE
in messages body) you will find a lot of answers to your problem. NTFSD
archives are accessible on http://www.osr.com/listserver_main.htm and on
http://www.ntfsd.org/index.html.
Wbr Primoz

-----Original Message-----
From: Loh Lik Yong Winston [mailto:xxxxx@nus.edu.sg]
Sent: Tuesday, February 19, 2002 11:31 AM
To: File Systems Developers
Subject: [ntfsd] question about filter driver IRP_MJ_CREATE

Hi,

I am developing a Win2K filter driver. One of the functions of the filter
driver is to re-route the file object handles of the IRP_MJ_CREATE function
for certain programs. For example, say I have got a program A which is
trying to obtain a file handle for c:\file1.ext, I would like to re-route
this to c:\temp\file1.ext for the program A. Other programs may be routed
to other directories or even access the c:\file1.ext itself.

It is my understanding that when the I/O Manager calls the filesystem driver
to obtain a file handle, one of the parameters that would be passed is the
ObjectAttributes structure. One of the fields in this is the ObjectName
field that contains the full path name to the file that it would like to
obtain the file handle for. I would like to change the value of the
ObjectName field so that its value changes from “c:\file1.ext” to
“c:\temp\file1.ext” when program A tries to access the file. Theoretically
speaking, if the value of this field is changed, then the file handle
returned to program A will have been correctly routed. However, I am unsure
of how to change the value for the ObjectName string. I would appreciate it
if someone could tell me how I can do this. Is it possible or do I need to
call InitializeObjectAttributes and create a new ObjectAttributes instead?

Appreciate your help in this matter. Thanks.


You are currently subscribed to ntfsd as: xxxxx@hermes.si
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: xxxxx@Starbase.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

From where? On reads/writes?

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Chtchetkine,
Vladimir
Sent: Tuesday, February 19, 2002 10:29 AM
To: File Systems Developers
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

… which rises another question: how to differ between file
“\AnotherPath\AnotherFile.noext” opened in a “regular” way and same file
opened as a result of redirection?
I’m not saying it’s impossible. It’s just not that simple as returning
STATUS_REPARSE. :slight_smile:

Regards,

Vladimir

-----Original Message-----
From: Fuller, Rob [mailto:xxxxx@inin.com]
Sent: Tuesday, February 19, 2002 10:10 AM
To: File Systems Developers
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

This ought to be easy enough to address since you’re already filtering
the file system. Filter IRP_MJ_QUERY_INFORMATION where
FileInformationClass is equal to FileNameInformation. Return whatever
name you like.

-----Original Message-----
From: Chtchetkine, Vladimir [mailto:xxxxx@Starbase.com]
Sent: Tuesday, February 19, 2002 11:55 AM
To: File Systems Developers
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

Well, it depends on your system what would be considered “proper
information”. At least there could be a place for concern when app opens
file
“\Path\file.ext” and querying file name returns
“\AnotherPath\AnotherFile.noext”. For example (I don’t remember by now
exact scenario)
when you open a project in MSDEV by dblclicking on a .dsw file in
Explorer MSDEV will query filename information and use it instead of the
parameter passed in by Explorer. I guess this was happening because
Explorer passes a short name and path as a parameter and MSDEV tries to
get the long ones.

Regards,

Vladimir

-----Original Message-----
From: Jamey Kirby [mailto:xxxxx@storagecraft.com]
Sent: Monday, February 18, 2002 8:36 PM
To: File Systems Developers
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

I have no such problem.If the file is opened from the reparsed path,
querying the information (name) will return the proper information; how
can it not?

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Chtchetkine,
Vladimir
Sent: Tuesday, February 19, 2002 8:02 AM
To: File Systems Developers
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

There is one side effect with using STATUS_REPARSE. The effect is that
when application
queries file name information
(IRP_MJ_QUERYINFORMATION/FileNameInformation) it will get
the “real” path to the file. I.e. \temp\file1.ext and not \file1.ext
This may be not
important but in some cases this can be important. Lets say the app uses
path to the file
as a place where it should look for other files or something like that.

Regards,

Vladimir

-----Original Message-----
From: Primoz Beltram [mailto:xxxxx@hermes.si]
Sent: Tuesday, February 19, 2002 2:56 AM
To: File Systems Developers
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

I think that requesting reparse is something that you will have to do.
If
you will search for archive e-mails in this list (search for
STATUS_REPARSE
in messages body) you will find a lot of answers to your problem. NTFSD
archives are accessible on http://www.osr.com/listserver_main.htm and on

http://www.ntfsd.org/index.html.
Wbr Primoz

-----Original Message-----
From: Loh Lik Yong Winston [mailto:xxxxx@nus.edu.sg]
Sent: Tuesday, February 19, 2002 11:31 AM
To: File Systems Developers
Subject: [ntfsd] question about filter driver IRP_MJ_CREATE

Hi,

I am developing a Win2K filter driver. One of the functions of the
filter
driver is to re-route the file object handles of the IRP_MJ_CREATE
function
for certain programs. For example, say I have got a program A which is
trying to obtain a file handle for c:\file1.ext, I would like to
re-route
this to c:\temp\file1.ext for the program A. Other programs may be
routed
to other directories or even access the c:\file1.ext itself.

It is my understanding that when the I/O Manager calls the filesystem
driver
to obtain a file handle, one of the parameters that would be passed is
the
ObjectAttributes structure. One of the fields in this is the ObjectName

field that contains the full path name to the file that it would like to

obtain the file handle for. I would like to change the value of the
ObjectName field so that its value changes from “c:\file1.ext” to
“c:\temp\file1.ext” when program A tries to access the file.
Theoretically
speaking, if the value of this field is changed, then the file handle
returned to program A will have been correctly routed. However, I am
unsure
of how to change the value for the ObjectName string. I would
appreciate it
if someone could tell me how I can do this. Is it possible or do I need
to
call InitializeObjectAttributes and create a new ObjectAttributes
instead?

Appreciate your help in this matter. Thanks.


You are currently subscribed to ntfsd as: xxxxx@hermes.si
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as:
xxxxx@Starbase.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as:
xxxxx@Starbase.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: xxxxx@inin.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as:
xxxxx@Starbase.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

From IRP_MJ_CREATE…

-----Original Message-----
From: Jamey Kirby [mailto:xxxxx@storagecraft.com]
Sent: Tuesday, February 19, 2002 10:46 AM
To: File Systems Developers
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

From where? On reads/writes?

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Chtchetkine, Vladimir
Sent: Tuesday, February 19, 2002 10:29 AM
To: File Systems Developers
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

… which rises another question: how to differ between file
“\AnotherPath\AnotherFile.noext” opened in a “regular” way and same file
opened as a result of redirection?
I’m not saying it’s impossible. It’s just not that simple as returning
STATUS_REPARSE. :slight_smile:

Regards,

Vladimir

-----Original Message-----
From: Fuller, Rob [mailto:xxxxx@inin.com]
Sent: Tuesday, February 19, 2002 10:10 AM
To: File Systems Developers
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

This ought to be easy enough to address since you’re already filtering the
file system. Filter IRP_MJ_QUERY_INFORMATION where FileInformationClass is
equal to FileNameInformation. Return whatever name you like.

-----Original Message-----
From: Chtchetkine, Vladimir [mailto:xxxxx@Starbase.com]
Sent: Tuesday, February 19, 2002 11:55 AM
To: File Systems Developers
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

Well, it depends on your system what would be considered “proper
information”. At least there could be a place for concern when app opens
file
“\Path\file.ext” and querying file name returns
“\AnotherPath\AnotherFile.noext”. For example (I don’t remember by now exact
scenario)
when you open a project in MSDEV by dblclicking on a .dsw file in Explorer
MSDEV will query filename information and use it instead of the
parameter passed in by Explorer. I guess this was happening because Explorer
passes a short name and path as a parameter and MSDEV tries to get the long
ones.

Regards,

Vladimir

-----Original Message-----
From: Jamey Kirby [mailto:xxxxx@storagecraft.com]
Sent: Monday, February 18, 2002 8:36 PM
To: File Systems Developers
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

I have no such problem.If the file is opened from the reparsed path,
querying the information (name) will return the proper information; how can
it not?

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Chtchetkine, Vladimir
Sent: Tuesday, February 19, 2002 8:02 AM
To: File Systems Developers
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

There is one side effect with using STATUS_REPARSE. The effect is that when
application
queries file name information (IRP_MJ_QUERYINFORMATION/FileNameInformation)
it will get
the “real” path to the file. I.e. \temp\file1.ext and not \file1.ext This
may be not
important but in some cases this can be important. Lets say the app uses
path to the file
as a place where it should look for other files or something like that.

Regards,

Vladimir

-----Original Message-----
From: Primoz Beltram [ mailto:xxxxx@hermes.si
mailto:xxxxx ]
Sent: Tuesday, February 19, 2002 2:56 AM
To: File Systems Developers
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

I think that requesting reparse is something that you will have to do. If
you will search for archive e-mails in this list (search for STATUS_REPARSE
in messages body) you will find a lot of answers to your problem. NTFSD
archives are accessible on http://www.osr.com/listserver_main.htm
http: and on
http://www.ntfsd.org/index.html http: .
Wbr Primoz

-----Original Message-----
From: Loh Lik Yong Winston [mailto:xxxxx@nus.edu.sg
mailto:xxxxx]
Sent: Tuesday, February 19, 2002 11:31 AM
To: File Systems Developers
Subject: [ntfsd] question about filter driver IRP_MJ_CREATE

Hi,

I am developing a Win2K filter driver. One of the functions of the filter
driver is to re-route the file object handles of the IRP_MJ_CREATE function
for certain programs. For example, say I have got a program A which is
trying to obtain a file handle for c:\file1.ext, I would like to re-route
this to c:\temp\file1.ext for the program A. Other programs may be routed
to other directories or even access the c:\file1.ext itself.

It is my understanding that when the I/O Manager calls the filesystem driver

to obtain a file handle, one of the parameters that would be passed is the
ObjectAttributes structure. One of the fields in this is the ObjectName
field that contains the full path name to the file that it would like to
obtain the file handle for. I would like to change the value of the
ObjectName field so that its value changes from “c:\file1.ext” to
“c:\temp\file1.ext” when program A tries to access the file. Theoretically
speaking, if the value of this field is changed, then the file handle
returned to program A will have been correctly routed. However, I am unsure

of how to change the value for the ObjectName string. I would appreciate it

if someone could tell me how I can do this. Is it possible or do I need to
call InitializeObjectAttributes and create a new ObjectAttributes instead?

Appreciate your help in this matter. Thanks.


You are currently subscribed to ntfsd as: xxxxx@hermes.si
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: xxxxx@Starbase.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: xxxxx@Starbase.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: xxxxx@inin.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: xxxxx@Starbase.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: xxxxx@Starbase.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com</mailto:xxxxx></http:></http:></mailto:xxxxx>

Hi all,

I am unsure of how to do this. I tried the following piece of code but
it crashes the entire system.


Irp->IoStatus.Information = IO_REPARSE;
RtlAnsiStringToUnicodeString(&FileObject->FileName,
“C:\TEMP\file.ext”, TRUE);
return STATUS_REPARSE;

I have also tried RtlCopyString, strcpy, memcpy in addition to the
RtlAnsiStringToUnicodeString function but all result in the system
crashing.

Would appreciate your help in resolving this matter. Thank you.

Winston

-----Original Message-----
From: Jamey Kirby
To: File Systems Developers
Sent: 2/19/02 12:30 PM
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

Easy…

On the create call, change the filename in the file object, set
IoStatus.Infomation to IO_REPARSE and return STATUS_REPARSE; look Mom,
no hands :slight_smile:

Jamey

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Loh Lik Yong
Winston
Sent: Tuesday, February 19, 2002 2:31 AM
To: File Systems Developers
Subject: [ntfsd] question about filter driver IRP_MJ_CREATE

Hi,

I am developing a Win2K filter driver. One of the functions of the
filter driver is to re-route the file object handles of the
IRP_MJ_CREATE function for certain programs. For example, say I have
got a program A which is trying to obtain a file handle for
c:\file1.ext, I would like to re-route this to c:\temp\file1.ext for the
program A. Other programs may be routed to other directories or even
access the c:\file1.ext itself.

It is my understanding that when the I/O Manager calls the filesystem
driver to obtain a file handle, one of the parameters that would be
passed is the ObjectAttributes structure. One of the fields in this is
the ObjectName field that contains the full path name to the file that
it would like to obtain the file handle for. I would like to change the
value of the ObjectName field so that its value changes from
“c:\file1.ext” to “c:\temp\file1.ext” when program A tries to access the
file. Theoretically speaking, if the value of this field is changed,
then the file handle returned to program A will have been correctly
routed. However, I am unsure of how to change the value for the
ObjectName string. I would appreciate it if someone could tell me how I
can do this. Is it possible or do I need to call
InitializeObjectAttributes and create a new ObjectAttributes instead?

Appreciate your help in this matter. Thanks.


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

The documentation for RtlAnsiStringToUnicodeString says the function RtlFreeUnicodeString must be used to free the buffer. Perhaps the “IO Manager” uses ExFreePool, and this is not the same as RtlFreeUnicodeString?

-----Original Message-----
From: Loh Lik Yong Winston [mailto:xxxxx@nus.edu.sg]
Sent: Friday, February 22, 2002 4:41 AM
To: File Systems Developers
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

Hi all,

I am unsure of how to do this. I tried the following piece of code but
it crashes the entire system.


Irp->IoStatus.Information = IO_REPARSE;
RtlAnsiStringToUnicodeString(&FileObject->FileName,
“C:\TEMP\file.ext”, TRUE);
return STATUS_REPARSE;

I have also tried RtlCopyString, strcpy, memcpy in addition to the
RtlAnsiStringToUnicodeString function but all result in the system
crashing.

Would appreciate your help in resolving this matter. Thank you.

Winston

-----Original Message-----
From: Jamey Kirby
To: File Systems Developers
Sent: 2/19/02 12:30 PM
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

Easy…

On the create call, change the filename in the file object, set
IoStatus.Infomation to IO_REPARSE and return STATUS_REPARSE; look Mom,
no hands :slight_smile:

Jamey

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Loh Lik Yong
Winston
Sent: Tuesday, February 19, 2002 2:31 AM
To: File Systems Developers
Subject: [ntfsd] question about filter driver IRP_MJ_CREATE

Hi,

I am developing a Win2K filter driver. One of the functions of the
filter driver is to re-route the file object handles of the
IRP_MJ_CREATE function for certain programs. For example, say I have
got a program A which is trying to obtain a file handle for
c:\file1.ext, I would like to re-route this to c:\temp\file1.ext for the
program A. Other programs may be routed to other directories or even
access the c:\file1.ext itself.

It is my understanding that when the I/O Manager calls the filesystem
driver to obtain a file handle, one of the parameters that would be
passed is the ObjectAttributes structure. One of the fields in this is
the ObjectName field that contains the full path name to the file that
it would like to obtain the file handle for. I would like to change the
value of the ObjectName field so that its value changes from
“c:\file1.ext” to “c:\temp\file1.ext” when program A tries to access the
file. Theoretically speaking, if the value of this field is changed,
then the file handle returned to program A will have been correctly
routed. However, I am unsure of how to change the value for the
ObjectName string. I would appreciate it if someone could tell me how I
can do this. Is it possible or do I need to call
InitializeObjectAttributes and create a new ObjectAttributes instead?

Appreciate your help in this matter. Thanks.


You are currently subscribed to ntfsd as: xxxxx@inin.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Also, did you set Irp->IoStatus.Status = STATUS_REPARSE?

-----Original Message-----
From: Fuller, Rob
Sent: Friday, February 22, 2002 9:26 AM
To: ‘File Systems Developers’
Subject: RE: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

The documentation for RtlAnsiStringToUnicodeString says the function RtlFreeUnicodeString must be used to free the buffer. Perhaps the “IO Manager” uses ExFreePool, and this is not the same as RtlFreeUnicodeString?

-----Original Message-----
From: Loh Lik Yong Winston [mailto:xxxxx@nus.edu.sg]
Sent: Friday, February 22, 2002 4:41 AM
To: File Systems Developers
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

Hi all,

I am unsure of how to do this. I tried the following piece of code but
it crashes the entire system.


Irp->IoStatus.Information = IO_REPARSE;
RtlAnsiStringToUnicodeString(&FileObject->FileName,
“C:\TEMP\file.ext”, TRUE);
return STATUS_REPARSE;

I have also tried RtlCopyString, strcpy, memcpy in addition to the
RtlAnsiStringToUnicodeString function but all result in the system
crashing.

Would appreciate your help in resolving this matter. Thank you.

Winston

-----Original Message-----
From: Jamey Kirby
To: File Systems Developers
Sent: 2/19/02 12:30 PM
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

Easy…

On the create call, change the filename in the file object, set
IoStatus.Infomation to IO_REPARSE and return STATUS_REPARSE; look Mom,
no hands :slight_smile:

Jamey

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Loh Lik Yong
Winston
Sent: Tuesday, February 19, 2002 2:31 AM
To: File Systems Developers
Subject: [ntfsd] question about filter driver IRP_MJ_CREATE

Hi,

I am developing a Win2K filter driver. One of the functions of the
filter driver is to re-route the file object handles of the
IRP_MJ_CREATE function for certain programs. For example, say I have
got a program A which is trying to obtain a file handle for
c:\file1.ext, I would like to re-route this to c:\temp\file1.ext for the
program A. Other programs may be routed to other directories or even
access the c:\file1.ext itself.

It is my understanding that when the I/O Manager calls the filesystem
driver to obtain a file handle, one of the parameters that would be
passed is the ObjectAttributes structure. One of the fields in this is
the ObjectName field that contains the full path name to the file that
it would like to obtain the file handle for. I would like to change the
value of the ObjectName field so that its value changes from
“c:\file1.ext” to “c:\temp\file1.ext” when program A tries to access the
file. Theoretically speaking, if the value of this field is changed,
then the file handle returned to program A will have been correctly
routed. However, I am unsure of how to change the value for the
ObjectName string. I would appreciate it if someone could tell me how I
can do this. Is it possible or do I need to call
InitializeObjectAttributes and create a new ObjectAttributes instead?

Appreciate your help in this matter. Thanks.


You are currently subscribed to ntfsd as: xxxxx@inin.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

\??\c:\TEMP\file.ext

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Loh Lik Yong
Winston
Sent: Friday, February 22, 2002 1:41 AM
To: File Systems Developers
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

Hi all,

I am unsure of how to do this. I tried the following piece of code but
it crashes the entire system.


Irp->IoStatus.Information = IO_REPARSE;
RtlAnsiStringToUnicodeString(&FileObject->FileName,
“C:\TEMP\file.ext”, TRUE);
return STATUS_REPARSE;

I have also tried RtlCopyString, strcpy, memcpy in addition to the
RtlAnsiStringToUnicodeString function but all result in the system
crashing.

Would appreciate your help in resolving this matter. Thank you.

Winston

-----Original Message-----
From: Jamey Kirby
To: File Systems Developers
Sent: 2/19/02 12:30 PM
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

Easy…

On the create call, change the filename in the file object, set
IoStatus.Infomation to IO_REPARSE and return STATUS_REPARSE; look Mom,
no hands :slight_smile:

Jamey

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Loh Lik Yong
Winston
Sent: Tuesday, February 19, 2002 2:31 AM
To: File Systems Developers
Subject: [ntfsd] question about filter driver IRP_MJ_CREATE

Hi,

I am developing a Win2K filter driver. One of the functions of the
filter driver is to re-route the file object handles of the
IRP_MJ_CREATE function for certain programs. For example, say I have
got a program A which is trying to obtain a file handle for
c:\file1.ext, I would like to re-route this to c:\temp\file1.ext for the

program A. Other programs may be routed to other directories or even
access the c:\file1.ext itself.

It is my understanding that when the I/O Manager calls the filesystem
driver to obtain a file handle, one of the parameters that would be
passed is the ObjectAttributes structure. One of the fields in this is
the ObjectName field that contains the full path name to the file that
it would like to obtain the file handle for. I would like to change the

value of the ObjectName field so that its value changes from
“c:\file1.ext” to “c:\temp\file1.ext” when program A tries to access the

file. Theoretically speaking, if the value of this field is changed,
then the file handle returned to program A will have been correctly
routed. However, I am unsure of how to change the value for the
ObjectName string. I would appreciate it if someone could tell me how I

can do this. Is it possible or do I need to call
InitializeObjectAttributes and create a new ObjectAttributes instead?

Appreciate your help in this matter. Thanks.


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com To
unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Here is how I do it:

if( fileObject->FileName.Buffer != NULL )
ExFreePool(fileObject->FileName.Buffer);
RtlInitUnicodeString(&fileObject->FileName, nameBuffer);
fileObject->RelatedFileObject = NULL;
Irp->IoStatus.Information = IO_REPARSE;
ntStatus = Irp->IoStatus.Status = STATUS_REPARSE;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return ntStatus;

Jamey

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Fuller, Rob
Sent: Friday, February 22, 2002 6:26 AM
To: File Systems Developers
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

The documentation for RtlAnsiStringToUnicodeString says the function
RtlFreeUnicodeString must be used to free the buffer. Perhaps the “IO
Manager” uses ExFreePool, and this is not the same as
RtlFreeUnicodeString?

-----Original Message-----
From: Loh Lik Yong Winston [mailto:xxxxx@nus.edu.sg]
Sent: Friday, February 22, 2002 4:41 AM
To: File Systems Developers
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

Hi all,

I am unsure of how to do this. I tried the following piece of code but
it crashes the entire system.


Irp->IoStatus.Information = IO_REPARSE;
RtlAnsiStringToUnicodeString(&FileObject->FileName,
“C:\TEMP\file.ext”, TRUE);
return STATUS_REPARSE;

I have also tried RtlCopyString, strcpy, memcpy in addition to the
RtlAnsiStringToUnicodeString function but all result in the system
crashing.

Would appreciate your help in resolving this matter. Thank you.

Winston

-----Original Message-----
From: Jamey Kirby
To: File Systems Developers
Sent: 2/19/02 12:30 PM
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

Easy…

On the create call, change the filename in the file object, set
IoStatus.Infomation to IO_REPARSE and return STATUS_REPARSE; look Mom,
no hands :slight_smile:

Jamey

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Loh Lik Yong
Winston
Sent: Tuesday, February 19, 2002 2:31 AM
To: File Systems Developers
Subject: [ntfsd] question about filter driver IRP_MJ_CREATE

Hi,

I am developing a Win2K filter driver. One of the functions of the
filter driver is to re-route the file object handles of the
IRP_MJ_CREATE function for certain programs. For example, say I have
got a program A which is trying to obtain a file handle for
c:\file1.ext, I would like to re-route this to c:\temp\file1.ext for the

program A. Other programs may be routed to other directories or even
access the c:\file1.ext itself.

It is my understanding that when the I/O Manager calls the filesystem
driver to obtain a file handle, one of the parameters that would be
passed is the ObjectAttributes structure. One of the fields in this is
the ObjectName field that contains the full path name to the file that
it would like to obtain the file handle for. I would like to change the

value of the ObjectName field so that its value changes from
“c:\file1.ext” to “c:\temp\file1.ext” when program A tries to access the

file. Theoretically speaking, if the value of this field is changed,
then the file handle returned to program A will have been correctly
routed. However, I am unsure of how to change the value for the
ObjectName string. I would appreciate it if someone could tell me how I

can do this. Is it possible or do I need to call
InitializeObjectAttributes and create a new ObjectAttributes instead?

Appreciate your help in this matter. Thanks.


You are currently subscribed to ntfsd as: xxxxx@inin.com To
unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com To
unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

What does RtlFreeUnicodeString have to do with the obviously erroneous use
of RtlAnsiStringToUnicodeString? He shouldn’t even get that far.

Remember that RtlAnsiStringToUnicodeString takes a PANSI_STRING, not a
char* (unless there is an overloaded version I’ve overlooked), so it’s
looking at the first four chars as the length and maximum length of the
ANSI_STRING, and trying to allocate memory accordingly. Then it’s looking
at the next four chars as a char*, and will attempt to dereference whatever
address they form.

Better to just use RtlInitUnicodeString and make the string wide chars with
the L prefix. That just updates the pointer to the WCHAR* and sets the
length and maximum length in UNICODE_STRING. Then you don’t have to
remember to RtlFreeUnicodeString at all.

Phil

“Fuller, Rob” @lists.osr.com on 02/22/2002 07:25:36 AM

Please respond to “File Systems Developers”

Sent by: xxxxx@lists.osr.com

To: “File Systems Developers”
cc:

Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

The documentation for RtlAnsiStringToUnicodeString says the function
RtlFreeUnicodeString must be used to free the buffer. Perhaps the “IO
Manager” uses ExFreePool, and this is not the same as RtlFreeUnicodeString?

-----Original Message-----
From: Loh Lik Yong Winston [mailto:xxxxx@nus.edu.sg]
Sent: Friday, February 22, 2002 4:41 AM
To: File Systems Developers
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

Hi all,

I am unsure of how to do this. I tried the following piece of code but
it crashes the entire system.


Irp->IoStatus.Information = IO_REPARSE;
RtlAnsiStringToUnicodeString(&FileObject->FileName,
“C:\TEMP\file.ext”, TRUE);
return STATUS_REPARSE;


I have also tried RtlCopyString, strcpy, memcpy in addition to the
RtlAnsiStringToUnicodeString function but all result in the system
crashing.

Would appreciate your help in resolving this matter. Thank you.

Winston

-----Original Message-----
From: Jamey Kirby
To: File Systems Developers
Sent: 2/19/02 12:30 PM
Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

Easy…

On the create call, change the filename in the file object, set
IoStatus.Infomation to IO_REPARSE and return STATUS_REPARSE; look Mom,
no hands :slight_smile:

Jamey

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Loh Lik Yong
Winston
Sent: Tuesday, February 19, 2002 2:31 AM
To: File Systems Developers
Subject: [ntfsd] question about filter driver IRP_MJ_CREATE

Hi,

I am developing a Win2K filter driver. One of the functions of the
filter driver is to re-route the file object handles of the
IRP_MJ_CREATE function for certain programs. For example, say I have
got a program A which is trying to obtain a file handle for
c:\file1.ext, I would like to re-route this to c:\temp\file1.ext for the
program A. Other programs may be routed to other directories or even
access the c:\file1.ext itself.

It is my understanding that when the I/O Manager calls the filesystem
driver to obtain a file handle, one of the parameters that would be
passed is the ObjectAttributes structure. One of the fields in this is
the ObjectName field that contains the full path name to the file that
it would like to obtain the file handle for. I would like to change the
value of the ObjectName field so that its value changes from
“c:\file1.ext” to “c:\temp\file1.ext” when program A tries to access the
file. Theoretically speaking, if the value of this field is changed,
then the file handle returned to program A will have been correctly
routed. However, I am unsure of how to change the value for the
ObjectName string. I would appreciate it if someone could tell me how I
can do this. Is it possible or do I need to call
InitializeObjectAttributes and create a new ObjectAttributes instead?

Appreciate your help in this matter. Thanks.


You are currently subscribed to ntfsd as: xxxxx@inin.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: xxxxx@Seagate.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

If you haven’t done the allocation of FileName.Buffer, this has some risk,
as you *could* be ExFreePool() ing a static string. Or maybe the caller
might like to refer to that buffer again. It’s unlikely, but possible.

Of course, if you allocated it, then that won’t be happening. I am only
addressing the snippet below, not the original problem. Perhaps in the
original problem statement it was made clear that you own the buffer you
are freeing.

Phil

“Jamey Kirby” @lists.osr.com on 02/22/2002
08:57:42 AM

Please respond to “File Systems Developers”

Sent by: xxxxx@lists.osr.com

To: “File Systems Developers”
cc:

Subject: [ntfsd] RE: question about filter driver IRP_MJ_CREATE

Here is how I do it:

if( fileObject->FileName.Buffer != NULL )
ExFreePool(fileObject->FileName.Buffer);
RtlInitUnicodeString(&fileObject->FileName, nameBuffer);
fileObject->RelatedFileObject = NULL;
Irp->IoStatus.Information = IO_REPARSE;
ntStatus = Irp->IoStatus.Status = STATUS_REPARSE;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return ntStatus;

Jamey


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com