start.exe: Handle the process title argument

Dmitry Timoshkov dmitry at codeweavers.com
Sun Jan 27 21:58:12 CST 2008


"Alexander Nicolaysen Sørnes" <alex at thehandofagony.com> wrote:

> +           NOTE: This will only work when run from Wine's cmd, but that's ok as start is a builtin
> +                 shell command on NT */

What's the purpose of the comment above?

> +        if(argc > 1 && (vi.dwMajorVersion >= 5 || (vi.dwMajorVersion == 4 && vi.dwPlatformId == 2)))

Unless there is an app which would break because of the title set there is no
need to check the version.

> +        {
> +            int cmdcount;
> +            WCHAR* cmdline = GetCommandLineW();
> +            WCHAR** cmdargs = CommandLineToArgvW(cmdline, &cmdcount);
> +            WCHAR* pos = cmdline;

wmain() already has arc/argv pair of parameters, why do you need to parse
command line again?

> +
> +            pos += lstrlenW(cmdargs[0]);
> +
> +            while(*pos == ' ')
> +                pos++;
> +
> +            if(*pos == '"')
> +            {
> +                /* FIXME: Set the process title */
> +                i++;
> +            }
> +            LocalFree(cmdargs);
> +        }

I assume that you've added LocalFree as MSDN suggests, but CommandLineToArgvW
in Wine uses GlobalAlloc, perhaps you could fix that?

-- 
Dmitry. 




More information about the wine-devel mailing list