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

#918: buffer for selected file paths too small on windows #924

Merged

Conversation

philenius
Copy link
Collaborator

@philenius philenius commented Dec 14, 2021

fixes #918. With this change, it is possible to select at least 2300 files (even files with extra long file paths such as C:\Users\phil\Downloads\abcdefghijklmnopqrstuvxyz0123456789\zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz.txt. Please see commit message for detailed explanation: 7450ae6

fixes #918; the buffer lpstrFile stores the paths and file names of the
selected files. As it turns out, 20 * 260 Bytes isn't enough when a
user wants to select > 256 files. Changed the buffer size to
8192 * 260 Bytes (~2.1 MB) which, depending on the file path, is enough
for picking > 2000 files. 8192 * 260 Bytes should fit at minimum
532,480 UTF16 characters. The memory profiler of Flutter DevTools shows
no memory increase while the file picker dialog is open.
Windows Task Manager shows a memory increase of 1 - 2 MB while the file
picker dialog is opened.
@miguelpruivo miguelpruivo merged commit 32094fd into master Dec 16, 2021
@miguelpruivo miguelpruivo deleted the bug/buffer-for-selected-file-paths-too-small-on-windows branch December 16, 2021 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crashes when a large number of files with long file names are selected using pickFiles() on Windows
2 participants