Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why file name are uppercase when reparse point is used ? #293

Closed
Liryna opened this issue Jul 20, 2016 · 7 comments
Closed

Why file name are uppercase when reparse point is used ? #293

Liryna opened this issue Jul 20, 2016 · 7 comments

Comments

@Liryna
Copy link
Member

Liryna commented Jul 20, 2016

When reparse point is enabled (mount in a empty folder), all request seems to use the short file name.
We should take a look to see if it is the kernel that does not provide the correct name or it is a dokan issue.

> mirror.exe /r C:\Users /l C:\test /d /s
###Create 1312
CreateFile : C:\Users\LIRYNA\DESKTOP\DEBUG
  AccountName: liryna, DomainName: DESKTOP-T9B1IFA
        ShareMode = 0x7
        FILE_SHARE_READ
        FILE_SHARE_WRITE
        FILE_SHARE_DELETE
        AccessMode = 0x80
        FILE_READ_ATTRIBUTES
        FlagsAndAttributes = 0x200000
        FILE_FLAG_OPEN_REPARSE_POINT
        OPEN_EXISTING

CreateFile status = 0 - lastError = 0
###GetFileInfo 1312
GetFileInfo : C:\Users\LIRYNA\DESKTOP\DEBUG
        GetFileInformationByHandle success, file size = 4096

        result =  0
        FileBasicInformation
        DispatchQueryInformation result =  0
###Cleanup 1312
Cleanup: C:\Users\LIRYNA\DESKTOP\DEBUG

###Close 1312
Close: C:\Users\LIRYNA\DESKTOP\DEBUG

###Create 1313
CreateFile : C:\Users\LIRYNA
@taruti
Copy link
Contributor

taruti commented Jul 26, 2016

Have seen the same/similar issue with symlink reparse points pointing to dokan volumes.

@Maxhy
Copy link
Member

Maxhy commented Jul 27, 2016

Short file name (= alternate file name, DOS 8.3...) may be mandatory for few features, symlink, hardlink and reparse points seems to be ones of them.
I believe fsutil 8dot3name query E: (where E: is your dokan drive) returns volume state 0? This means 8dot3 name is enabled. Could you try to change it with fsutil 8dot3name set 2 and then fsutil 8dot3name set E: 1 to disable short name for this volume just to see the system behavior in this case (I'm not able to test it right now sorry).

Short file name is not supported on Dokan today. This should be done here and here.
Then user-mode callback structure should be extended to allow user-mode file system to define this value (this shouldn't be handled by the driver with RtlGenerate8dot3Name). Maybe a new

#define DOKAN_OPTION_SHORTNAME 512 // short name is supported

should also be added. It will be the user-mode driver responsibility to resolve short file name on IRP_MJ_CREATE.

@Liryna
Copy link
Member Author

Liryna commented Jul 27, 2016

This issue seems to be invalid.
Reparse point is not using short name.

I tested with a long file name and the name is not only uppercase but not changed like if this was short names.

//when file name is dfosjdisfvjsdnfbvsdifohbusdibhusdifhbusdfuhbsdfbhsdfihbuoihihdfdfosjdisfvjsdnfbhhhhhhhhvsdifohbusdibhusdifhbusdfuhbsdfbhsdfihbuoihihdfdfosjdisfvjsdnfbvsdifohbusdibhusdifhbusdfuhbsdfbhsdfihbuoihihdfdfosjdisfvjsdnfbvsdifohbusdibh.txt
CreateFile : C:\Users\WIN10-TEST\DESKTOP\DFOSJDISFVJSDNFBVSDIFOHBUSDIBHUSDIFHBUSDFUHBSDFBHSDFIHBUOIHIHDFDFOSJDISFVJSDNFBHHHHHHHHVSDIFOHBUSDIBHUSDIFHBUSDFUHBSDFBHSDFIHBUOIHIHDFDFOSJDISFVJSDNFBVSDIFOHBUSDIBHUSDIFHBUSDFUHBSDFBHSDFIHBUOIHIHDFDFOSJDISFVJSDNFBVSDIFOHBUSDIBH.TXT

Like @Maxhy said, short name are not supported by Dokan currently. I have recreate the issue here: #301

I update this issue as an open question since I am enable to find any information that could show if this is a normal behaviour of windows or a dokan issue.

@jetwhiz

@Liryna Liryna changed the title Short file names are requested when reparse point is used. Why file name are uppercase when reparse point is used ? Jul 27, 2016
@taruti
Copy link
Contributor

taruti commented Jul 28, 2016

@anddyliu2000
Copy link

I meet this problem, too.
I found an article to descript why filename be turned to upper case in reparse point. It is NTFS's fault.
In this post, he shows how to fix it. Hope it can help you.
https://www.osronline.com/showthread.cfm?link=287522

@Rondom
Copy link
Contributor

Rondom commented Jul 5, 2018

I did not verify this, but this is fixed according to the 13 Feb 18 12:27 e-mail by Craig Barkhouse (Microsoft):

For what it's worth, in the upcoming Windows release (1803? not sure what it will be called), NTFS now correctly preserves the case of the unparsed path.

@linyuan0
Copy link
Contributor

linyuan0 commented Jul 6, 2018

@Rondom yes,
I am based on https://www.osronline.com/showthread.cfm?link=287522
To verify, the final verification is successful; a pull requests are submitted. The Fix also shows the changes made based on the information provided by the last person in #293. The link provided is the same as the link you just sent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants