http://bugs.winehq.org/show_bug.cgi?id=17759
Summary: CommandLineToArgvW bug with empty lpCmdLine Product: Wine Version: 1.1.17 Platform: PC OS/Version: Linux Status: UNCONFIRMED Severity: major Priority: P3 Component: shell32 AssignedTo: wine-bugs@winehq.org ReportedBy: mb@smartftp.com
CommandLineToArgvW returns the wrong NumArgs (2 instead of 1) when an empty lpCmdLine is passed:
How to reproduce ================ int nNumArgs = 0; LPWSTR *Argv = ::CommandLineToArgvW(L"", &nNumArgs); if(Argv) { ASSERT(nNumArgs == 1);
if(nNumArgs == 2) { // Access violation wprintf(Argv[1]); } }
MSDN Documentation on how to handle empty lpCmdLine =================================================== "If this parameter is an empty string the function returns the path to the current executable file." Reference: http://msdn.microsoft.com/en-us/library/bb776391(VS.85).aspx
Regards, Mat SmartFTP