http://bugs.winehq.org/show_bug.cgi?id=9957
Summary: incorrect usage of GlobalAlloc in CommandLineToArgvW Product: Wine Version: unspecified Platform: Other OS/Version: other Status: UNCONFIRMED Severity: enhancement Priority: P2 Component: wine-shell32 AssignedTo: wine-bugs@winehq.org ReportedBy: eteran@alum.rit.edu
There is a minor bug in CommandLineToArgvW in shell32_main.c on line 100 (http://source.winehq.org/source/dlls/shell32/shell32_main.c#L100).
Basically the arguments are reversed. According to the definition of GlobalAlloc, the arguments are
GlobalAlloc(UINT flags, SIZE_T size).
however, on line 100, it is used as follows.
hargv=GlobalAlloc(size, 0)
which is passing a flags of 16 (size is initialized to 16 before this usage) and a size of 0!
Later, the error is masked by the correct usage of GlobalReAlloc which does properly allocate the memory desired.
Should be a very easy bug to correct.
Evan Teran
http://bugs.winehq.org/show_bug.cgi?id=9957
Evan Teran eteran@alum.rit.edu changed:
What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |normal
http://bugs.winehq.org/show_bug.cgi?id=9957
--- Comment #1 from Lei Zhang thestig@google.com 2007-10-17 19:15:53 --- Care to send a patch to wine-patches?
http://bugs.winehq.org/show_bug.cgi?id=9957
--- Comment #2 from Evan Teran eteran@alum.rit.edu 2007-10-18 00:39:55 --- Created an attachment (id=8639) --> (http://bugs.winehq.org/attachment.cgi?id=8639) param switch fix
patch as requested to fix the parameter mix up.
http://bugs.winehq.org/show_bug.cgi?id=9957
--- Comment #3 from James Hawkins truiken@gmail.com 2007-10-18 01:07:39 --- Please send all patches to wine-patches@winehq.org. Patches bit rot in bugzilla.
http://bugs.winehq.org/show_bug.cgi?id=9957
--- Comment #4 from Evan Teran eteran@alum.rit.edu 2007-10-18 01:13:14 --- No problem, email sent :)
http://bugs.winehq.org/show_bug.cgi?id=9957
Juan Lang juan_lang@yahoo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |FIXED
--- Comment #5 from Juan Lang juan_lang@yahoo.com 2007-10-18 09:55:00 --- And it's been committed. Thanks for the fix!
http://bugs.winehq.org/show_bug.cgi?id=9957
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #6 from Dan Kegel dank@kegel.com 2008-01-28 05:43:38 --- Closing all RESOLVED FIXED bugs older than four weeks.