Uppercase filenames in filter driver

Hi,
I currently have a file system filter driver. It
works fine except for 1 behaviour I am not able to
explain. At times the path is all in upper-case. I
noticed that this happens even in some other file
monitoring utilities. Could someone throw some light
on what these file accesses are and is there any way
to distinguish them?

I know Windows is not case-sensitive, but for my
purposes this will be an issue.

Thanks


Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/

The file name you see is the one applications use to open the file. It can be
short, long name; upper or lower case. It is all the same to the file system,
virtually. The only difference is the POSIX-semantics file names, which ARE case
sensitive. Explorer, I think, won’t handle these correctly, for copy and such
purposes, but last I tried this was back on NT 4, some 4+ years ago.
There is nothing special about upper/lower case, aside from that. Why any
application would change the case, I have no idea.

Krishna Monian wrote:

Hi,
I currently have a file system filter driver. It
works fine except for 1 behaviour I am not able to
explain. At times the path is all in upper-case. I
noticed that this happens even in some other file
monitoring utilities. Could someone throw some light
on what these file accesses are and is there any way
to distinguish them?

I know Windows is not case-sensitive, but for my
purposes this will be an issue.

Thanks


Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/


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

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


Kind regards, Dejan M. MVP for DDK
http://www.alfasp.com E-mail: xxxxx@alfasp.com
Alfa Transparent File Encryptor - Transparent file encryption services.
Alfa File Protector - File protection and hiding library for Win32 developers.
Alfa File Monitor - File monitoring library for Win32 developers.

Is there any way to get the case sensitive path given
these upper case paths?

— Dejan Maksimovic wrote:
>
> The file name you see is the one applications
> use to open the file. It can be
> short, long name; upper or lower case. It is all the
> same to the file system,
> virtually. The only difference is the
> POSIX-semantics file names, which ARE case
> sensitive. Explorer, I think, won’t handle these
> correctly, for copy and such
> purposes, but last I tried this was back on NT 4,
> some 4+ years ago.
> There is nothing special about upper/lower case,
> aside from that. Why any
> application would change the case, I have no idea.
>
> Krishna Monian wrote:
>
> > Hi,
> > I currently have a file system filter driver.
> It
> > works fine except for 1 behaviour I am not able to
> > explain. At times the path is all in upper-case. I
> > noticed that this happens even in some other file
> > monitoring utilities. Could someone throw some
> light
> > on what these file accesses are and is there any
> way
> > to distinguish them?
> >
> > I know Windows is not case-sensitive, but for my
> > purposes this will be an issue.
> >
> > Thanks
> >
> >
> >
> >
> > Do you Yahoo!?
> > Friends. Fun. Try the all-new Yahoo! Messenger.
> > http://messenger.yahoo.com/
> >
> > —
> > Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
> >
> > You are currently subscribed to ntfsd as:
> xxxxx@alfasp.com
> > To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>
> –
> Kind regards, Dejan M. MVP for DDK
> http://www.alfasp.com E-mail: xxxxx@alfasp.com
> Alfa Transparent File Encryptor - Transparent file
> encryption services.
> Alfa File Protector - File protection and hiding
> library for Win32 developers.
> Alfa File Monitor - File monitoring library for
> Win32 developers.
>
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as:
> xxxxx@yahoo.com
> To unsubscribe send a blank email to
xxxxx@lists.osr.com


Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/

Query the filesystem.

— Krishna Monian wrote:
> Is there any way to get the case sensitive path
> given
> these upper case paths?
>
>
> — Dejan Maksimovic wrote:
> >
> > The file name you see is the one applications
> > use to open the file. It can be
> > short, long name; upper or lower case. It is all
> the
> > same to the file system,
> > virtually. The only difference is the
> > POSIX-semantics file names, which ARE case
> > sensitive. Explorer, I think, won’t handle these
> > correctly, for copy and such
> > purposes, but last I tried this was back on NT 4,
> > some 4+ years ago.
> > There is nothing special about upper/lower
> case,
> > aside from that. Why any
> > application would change the case, I have no idea.
> >
> > Krishna Monian wrote:
> >
> > > Hi,
> > > I currently have a file system filter driver.
> > It
> > > works fine except for 1 behaviour I am not able
> to
> > > explain. At times the path is all in upper-case.
> I
> > > noticed that this happens even in some other
> file
> > > monitoring utilities. Could someone throw some
> > light
> > > on what these file accesses are and is there any
> > way
> > > to distinguish them?
> > >
> > > I know Windows is not case-sensitive, but for my
> > > purposes this will be an issue.
> > >
> > > Thanks
> > >
> > >
> > >
> > >
> > > Do you Yahoo!?
> > > Friends. Fun. Try the all-new Yahoo!
> Messenger.
> > > http://messenger.yahoo.com/
> > >
> > > —
> > > Questions? First check the IFS FAQ at
> > https://www.osronline.com/article.cfm?id=17
> > >
> > > You are currently subscribed to ntfsd as:
> > xxxxx@alfasp.com
> > > To unsubscribe send a blank email to
> > xxxxx@lists.osr.com
> >
> > –
> > Kind regards, Dejan M. MVP for DDK
> > http://www.alfasp.com E-mail: xxxxx@alfasp.com
> > Alfa Transparent File Encryptor - Transparent file
> > encryption services.
> > Alfa File Protector - File protection and hiding
> > library for Win32 developers.
> > Alfa File Monitor - File monitoring library for
> > Win32 developers.
> >
> >
> >
> > —
> > Questions? First check the IFS FAQ at
> > https://www.osronline.com/article.cfm?id=17
> >
> > You are currently subscribed to ntfsd as:
> > xxxxx@yahoo.com
> > To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>
>
>
>
>
>

> Do you Yahoo!?
> Friends. Fun. Try the all-new Yahoo! Messenger.
> http://messenger.yahoo.com/
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as:
> xxxxx@yahoo.com
> To unsubscribe send a blank email to
xxxxx@lists.osr.com

__________________________________
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/

Is there any routine that is predefined in the SDK/DDK
that can query the filesystem for the case-sensitive
filename in either user/kernel mode?

— Randy Cook wrote:
> Query the filesystem.
>
> — Krishna Monian wrote:
> > Is there any way to get the case sensitive path
> > given
> > these upper case paths?
> >
> >
> > — Dejan Maksimovic wrote:
> > >
> > > The file name you see is the one
> applications
> > > use to open the file. It can be
> > > short, long name; upper or lower case. It is all
> > the
> > > same to the file system,
> > > virtually. The only difference is the
> > > POSIX-semantics file names, which ARE case
> > > sensitive. Explorer, I think, won’t handle these
> > > correctly, for copy and such
> > > purposes, but last I tried this was back on NT
> 4,
> > > some 4+ years ago.
> > > There is nothing special about upper/lower
> > case,
> > > aside from that. Why any
> > > application would change the case, I have no
> idea.
> > >
> > > Krishna Monian wrote:
> > >
> > > > Hi,
> > > > I currently have a file system filter
> driver.
> > > It
> > > > works fine except for 1 behaviour I am not
> able
> > to
> > > > explain. At times the path is all in
> upper-case.
> > I
> > > > noticed that this happens even in some other
> > file
> > > > monitoring utilities. Could someone throw some
> > > light
> > > > on what these file accesses are and is there
> any
> > > way
> > > > to distinguish them?
> > > >
> > > > I know Windows is not case-sensitive, but for
> my
> > > > purposes this will be an issue.
> > > >
> > > > Thanks
> > > >
> > > >
> > > >
> > > >
> > > > Do you Yahoo!?
> > > > Friends. Fun. Try the all-new Yahoo!
> > Messenger.
> > > > http://messenger.yahoo.com/
> > > >
> > > > —
> > > > Questions? First check the IFS FAQ at
> > > https://www.osronline.com/article.cfm?id=17
> > > >
> > > > You are currently subscribed to ntfsd as:
> > > xxxxx@alfasp.com
> > > > To unsubscribe send a blank email to
> > > xxxxx@lists.osr.com
> > >
> > > –
> > > Kind regards, Dejan M. MVP for DDK
> > > http://www.alfasp.com E-mail: xxxxx@alfasp.com
> > > Alfa Transparent File Encryptor - Transparent
> file
> > > encryption services.
> > > Alfa File Protector - File protection and hiding
> > > library for Win32 developers.
> > > Alfa File Monitor - File monitoring library for
> > > Win32 developers.
> > >
> > >
> > >
> > > —
> > > Questions? First check the IFS FAQ at
> > > https://www.osronline.com/article.cfm?id=17
> > >
> > > You are currently subscribed to ntfsd as:
> > > xxxxx@yahoo.com
> > > To unsubscribe send a blank email to
> > xxxxx@lists.osr.com
> >
> >
> >
> >
> >
> >

> > Do you Yahoo!?
> > Friends. Fun. Try the all-new Yahoo! Messenger.
> > http://messenger.yahoo.com/
> >
> > —
> > Questions? First check the IFS FAQ at
> > https://www.osronline.com/article.cfm?id=17
> >
> > You are currently subscribed to ntfsd as:
> > xxxxx@yahoo.com
> > To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>
>
>
>
>
>
> Do you Yahoo!?
> Friends. Fun. Try the all-new Yahoo! Messenger.
> http://messenger.yahoo.com/
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as:
> xxxxx@yahoo.com
> To unsubscribe send a blank email to
xxxxx@lists.osr.com


Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/

Traverse the path, finding each component’s correct name.

Krishna Monian wrote:

Is there any way to get the case sensitive path given these upper case paths?


Kind regards, Dejan M. MVP for DDK
http://www.alfasp.com E-mail: xxxxx@alfasp.com
Alfa Transparent File Encryptor - Transparent file encryption services.
Alfa File Protector - File protection and hiding library for Win32 developers.
Alfa File Monitor - File monitoring library for Win32 developers.

Note that FAT32 and NTFS happen to preserve case but I
don’t know of any requirement that they do this,
except for the POSIX stuff.

In kernel space you can use ZwQueryDirectoryFile or
roll your own IRP (it is one of the easier ones to
do).

In user mode use the WIN32 API (e.g.
FindFirstFile…). There is also probably a
NtQueryDirectoryFile, but that would of course be
undocumented.

Also, if you are using the new filter manager stuff,
there is a much easier way to get names. I don’t know
if the names they return show the case the file system
has. I doubt that they do because they don’t have to
query the fs for long names in all cases.

— Krishna Monian wrote:
> Is there any routine that is predefined in the
> SDK/DDK
> that can query the filesystem for the case-sensitive
> filename in either user/kernel mode?
>
>
> — Randy Cook wrote:
> > Query the filesystem.
> >
> > — Krishna Monian wrote:
> > > Is there any way to get the case sensitive path
> > > given
> > > these upper case paths?
> > >
> > >
> > > — Dejan Maksimovic wrote:
> > > >
> > > > The file name you see is the one
> > applications
> > > > use to open the file. It can be
> > > > short, long name; upper or lower case. It is
> all
> > > the
> > > > same to the file system,
> > > > virtually. The only difference is the
> > > > POSIX-semantics file names, which ARE case
> > > > sensitive. Explorer, I think, won’t handle
> these
> > > > correctly, for copy and such
> > > > purposes, but last I tried this was back on NT
> > 4,
> > > > some 4+ years ago.
> > > > There is nothing special about upper/lower
> > > case,
> > > > aside from that. Why any
> > > > application would change the case, I have no
> > idea.
> > > >
> > > > Krishna Monian wrote:
> > > >
> > > > > Hi,
> > > > > I currently have a file system filter
> > driver.
> > > > It
> > > > > works fine except for 1 behaviour I am not
> > able
> > > to
> > > > > explain. At times the path is all in
> > upper-case.
> > > I
> > > > > noticed that this happens even in some other
> > > file
> > > > > monitoring utilities. Could someone throw
> some
> > > > light
> > > > > on what these file accesses are and is there
> > any
> > > > way
> > > > > to distinguish them?
> > > > >
> > > > > I know Windows is not case-sensitive, but
> for
> > my
> > > > > purposes this will be an issue.
> > > > >
> > > > > Thanks
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > Do you Yahoo!?
> > > > > Friends. Fun. Try the all-new Yahoo!
> > > Messenger.
> > > > > http://messenger.yahoo.com/
> > > > >
> > > > > —
> > > > > Questions? First check the IFS FAQ at
> > > > https://www.osronline.com/article.cfm?id=17
> > > > >
> > > > > You are currently subscribed to ntfsd as:
> > > > xxxxx@alfasp.com
> > > > > To unsubscribe send a blank email to
> > > > xxxxx@lists.osr.com
> > > >
> > > > –
> > > > Kind regards, Dejan M. MVP for DDK
> > > > http://www.alfasp.com E-mail: xxxxx@alfasp.com
> > > > Alfa Transparent File Encryptor - Transparent
> > file
> > > > encryption services.
> > > > Alfa File Protector - File protection and
> hiding
> > > > library for Win32 developers.
> > > > Alfa File Monitor - File monitoring library
> for
> > > > Win32 developers.
> > > >
> > > >
> > > >
> > > > —
> > > > Questions? First check the IFS FAQ at
> > > > https://www.osronline.com/article.cfm?id=17
> > > >
> > > > You are currently subscribed to ntfsd as:
> > > > xxxxx@yahoo.com
> > > > To unsubscribe send a blank email to
> > > xxxxx@lists.osr.com
> > >
> > >
> > >
> > >
> > >
> > >

> > > Do you Yahoo!?
> > > Friends. Fun. Try the all-new Yahoo!
> Messenger.
> > > http://messenger.yahoo.com/
> > >
> > > —
> > > Questions? First check the IFS FAQ at
> > > https://www.osronline.com/article.cfm?id=17
> > >
> > > You are currently subscribed to ntfsd as:
> > > xxxxx@yahoo.com
> > > To unsubscribe send a blank email to
> > xxxxx@lists.osr.com
> >
> >
> >
> >
> >
> >
> > Do you Yahoo!?
> > Friends. Fun. Try the all-new Yahoo! Messenger.
> > http://messenger.yahoo.com/
> >
> > —
> > Questions? First check the IFS FAQ at
> > https://www.osronline.com/article.cfm?id=17
> >
> > You are currently subscribed to ntfsd as:
> > xxxxx@yahoo.com
> > To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>
>
>
>
>
>

> Do you Yahoo!?
> Friends. Fun. Try the all-new Yahoo! Messenger.
> http://messenger.yahoo.com/
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as:
> xxxxx@yahoo.com
> To unsubscribe send a blank email to
xxxxx@lists.osr.com

__________________________________
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/

> In user mode use the WIN32 API (e.g.

FindFirstFile…). There is also probably a
NtQueryDirectoryFile, but that would of course be
undocumented.

Yes, FindFirstFile is based on NtQueryDirectoryFile, but note: the handle from
FindFirstFile is not a kernel file handle, it is a pointer to some structure
which contains a kernel handle and a buffer around 64KB in size, the buffer is
passed to NtQueryDirectoryFile.

You must use FindClose to close this handle, not CloseHandle.

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