AW: Problem with special characters in a filename

No, I am not querying the underlaying filesystem because that won’t work *before* the file object has been created, right? I am using “CurrentStackLocation->FileObject->FileName.Buffer”. This field should contain the filename. But it does not in that special case. I ask myself: how does the filesystem-driver know which file to open?

Thanks again.

-----Urspr?ngliche Nachricht-----
Von: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]Im Auftrag von Ladislav Zezula
Gesendet: Donnerstag, 22. April 2004 07:44
An: Windows File Systems Devs Interest List
Betreff: Re: [ntfsd] Problem with special characters in a filename

Imagine a file: “???.txt”
In this case the system internally provides a filename “???.txt”.

How “provides” ? Do you use any FS call to query the name
or “???.txt” is the name which your filter receives ?

L.


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

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


Virus checked by G DATA AntiVirusKit MailGateway
Version: AVK 14.0.785 from 22.04.2004
Virus news: www.antiviruslab.com

Sorry to ask a stupid question but are you *certain* the ‘filename’ really
does consist of all unicode ‘?’ characters before the unicode ‘.’ character
or could this just be how the unicode characers have been rendered?

wrote in message news:xxxxx@ntfsd…
Hi.

I do have a working filter driver. Environment is WinXP (English version).

I know I usually shouldn’t do this, but I am trying to investigate the name
of a file during IRP_MJ_CREATE before the file got opened. That works
generally. But not for files with special characters.

Imagine a file: “ýïèäåìèé.txt”

In this case the system internally provides a filename “???.txt”. Wich
is of course an invalid filename. Any hint would be appreciated.

Thank you
Frank

Good question! But I verified this: the *unicode* string contains e.g.:

“\TMP????.txt”

This is what I’ve done:

  1. goto a foreign web-site (e.g. with native russian language)
  2. copy some characters
  3. rename a file with those characters
  4. dump unicode string to debugger

Debugger output of “CurrentStackLocation->FileObject->FileName.Buffer” is “\TMP????.txt”
What am I doing wrong?

-----Urspr?ngliche Nachricht-----
Von: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]Im Auftrag von Lyndon J Clarke
Gesendet: Donnerstag, 22. April 2004 10:17
An: Windows File Systems Devs Interest List
Betreff: Re:[ntfsd] Problem with special characters in a filename

Sorry to ask a stupid question but are you *certain* the ‘filename’ really
does consist of all unicode ‘?’ characters before the unicode ‘.’ character
or could this just be how the unicode characers have been rendered?

wrote in message news:xxxxx@ntfsd…
Hi.

I do have a working filter driver. Environment is WinXP (English version).

I know I usually shouldn’t do this, but I am trying to investigate the name
of a file during IRP_MJ_CREATE before the file got opened. That works
generally. But not for files with special characters.

Imagine a file: “???.txt”

In this case the system internally provides a filename “???.txt”. Wich
is of course an invalid filename. Any hint would be appreciated.

Thank you
Frank


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

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

____________
Virus checked by G DATA AntiVirusKit MailGateway
Version: AVK 14.0.785 from 22.04.2004
Virus news: www.antiviruslab.com

I guess that you use an application which uses ANSI WIN32 api
(like CreateFileA or MoveFileA). I think if such API
receives characters that does not belong to the character set
which has been chosen in the control panel, it will corrupt the name
Try to write a very short testprogram, which will open
or rename the file, using UNICODE versions of API.

L.

Do the russian characters render as question mark characters when viewed in
the dump to debugger that is the question.

perhaps try …

if (UnicodeString.Buffer[5] == L’?')
DbgPrint(“Oh Oh!\n”);

???

wrote in message news:xxxxx@ntfsd…
Good question! But I verified this: the unicode string contains e.g.:

“\TMP????.txt”

This is what I’ve done:
1. goto a foreign web-site (e.g. with native russian language)
2. copy some characters
3. rename a file with those characters
4. dump unicode string to debugger

Debugger output of “CurrentStackLocation->FileObject->FileName.Buffer” is
“\TMP????.txt”
What am I doing wrong?

-----Ursprüngliche Nachricht-----
Von: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]Im Auftrag von Lyndon J Clarke
Gesendet: Donnerstag, 22. April 2004 10:17
An: Windows File Systems Devs Interest List
Betreff: Re:[ntfsd] Problem with special characters in a filename

Sorry to ask a stupid question but are you certain the ‘filename’ really
does consist of all unicode ‘?’ characters before the unicode ‘.’ character
or could this just be how the unicode characers have been rendered?

wrote in message news:xxxxx@ntfsd…
Hi.

I do have a working filter driver. Environment is WinXP (English version).

I know I usually shouldn’t do this, but I am trying to investigate the name
of a file during IRP_MJ_CREATE before the file got opened. That works
generally. But not for files with special characters.

Imagine a file: “ýïèäåìèé.txt”

In this case the system internally provides a filename “???.txt”. Wich
is of course an invalid filename. Any hint would be appreciated.

Thank you
Frank


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

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

____________
Virus checked by G DATA AntiVirusKit MailGateway
Version: AVK 14.0.785 from 22.04.2004
Virus news: www.antiviruslab.com

You’re simply confused with the output on the screen :slight_smile: I can speculate why (like language’s code page is not available or debugger is an ASCII, not a Unicode app, or 1000 other reasons) but file_name for sure can’t be ???.txt. Simply because ‘?’ is illegal character for file name and FS would never let you create that name. I recall seeing these “???” names in W2K Windows Explorer (or/and was it Word 2000?) but it was just because the app itself was unable to display names correctly. I think, if you do “dir” from the command line you would see correct file name. Or, if you dump FileName buffer’s memory you will see that name, in fact, is anything but “???”.

-----Original Message-----
From: xxxxx@gdata.de [mailto:xxxxx@gdata.de]
Sent: Thursday, April 22, 2004 1:53 AM
To: Windows File Systems Devs Interest List
Subject: AW: [ntfsd] Problem with special characters in a filename

Good question! But I verified this: the *unicode* string contains e.g.:

“\TMP????.txt”

This is what I’ve done:

  1. goto a foreign web-site (e.g. with native russian language)
  2. copy some characters
  3. rename a file with those characters
  4. dump unicode string to debugger

Debugger output of “CurrentStackLocation->FileObject->FileName.Buffer” is “\TMP????.txt”
What am I doing wrong?

-----Urspr?ngliche Nachricht-----
Von: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]Im Auftrag von Lyndon J Clarke
Gesendet: Donnerstag, 22. April 2004 10:17
An: Windows File Systems Devs Interest List
Betreff: Re:[ntfsd] Problem with special characters in a filename

Sorry to ask a stupid question but are you *certain* the ‘filename’ really
does consist of all unicode ‘?’ characters before the unicode ‘.’ character
or could this just be how the unicode characers have been rendered?

wrote in message news:xxxxx@ntfsd…
Hi.

I do have a working filter driver. Environment is WinXP (English version).

I know I usually shouldn’t do this, but I am trying to investigate the name
of a file during IRP_MJ_CREATE before the file got opened. That works
generally. But not for files with special characters.

Imagine a file: “???.txt”

In this case the system internally provides a filename “???.txt”. Wich
is of course an invalid filename. Any hint would be appreciated.

Thank you
Frank


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

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

____________
Virus checked by G DATA AntiVirusKit MailGateway
Version: AVK 14.0.785 from 22.04.2004
Virus news: www.antiviruslab.com


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

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

They are rendered this way in emails (Outlook Express) sometimes, when the
encoding in the message header is too lame.

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

----- Original Message -----
From: “Lyndon J Clarke”
Newsgroups: ntfsd
To: “Windows File Systems Devs Interest List”
Sent: Thursday, April 22, 2004 6:11 PM
Subject: Re:[ntfsd] Problem with special characters in a filename

> Do the russian characters render as question mark characters when viewed in
> the dump to debugger that is the question.
>
> perhaps try …
>
> if (UnicodeString.Buffer[5] == L’?')
> DbgPrint(“Oh Oh!\n”);
>
> ???
>
> wrote in message news:xxxxx@ntfsd…
> Good question! But I verified this: the unicode string contains e.g.:
>
> “\TMP????.txt”
>
> This is what I’ve done:
> 1. goto a foreign web-site (e.g. with native russian language)
> 2. copy some characters
> 3. rename a file with those characters
> 4. dump unicode string to debugger
>
> Debugger output of “CurrentStackLocation->FileObject->FileName.Buffer” is
> “\TMP????.txt”
> What am I doing wrong?
>
> -----Urspr?ngliche Nachricht-----
> Von: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]Im Auftrag von Lyndon J Clarke
> Gesendet: Donnerstag, 22. April 2004 10:17
> An: Windows File Systems Devs Interest List
> Betreff: Re:[ntfsd] Problem with special characters in a filename
>
>
> Sorry to ask a stupid question but are you certain the ‘filename’ really
> does consist of all unicode ‘?’ characters before the unicode ‘.’ character
> or could this just be how the unicode characers have been rendered?
>
> wrote in message news:xxxxx@ntfsd…
> Hi.
>
> I do have a working filter driver. Environment is WinXP (English version).
>
>
> I know I usually shouldn’t do this, but I am trying to investigate the name
> of a file during IRP_MJ_CREATE before the file got opened. That works
> generally. But not for files with special characters.
>
> Imagine a file: “???.txt”
>
> In this case the system internally provides a filename “???.txt”. Wich
> is of course an invalid filename. Any hint would be appreciated.
>
> Thank you
> Frank
>
>
>
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@gdata.de
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> ____________
> Virus checked by G DATA AntiVirusKit MailGateway
> Version: AVK 14.0.785 from 22.04.2004
> Virus news: www.antiviruslab.com
>
>
>
>
> —
> Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com

Obviously, all I have to do: Keep unicode consistently…in all layers of my software. Then it works.

Thanks, everybody!

----- Original Message -----
From: “Lyndon J Clarke”
Newsgroups: ntfsd
To: “Windows File Systems Devs Interest List”
Sent: Thursday, April 22, 2004 6:11 PM
Subject: Re:[ntfsd] Problem with special characters in a filename

> Do the russian characters render as question mark characters when viewed in
> the dump to debugger that is the question.
>
> perhaps try …
>
> if (UnicodeString.Buffer[5] == L’?')
> DbgPrint(“Oh Oh!\n”);
>
> ???
>
> wrote in message news:xxxxx@ntfsd…
> Good question! But I verified this: the unicode string contains e.g.:
>
> “\TMP????.txt”
>
> This is what I’ve done:
> 1. goto a foreign web-site (e.g. with native russian language)
> 2. copy some characters
> 3. rename a file with those characters
> 4. dump unicode string to debugger
>
> Debugger output of “CurrentStackLocation->FileObject->FileName.Buffer” is
> “\TMP????.txt”
> What am I doing wrong?
>
> -----Urspr?ngliche Nachricht-----
> Von: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]Im Auftrag von Lyndon J Clarke
> Gesendet: Donnerstag, 22. April 2004 10:17
> An: Windows File Systems Devs Interest List
> Betreff: Re:[ntfsd] Problem with special characters in a filename
>
>
> Sorry to ask a stupid question but are you certain the ‘filename’ really
> does consist of all unicode ‘?’ characters before the unicode ‘.’ character
> or could this just be how the unicode characers have been rendered?
>
> wrote in message news:xxxxx@ntfsd…
> Hi.
>
> I do have a working filter driver. Environment is WinXP (English version).
>
>
> I know I usually shouldn’t do this, but I am trying to investigate the name
> of a file during IRP_MJ_CREATE before the file got opened. That works
> generally. But not for files with special characters.
>
> Imagine a file: “???.txt”
>
> In this case the system internally provides a filename “???.txt”. Wich
> is of course an invalid filename. Any hint would be appreciated.
>
> Thank you
> Frank
>
>
>
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@gdata.de
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
> Virus checked by G DATA AntiVirusKit MailGateway
> Version: AVK 14.0.785 from 22.04.2004
> Virus news: www.antiviruslab.com
>
>
>
>
> —
> Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.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: xxxxx@gdata.de
To unsubscribe send a blank email to xxxxx@lists.osr.com


Virus checked by G DATA AntiVirusKit MailGateway
Version: AVK 14.0.792 from 23.04.2004
Virus news: www.antiviruslab.com