From: Alex Henrie <alexhenrie24(a)gmail.com> Only the lower 32 bits of the file size are stored in the IDLDATA struct, which means that a separate function call is necessary to get the complete 64-bit file size. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=58058 --- dlls/shell32/shfldr_desktop.c | 20 ++++++++++++++++++++ dlls/shell32/shfldr_fs.c | 16 ++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/dlls/shell32/shfldr_desktop.c b/dlls/shell32/shfldr_desktop.c index 49de36aa741..b99f3ffd18a 100644 --- a/dlls/shell32/shfldr_desktop.c +++ b/dlls/shell32/shfldr_desktop.c @@ -792,6 +792,26 @@ static HRESULT WINAPI ISF_Desktop_fnGetDetailsOf (IShellFolder2 * iface, if (!pidl) return SHELL32_GetColumnDetails(desktop_header, iColumn, psd); + if (desktop_header[iColumn].pid == PID_STG_SIZE && _ILIsValue(pidl) && !_ILIsFolder(pidl)) + { + WCHAR file_path[MAX_PATH]; + size_t file_path_len; + WIN32_FILE_ATTRIBUTE_DATA file_attributes; + + wcscpy(file_path, This->sPathTarget); + wcscat(file_path, L"\\"); + file_path_len = wcslen(file_path); + + if (_ILSimpleGetTextW(pidl, file_path + file_path_len, MAX_PATH - file_path_len) && + GetFileAttributesExW(file_path, GetFileExInfoStandard, &file_attributes)) + { + psd->str.uType = STRRET_CSTR; + StrFormatByteSize64A((LONGLONG)file_attributes.nFileSizeHigh << 32 | file_attributes.nFileSizeLow, + psd->str.cStr, MAX_PATH); + return S_OK; + } + } + return shellfolder_get_file_details( iface, pidl, desktop_header, iColumn, psd ); } diff --git a/dlls/shell32/shfldr_fs.c b/dlls/shell32/shfldr_fs.c index fabd27e984f..fa1d707ddab 100644 --- a/dlls/shell32/shfldr_fs.c +++ b/dlls/shell32/shfldr_fs.c @@ -1035,6 +1035,22 @@ IShellFolder_fnGetDetailsOf (IShellFolder2 * iface, LPCITEMIDLIST pidl, if (!pidl) return SHELL32_GetColumnDetails(GenericSFHeader, iColumn, psd); + if (GenericSFHeader[iColumn].pid == PID_STG_SIZE && _ILIsValue(pidl) && !_ILIsFolder(pidl)) + { + WCHAR file_path[MAX_PATH]; + WIN32_FILE_ATTRIBUTE_DATA file_attributes; + + get_display_name(file_path, This->sPathTarget, pidl, FALSE); + + if (GetFileAttributesExW(file_path, GetFileExInfoStandard, &file_attributes)) + { + psd->str.uType = STRRET_CSTR; + StrFormatByteSize64A((LONGLONG)file_attributes.nFileSizeHigh << 32 | file_attributes.nFileSizeLow, + psd->str.cStr, MAX_PATH); + return S_OK; + } + } + return shellfolder_get_file_details( iface, pidl, GenericSFHeader, iColumn, psd ); } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/7746