On 9 Mar 2014, at 01:32, Germán Arias <germanandre...@gmail.com> wrote:

> 
> According with this:
> 
> http://msdn.microsoft.com/en-us/library/windows/desktop/ms682425%28v=vs.85%29.aspx
> 
> "lpCommandLine [in, out, optional]
> 
> The Unicode version of this function, CreateProcessW, can modify the contents 
> of this string. Therefore, this parameter cannot be a pointer to read-only 
> memory (such as a const variable or a literal string). If this parameter is a 
> constant string, the function may cause an access violation."
> 
> In NSTask (line 1113) this parameter is created with NSZoneMalloc(). As far I 
> understand the size of this data is fixed. So cannot be changed right? Could 
> be this the problem?

No, malloced memory is mutable; the CreateProcessW call is free to change the 
contents of the buffer.
The size of the buffer is fixed, but that's basically the case for *all* 
buffers. You 'change' the size of a buffer by creating a new one and copying 
the contents of the old one to it. So if the CreateProcessW call wanted a 
larger buffer for something, it would simply create one and copy the command 
line data into it.
_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@gnu.org
https://lists.gnu.org/mailman/listinfo/gnustep-dev

Reply via email to