Hello,
In an effort to get myself acquainted with the code I searched for some bugs I might be able to solve in Bugzilla. I found this one:
https://bugs.winehq.org/show_bug.cgi?id=32079
Basically it says that an open file dialog in for example notepad or notepad++ doesn't show hidden files when the "Show hidden files" option is set in winecfg.
I have traced this back to the fact that the ShowDotFiles option is only checked in the NT functions in ntdll, but notepad (and notepad++) use the comdlg32 open dialog which does not use those NT functions but the shell32 ones.
It seems to me that the comdlg32 open dialog should check if ShowDotFiles is active and if so, to pass the SHCONTF_INCLUDEHIDDEN flag to the shell32 objects. But I might (probably?) be wrong.
Can someone verify that this is the way to go before I start writing a patch?
-- Met vriendelijke groeten, Best regards,
Mathy Vanvoorden
I have traced this back to the fact that the ShowDotFiles option is only checked in the NT functions in ntdll, but notepad (and notepad++) use the comdlg32 open dialog which does not use those NT functions but the shell32 ones.
It seems to me that the comdlg32 open dialog should check if ShowDotFiles is active and if so, to pass the SHCONTF_INCLUDEHIDDEN flag to the shell32 objects. But I might (probably?) be wrong.
I think that shell32 in shfldr_unixfs.c should check this setting instead. Since it's skipping ntdll and using the Unix file APIs directly, it should report the same thing to applications that ntdll does, namely that dotfiles are not hidden files.
I think that shell32 in shfldr_unixfs.c should check this setting instead. Since it's skipping ntdll and using the Unix file APIs directly, it should report the same thing to applications that ntdll does, namely that dotfiles are not hidden files.
I have been looking at this just now and would like some more advice. In ntdll a number of things are done:
* The registry key is only read once (I presume for performance reasons) * The DIR_is_hidden_file is called for every file * Folders like /dev, /proc, wine config, ... are always hidden
It seems strange to me to reimplement all this logic and I figure it is desired to have the same behavior in both components so I would like to abstract it to a common base, however:
* What is the best place to do this? To me somewhere in the libs seemed logical but I noticed that nowhere in there registry keys are being read so am I wrong thinking this is undesired behavior there? Is there a dll I could put this common code? * ntdll and shell32 use different functions to access registry keys, would it be a problem if the common code would only use the RegOpenKey functions?
br, Mathy
I don't know why shell32 does this at all, rather than going through kernel32/ntdll like the rest of Wine.
2016-03-29 17:49 GMT+02:00 Vincent Povirk madewokherd@gmail.com:
I don't know why shell32 does this at all, rather than going through kernel32/ntdll like the rest of Wine.
My best guess is that shell32 existed before ntdll?
So should I rewrite it to use ntdll then?
Anyone else that can comment on this?
Mathy
Mathy Vanvoorden mathy@vanvoorden.be writes:
2016-03-29 17:49 GMT+02:00 Vincent Povirk madewokherd@gmail.com:
I don't know why shell32 does this at all, rather than going through kernel32/ntdll like the rest of Wine.
My best guess is that shell32 existed before ntdll?
So should I rewrite it to use ntdll then?
Anyone else that can comment on this?
The goal of the shell Unix folder is to show a view of the filesystem as you would see it in a native Unix app, and it's using direct Unix calls in order to do that. It allows showing symlinks, device files, etc. even when we have to hide them in ntdll to avoid breaking apps. So I'm not sure that replicating ntdll behavior's would be the right thing here.
2016-03-30 4:50 GMT+02:00 Alexandre Julliard julliard@winehq.org:
The goal of the shell Unix folder is to show a view of the filesystem as you would see it in a native Unix app, and it's using direct Unix calls in order to do that. It allows showing symlinks, device files, etc. even when we have to hide them in ntdll to avoid breaking apps. So I'm not sure that replicating ntdll behavior's would be the right thing here.
So by that reasoning it would be better then to in shell32 implement a 'simpler' version: show dotted files when the option is activated, but do not hide stuff like /dev, /proc and WINEPREFIX (since they are native to Unix)?
Mathy Vanvoorden mathy@vanvoorden.be writes:
So by that reasoning it would be better then to in shell32 implement a 'simpler' version: show dotted files when the option is activated, but do not hide stuff like /dev, /proc and WINEPREFIX (since they are native to Unix)?
That's probably better, yes.