https://bugs.winehq.org/show_bug.cgi?id=51833
Bug ID: 51833 Summary: GetModuleFileNameW no longer works with large buffers Product: Wine Version: unspecified Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: kernel32 Assignee: wine-bugs@winehq.org Reporter: wine@2ar.nl Regression SHA1: 43d14fd808bb965762bb6c76027bbe26ba936f82 Distribution: ---
The recent change 'Implement kernelbase.GetModuleFileNameW using ntdll.LdrGetDllFullName' (bug 49344) broke passing large buffers (>=32768 characters) to GetModuleFileNameW, as done by cygwin.
Possible fix:
name.MaximumLength = (size < 0xffff / sizeof(WCHAR) ? size : 0xffff / sizeof(WCHAR)) * sizeof(WCHAR);
Comment from Nikolay Sivov: we could probably min() it in ints, to avoid this 16bit overflow.
https://bugs.winehq.org/show_bug.cgi?id=51833
Alex Henrie alexhenrie24@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.winehq.org/sho | |w_bug.cgi?id=49344
https://bugs.winehq.org/show_bug.cgi?id=51833
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |regression
https://bugs.winehq.org/show_bug.cgi?id=51833
Paul Gofman pgofman@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |pgofman@codeweavers.com
--- Comment #1 from Paul Gofman pgofman@codeweavers.com --- Thanks for spotting this. I've sent a patch: https://source.winehq.org/patches/data/216081 .
https://bugs.winehq.org/show_bug.cgi?id=51833
--- Comment #2 from Paul Gofman pgofman@codeweavers.com --- Should be fixed by 7c523f48677abb5d8cf7d2b2f1cff919e57c8e99
https://bugs.winehq.org/show_bug.cgi?id=51833
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Fixed by SHA1| |7c523f48677abb5d8cf7d2b2f1c | |ff919e57c8e99 Resolution|--- |FIXED
--- Comment #3 from Alexandre Julliard julliard@winehq.org --- Assuming fixed.
https://bugs.winehq.org/show_bug.cgi?id=51833
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #4 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 7.0-rc1.