How to match between renamed files?

Hello

When a rename is carried from user mode via MoveFileEx this, AFAIK,
happens:

1)IRP CREATE -> obtain FO1 (src file)
2)IRP_CREATE -> obtain FO2 (dest file)
3)IRP_SET_INFORMATION w/ class = Rename
4)CLEANUP FO1, FO2

Now how can I know from step 3, the value of FO2, and deduct that there is a
relation between FO1 and FO2.

What I want is to log one operation that is like: File1 renamed to File2.

I can link between the two operations, via matching the FilePath value
instead of FOs, however I want FO matching as a first solution.


Elias

Why wouldn’t you use the parameters to the IRP_MJ_SET_INFORMATION to
“match” these two together? Both are passed in to you
(IoStack->FileObject and IoStack->Parameters.SetFile.FileObject) so
there shouldn’t be any need to match by path name. You can see how this
is done in FatSetRenameInfo (fileinfo.c).

Am I missing something?

Regards,

Tony

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

Looking forward to seeing you at the Next OSR File Systems Class October
18, 2004 in Silicon Valley!

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of lallous
Sent: Monday, September 20, 2004 5:52 AM
To: ntfsd redirect
Subject: [ntfsd] How to match between renamed files?

Hello

When a rename is carried from user mode via MoveFileEx this, AFAIK,
happens:

1)IRP CREATE -> obtain FO1 (src file)
2)IRP_CREATE -> obtain FO2 (dest file)
3)IRP_SET_INFORMATION w/ class = Rename
4)CLEANUP FO1, FO2

Now how can I know from step 3, the value of FO2, and deduct that there
is a
relation between FO1 and FO2.

What I want is to log one operation that is like: File1 renamed to
File2.

I can link between the two operations, via matching the FilePath value
instead of FOs, however I want FO matching as a first solution.


Elias


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

You are currently subscribed to ntfsd as: xxxxx@osr.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Per the “Decoding rename operations” article, this holds true while the
simple rename case doesn’t occur.

When it happens,
irpSp->Parameters.SetFile.FileObject == 0!

What to do in this case?


Elias

“Tony Mason” wrote in message news:xxxxx@ntfsd…
Why wouldn’t you use the parameters to the IRP_MJ_SET_INFORMATION to
“match” these two together? Both are passed in to you
(IoStack->FileObject and IoStack->Parameters.SetFile.FileObject) so
there shouldn’t be any need to match by path name. You can see how this
is done in FatSetRenameInfo (fileinfo.c).

Am I missing something?

Regards,

Tony

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

Looking forward to seeing you at the Next OSR File Systems Class October
18, 2004 in Silicon Valley!

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of lallous
Sent: Monday, September 20, 2004 5:52 AM
To: ntfsd redirect
Subject: [ntfsd] How to match between renamed files?

Hello

When a rename is carried from user mode via MoveFileEx this, AFAIK,
happens:

1)IRP CREATE -> obtain FO1 (src file)
2)IRP_CREATE -> obtain FO2 (dest file)
3)IRP_SET_INFORMATION w/ class = Rename
4)CLEANUP FO1, FO2

Now how can I know from step 3, the value of FO2, and deduct that there
is a
relation between FO1 and FO2.

What I want is to log one operation that is like: File1 renamed to
File2.

I can link between the two operations, via matching the FilePath value
instead of FOs, however I want FO matching as a first solution.


Elias

In that case there is no second file object, so what are you matching?

Regards,

Tony

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

Looking forward to seeing you at the Next OSR File Systems Class October
18, 2004 in Silicon Valley!

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of lallous
Sent: Monday, September 20, 2004 7:03 AM
To: ntfsd redirect
Subject: Re:[ntfsd] How to match between renamed files?

Per the “Decoding rename operations” article, this holds true while the
simple rename case doesn’t occur.

When it happens,
irpSp->Parameters.SetFile.FileObject == 0!

What to do in this case?


Elias

“Tony Mason” wrote in message news:xxxxx@ntfsd…
Why wouldn’t you use the parameters to the IRP_MJ_SET_INFORMATION to
“match” these two together? Both are passed in to you
(IoStack->FileObject and IoStack->Parameters.SetFile.FileObject) so
there shouldn’t be any need to match by path name. You can see how this
is done in FatSetRenameInfo (fileinfo.c).

Am I missing something?

Regards,

Tony

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

Looking forward to seeing you at the Next OSR File Systems Class October
18, 2004 in Silicon Valley!

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of lallous
Sent: Monday, September 20, 2004 5:52 AM
To: ntfsd redirect
Subject: [ntfsd] How to match between renamed files?

Hello

When a rename is carried from user mode via MoveFileEx this, AFAIK,
happens:

1)IRP CREATE -> obtain FO1 (src file)
2)IRP_CREATE -> obtain FO2 (dest file)
3)IRP_SET_INFORMATION w/ class = Rename
4)CLEANUP FO1, FO2

Now how can I know from step 3, the value of FO2, and deduct that there
is a
relation between FO1 and FO2.

What I want is to log one operation that is like: File1 renamed to
File2.

I can link between the two operations, via matching the FilePath value
instead of FOs, however I want FO matching as a first solution.


Elias


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

You are currently subscribed to ntfsd as: xxxxx@osr.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Hello Tony,

Well, the article says that when a rename is issued, there are three methods
to decode the target file name.
And in all cases, the article showed how to compute the target name.

Now I refer back to the original post and ask the same question, but now in
the case of simple rename (where SetFileInfo.FileObject == 0)

The only solution for this now is w/ path name matching (which will lead me
to the relation between FO1 and FO2) ?

What OS part is responsible for deciding what sort of rename request
encoding strategy should be issued to the underlying FSD?

Using MoveFileEx on NT seems to always cause a processFQRename().

Regards,
Elias

“Tony Mason” wrote in message news:xxxxx@ntfsd…
In that case there is no second file object, so what are you matching?

Regards,

Tony

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

Looking forward to seeing you at the Next OSR File Systems Class October
18, 2004 in Silicon Valley!

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of lallous
Sent: Monday, September 20, 2004 7:03 AM
To: ntfsd redirect
Subject: Re:[ntfsd] How to match between renamed files?

Per the “Decoding rename operations” article, this holds true while the
simple rename case doesn’t occur.

When it happens,
irpSp->Parameters.SetFile.FileObject == 0!

What to do in this case?


Elias

“Tony Mason” wrote in message news:xxxxx@ntfsd…
Why wouldn’t you use the parameters to the IRP_MJ_SET_INFORMATION to
“match” these two together? Both are passed in to you
(IoStack->FileObject and IoStack->Parameters.SetFile.FileObject) so
there shouldn’t be any need to match by path name. You can see how this
is done in FatSetRenameInfo (fileinfo.c).

Am I missing something?

Regards,

Tony

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

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of lallous
Sent: Monday, September 20, 2004 5:52 AM
To: ntfsd redirect
Subject: [ntfsd] How to match between renamed files?

Hello

When a rename is carried from user mode via MoveFileEx this, AFAIK,
happens:

1)IRP CREATE -> obtain FO1 (src file)
2)IRP_CREATE -> obtain FO2 (dest file)
3)IRP_SET_INFORMATION w/ class = Rename
4)CLEANUP FO1, FO2

Now how can I know from step 3, the value of FO2, and deduct that there
is a
relation between FO1 and FO2.

What I want is to log one operation that is like: File1 renamed to
File2.

I can link between the two operations, via matching the FilePath value
instead of FOs, however I want FO matching as a first solution.


Elias

In the simple rename case (rename of a file within its current
directory) there IS no second file object - the step you listed where
that is opened just does not exist. The fact that the Win32 API doesn’t
use that feature does not make it an invalid possibility. You might
also try from the command line as I often find it uses different
features than Explorer or other Win32 applications. SRV
(CIFS/LanManager) may also prove to use it.

Regards,

Tony

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

Looking forward to seeing you at the Next OSR File Systems Class October
18, 2004 in Silicon Valley!

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of lallous
Sent: Monday, September 20, 2004 7:28 AM
To: ntfsd redirect
Subject: Re:[ntfsd] How to match between renamed files?

Hello Tony,

Well, the article says that when a rename is issued, there are three
methods
to decode the target file name.
And in all cases, the article showed how to compute the target name.

Now I refer back to the original post and ask the same question, but now
in
the case of simple rename (where SetFileInfo.FileObject == 0)

The only solution for this now is w/ path name matching (which will lead
me
to the relation between FO1 and FO2) ?

What OS part is responsible for deciding what sort of rename request
encoding strategy should be issued to the underlying FSD?

Using MoveFileEx on NT seems to always cause a processFQRename().

Regards,
Elias

“Tony Mason” wrote in message news:xxxxx@ntfsd…
In that case there is no second file object, so what are you matching?

Regards,

Tony

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

Looking forward to seeing you at the Next OSR File Systems Class October
18, 2004 in Silicon Valley!

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of lallous
Sent: Monday, September 20, 2004 7:03 AM
To: ntfsd redirect
Subject: Re:[ntfsd] How to match between renamed files?

Per the “Decoding rename operations” article, this holds true while the
simple rename case doesn’t occur.

When it happens,
irpSp->Parameters.SetFile.FileObject == 0!

What to do in this case?


Elias

“Tony Mason” wrote in message news:xxxxx@ntfsd…
Why wouldn’t you use the parameters to the IRP_MJ_SET_INFORMATION to
“match” these two together? Both are passed in to you
(IoStack->FileObject and IoStack->Parameters.SetFile.FileObject) so
there shouldn’t be any need to match by path name. You can see how this
is done in FatSetRenameInfo (fileinfo.c).

Am I missing something?

Regards,

Tony

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

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of lallous
Sent: Monday, September 20, 2004 5:52 AM
To: ntfsd redirect
Subject: [ntfsd] How to match between renamed files?

Hello

When a rename is carried from user mode via MoveFileEx this, AFAIK,
happens:

1)IRP CREATE -> obtain FO1 (src file)
2)IRP_CREATE -> obtain FO2 (dest file)
3)IRP_SET_INFORMATION w/ class = Rename
4)CLEANUP FO1, FO2

Now how can I know from step 3, the value of FO2, and deduct that there
is a
relation between FO1 and FO2.

What I want is to log one operation that is like: File1 renamed to
File2.

I can link between the two operations, via matching the FilePath value
instead of FOs, however I want FO matching as a first solution.


Elias


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

You are currently subscribed to ntfsd as: xxxxx@osr.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Also many apps download or save the files to some temporary locations, and
then renames/moves them to final destination. A very typical pattern. The GVIM
text editor (port from UNIX) is one sample.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Tony Mason”
To: “Windows File Systems Devs Interest List”
Sent: Monday, September 20, 2004 3:55 PM
Subject: RE: [ntfsd] How to match between renamed files?

> In the simple rename case (rename of a file within its current
> directory) there IS no second file object - the step you listed where
> that is opened just does not exist. The fact that the Win32 API doesn’t
> use that feature does not make it an invalid possibility. You might
> also try from the command line as I often find it uses different
> features than Explorer or other Win32 applications. SRV
> (CIFS/LanManager) may also prove to use it.
>
> Regards,
>
> Tony
>
> Tony Mason
> Consulting Partner
> OSR Open Systems Resources, Inc.
> http://www.osr.com
>
> Looking forward to seeing you at the Next OSR File Systems Class October
> 18, 2004 in Silicon Valley!
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of lallous
> Sent: Monday, September 20, 2004 7:28 AM
> To: ntfsd redirect
> Subject: Re:[ntfsd] How to match between renamed files?
>
> Hello Tony,
>
> Well, the article says that when a rename is issued, there are three
> methods
> to decode the target file name.
> And in all cases, the article showed how to compute the target name.
>
> Now I refer back to the original post and ask the same question, but now
> in
> the case of simple rename (where SetFileInfo.FileObject == 0)
>
> The only solution for this now is w/ path name matching (which will lead
> me
> to the relation between FO1 and FO2) ?
>
> What OS part is responsible for deciding what sort of rename request
> encoding strategy should be issued to the underlying FSD?
>
> Using MoveFileEx on NT seems to always cause a processFQRename().
>
> Regards,
> Elias
>
> “Tony Mason” wrote in message news:xxxxx@ntfsd…
> In that case there is no second file object, so what are you matching?
>
> Regards,
>
> Tony
>
> Tony Mason
> Consulting Partner
> OSR Open Systems Resources, Inc.
> http://www.osr.com
>
> Looking forward to seeing you at the Next OSR File Systems Class October
> 18, 2004 in Silicon Valley!
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of lallous
> Sent: Monday, September 20, 2004 7:03 AM
> To: ntfsd redirect
> Subject: Re:[ntfsd] How to match between renamed files?
>
> Per the “Decoding rename operations” article, this holds true while the
> simple rename case doesn’t occur.
>
> When it happens,
> irpSp->Parameters.SetFile.FileObject == 0!
>
> What to do in this case?
>
> –
> Elias
>
> “Tony Mason” wrote in message news:xxxxx@ntfsd…
> Why wouldn’t you use the parameters to the IRP_MJ_SET_INFORMATION to
> “match” these two together? Both are passed in to you
> (IoStack->FileObject and IoStack->Parameters.SetFile.FileObject) so
> there shouldn’t be any need to match by path name. You can see how this
> is done in FatSetRenameInfo (fileinfo.c).
>
> Am I missing something?
>
> Regards,
>
> Tony
>
> Tony Mason
> Consulting Partner
> OSR Open Systems Resources, Inc.
> http://www.osr.com
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of lallous
> Sent: Monday, September 20, 2004 5:52 AM
> To: ntfsd redirect
> Subject: [ntfsd] How to match between renamed files?
>
> Hello
>
> When a rename is carried from user mode via MoveFileEx this, AFAIK,
> happens:
>
> 1)IRP CREATE -> obtain FO1 (src file)
> 2)IRP_CREATE -> obtain FO2 (dest file)
> 3)IRP_SET_INFORMATION w/ class = Rename
> 4)CLEANUP FO1, FO2
>
> Now how can I know from step 3, the value of FO2, and deduct that there
> is a
> relation between FO1 and FO2.
>
> What I want is to log one operation that is like: File1 renamed to
> File2.
>
> I can link between the two operations, via matching the FilePath value
> instead of FOs, however I want FO matching as a first solution.
>
> –
> Elias
>
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@osr.com
> 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
>

Hi lallous

I think, you think you have observed these two IRP_MJ_CREATE as you
describe, in some test cases, but when you think you have observed 2) you
will find that the SL_OPEN_TARGET_DIRECTORY flag is set, and FO2 is a file
object for the parent directory of the rename target (dest file in your
text), not the rename target.

In general there is no FO2 for the rename target; in fact did you ever try
to rename to a target which you have open?

Good luck!
Lyndon

“lallous” wrote in message news:xxxxx@ntfsd…
> Hello
>
> When a rename is carried from user mode via MoveFileEx this, AFAIK,
> happens:
>
> 1)IRP CREATE -> obtain FO1 (src file)
> 2)IRP_CREATE -> obtain FO2 (dest file)
> 3)IRP_SET_INFORMATION w/ class = Rename
> 4)CLEANUP FO1, FO2
>
> Now how can I know from step 3, the value of FO2, and deduct that there is
a
> relation between FO1 and FO2.
>
> What I want is to log one operation that is like: File1 renamed to File2.
>
> I can link between the two operations, via matching the FilePath value
> instead of FOs, however I want FO matching as a first solution.
>
> –
> Elias
>
>
>