[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: os.execute and the dreaded Windows console
- From: "Robert Raschke" <rtrlists@...>
- Date: Tue, 9 Sep 2008 13:36:03 +0100
On Tue, Sep 9, 2008 at 1:07 PM, Chris <email@example.com> wrote:
> On Tue, Sep 9, 2008 at 4:33 AM, Robert Raschke <firstname.lastname@example.org> wrote:
>> LPTSTR szCmdline = lua_tostring(L, 1);
>> if (! CreateProcess(NULL, szCmdline, NULL, NULL, FALSE, DETACHED_PROCESS,
> I'm surprised that using szCmdLine like that works. The second
> parameter to CreateProcess is not const (it's an in/out parameter) and
> on my system CreateProcess modifies it which sometimes causes a crash.
Ah, you are right. I'd forgotten about that, since I always run in
Ansi mode. It's the Unicode one that rewrites the string. So for that,
you need to take a copy.
Thanks for pointing that out.