http://bugs.winehq.org/show_bug.cgi?id=7663
------- Additional Comments From dmitry@codeweavers.com 2007-17-03 22:51 ------- You should not use malloc in Wine, wcslen and others won't work properly in Wine. Use Win32 APIs like HeapAlloc and lstrlenW instead.
Also it looks like your code won't work if there are non-ascii characters on the command line.