Integrating with Everything to add folder sizes to Explorer

Plug-in and third party software discussion.
m417z
Posts: 23
Joined: Wed Nov 06, 2024 10:53 pm

Re: Integrating with Everything to add folder sizes to Explorer

Post by m417z »

Kilmatead wrote: Tue Dec 17, 2024 9:56 pm It's a poor-man's GetReparseTarget since it fails for any paths which may be temporarily unavailable (detached drive, etc), and can't provide the reparse buffer contents (the true path) to compensate. Though as that doesn't tend to much matter for non-power-users, it has potential.
I think it's fine, it will just result in a lack of size in this case, which makes sense if the drive is detached. I mean, what would I do with a path to a detached drive anyway?

Previously I thought that all GetReparseTarget/GetFinalPathNameByHandle does is resolving a single path, as long as the full path ends with a symbolic link. In my solution, there's no path traversal at all, and I can't think of a reason it can make things worse (aside from the minor pessimization I mentioned).
Kilmatead
Posts: 20
Joined: Thu Nov 07, 2024 1:22 pm

Re: Integrating with Everything to add folder sizes to Explorer

Post by Kilmatead »

m417z wrote: Tue Dec 17, 2024 10:03 pm In my solution, there's no path traversal at all...
Yeah, that part's the real bonus. Interestingly enough the WInAPI entry notes for SMB it walks the paths for you anyway...
The Server Message Block (SMB) Protocol does not support queries for normalized paths. Consequently, when you call this function passing the handle of a file opened using SMB, and with the FILE_NAME_NORMALIZED flag, the function splits the path into its components and tries to query for the normalized name of each of those components in turn. If the user lacks access permission to any one of those components, then the function call fails with ERROR_ACCESS_DENIED.
Not particularly important, but interesting nonetheless.
Post Reply