Fwd: Re: CommandLineToArgvW fix

Malte Starostik malte at kde.org
Mon Oct 8 13:30:58 CDT 2001


Sorry, meant reply-to-all

----------  Weitergeleitete Nachricht  ----------

Subject: Re: CommandLineToArgvW fix
Date: Mon, 8 Oct 2001 20:23:57 +0200
From: Malte Starostik <malte at kde.org>
To: eric pouech <eric.pouech at wanadoo.fr>

Am Monday 08 October 2001 20:08 schrieben Sie:
> Malte Starostik wrote:
> > Don't free cmdline as the return values point into that string. It's the
> > caller's responsibility to GlobalFree() this according to msdn.
>
> I don't understand what you've done.
> cmdline is a copy of the passed lpCmdLine parameter used for getting the
> different bits of the argv, so it should be freed
> however, what's wrong with current implementation (hence your issues) is
> that when freeing cmdline the argv array points to garbage
> it means that the argv array and cmdline should be allocated in a single
> memory block suh that argv[i] points to the part of the string

You're definately right, I mixed up argv with argv[i] there.

> wouldn't the (completly untested but) attached patch work better ?

Didn't test it either, will do so somewhen later, looks right to me.
--
Malte Starostik
PGP: 1024D/D2F3C787 [C138 2121 FAF3 410A 1C2A  27CD 5431 7745 D2F3 C787]

-------------------------------------------------------





More information about the wine-devel mailing list