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
[SHELL32] Show "size on disk" in file/folder properties #3107
Conversation
Cc @amber8706 🙂 |
Ready to go ? |
Co-authored-by: Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
Co-authored-by: Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
This is a wrong approach to get "size on disk" information about a file. The right way is to use |
Yes but the part of API we'd need is Vista+ only : https://docs.microsoft.com/en-us/windows/win32/api/winbase/ns-winbase-file_allocation_info From a dev perspective, would you recommend to use this even in a NT5.2 compatibility context ? |
You have two options here: use the function from |
Can't GetFileInformationByHandle (not ex) be used too? As you know, Windows 2000/XP/2003 are able to show an estimation of "Show size on disk" even when they don't have this -Ex API. |
Looking at GetFileInformationByHandle here : https://docs.microsoft.com/en-us/windows/win32/api/fileapi/ns-fileapi-by_handle_file_information it seems that only logical size is returned |
Co-authored-by: Adam Stachowicz <saibamenppl@gmail.com>
Co-authored-by: Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
Co-authored-by: Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
Co-authored-by: Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
Would it be possible to merge now that no more comments are open ? |
Now using HeapAlloc/HeapFree rather than fixed size array... and the code now crashes. |
To be rewritten with CString as per discussion with @learn-more |
Reverted to MAX_PATH as discussed with @learn-more in Mattermost. Moving to dynamic buffers everywhere will be a dedicated PR. Current implementation works fine on "C:\ReactOS" (including sub-folders) but does not work properly with "c:\Documents and Settings", raising
Under investigation (where does this damn "?" comes from....) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix the memory leaks, the nit is up to you if you want to change it
Purpose
JIRA issue: CORE-12559
Proposed changes