[Bug 9957] New: incorrect usage of GlobalAlloc in CommandLineToArgvW

wine-bugs at winehq.org wine-bugs at winehq.org
Mon Oct 8 15:36:45 CDT 2007


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 at winehq.org
        ReportedBy: eteran at 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


-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list