displaying file ids at FileObject->FileName

I notice that the sample filter displays a file id at
FileObject->FileName using the same %wZ it uses for a true name:

if (irpSp->Parameters.Create.Options & FILE_OPEN_BY_FILE_ID) {

SF_LOG_PRINT( DFDEBUG_DISPLAY_CREATE_NAMES,
(“\nDfCreate: OPENED fo=%p %08x:%08x %wZ
(FID)”,
irpSp->FileObject,
Irp->IoStatus.Status,
Irp->IoStatus.Information,
&fileObject->FileName) );

} else {

SF_LOG_PRINT( DFDEBUG_DISPLAY_CREATE_NAMES,
(“\nDfCreate: OPENED fo=%p Status=%08x,
Info=%08x %wZ (%s:%d)”,
irpSp->FileObject,
Irp->IoStatus.Status,
Irp->IoStatus.Information,
&fileObject->FileName) );
}

But my understanding is that if there’s a file id there, then
FileName.Buffer holds the address of a 64-bit integer rather than
pointing to a string of WCHARs, so how does %wZ handle this?

Thanks,
Steve

Since my understanding is that the 16 bit wide character spec is
essentially full, I’d expect it to print whatever values correspond to
those characters in the character set.

Note that in the case where a file is opened by ID, there are four
possible options for the format of the name:

  • a 64 bit file ID;
  • a 128 bit object ID;
  • a leading backslash '' + one of the first two (so this counts as two
    options :wink:

But this doesn’t do anything special here. If you are concerned about
this, you might wish to modify the example to print this as a numeric
rather than as the equivalent 16-bit string.

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 Steve Adams
Sent: Thursday, June 30, 2005 5:16 PM
To: ntfsd redirect
Subject: [ntfsd] displaying file ids at FileObject->FileName

I notice that the sample filter displays a file id at
FileObject->FileName using the same %wZ it uses for a true name:

if (irpSp->Parameters.Create.Options & FILE_OPEN_BY_FILE_ID) {

SF_LOG_PRINT( DFDEBUG_DISPLAY_CREATE_NAMES,
(“\nDfCreate: OPENED fo=%p %08x:%08x %wZ
(FID)”,
irpSp->FileObject,
Irp->IoStatus.Status,
Irp->IoStatus.Information,
&fileObject->FileName) );

} else {

SF_LOG_PRINT( DFDEBUG_DISPLAY_CREATE_NAMES,
(“\nDfCreate: OPENED fo=%p Status=%08x,
Info=%08x %wZ (%s:%d)”,
irpSp->FileObject,
Irp->IoStatus.Status,
Irp->IoStatus.Information,
&fileObject->FileName) );
}

But my understanding is that if there’s a file id there, then
FileName.Buffer holds the address of a 64-bit integer rather than
pointing to a string of WCHARs, so how does %wZ handle this?

Thanks,
Steve


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

Steve,

What version of the IFSKit did you get this version of SFILTER from? I
looked at some of our old versions (from W2K and XP) and none of them do
what the code you are showing does. All of them call a routine called
SfGetFileName which returns back a buffer with a valid name it even for
files opened by ID.

If you have an old kit I highly recommend you get the latest version
because it contains a lot of new stuff including documentation.

Neal Christiansen
Microsoft File System Filter Group Lead
This posting is provided “AS IS” with no warranties, and confers no
Rights

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tony Mason
Sent: Thursday, June 30, 2005 8:22 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] displaying file ids at FileObject->FileName

Since my understanding is that the 16 bit wide character spec is
essentially full, I’d expect it to print whatever values correspond to
those characters in the character set.

Note that in the case where a file is opened by ID, there are four
possible options for the format of the name:

  • a 64 bit file ID;
  • a 128 bit object ID;
  • a leading backslash '' + one of the first two (so this counts as two
    options :wink:

But this doesn’t do anything special here. If you are concerned about
this, you might wish to modify the example to print this as a numeric
rather than as the equivalent 16-bit string.

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 Steve Adams
Sent: Thursday, June 30, 2005 5:16 PM
To: ntfsd redirect
Subject: [ntfsd] displaying file ids at FileObject->FileName

I notice that the sample filter displays a file id at
FileObject->FileName using the same %wZ it uses for a true name:

if (irpSp->Parameters.Create.Options & FILE_OPEN_BY_FILE_ID) {

SF_LOG_PRINT( DFDEBUG_DISPLAY_CREATE_NAMES,
(“\nDfCreate: OPENED fo=%p %08x:%08x %wZ
(FID)”,
irpSp->FileObject,
Irp->IoStatus.Status,
Irp->IoStatus.Information,
&fileObject->FileName) );

} else {

SF_LOG_PRINT( DFDEBUG_DISPLAY_CREATE_NAMES,
(“\nDfCreate: OPENED fo=%p Status=%08x,
Info=%08x %wZ (%s:%d)”,
irpSp->FileObject,
Irp->IoStatus.Status,
Irp->IoStatus.Information,
&fileObject->FileName) );
}

But my understanding is that if there’s a file id there, then
FileName.Buffer holds the address of a 64-bit integer rather than
pointing to a string of WCHARs, so how does %wZ handle this?

Thanks,
Steve


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