Bug #11515 » ruby-CreateProcessW-memory-error.diff
| win32/win32.c | ||
|---|---|---|
|
PROCESS_INFORMATION aProcessInformation;
|
||
|
SECURITY_ATTRIBUTES sa;
|
||
|
struct ChildRecord *child;
|
||
|
WCHAR tmpCmd[MAX_PATH * 2];
|
||
|
if (!cmd && !prog) {
|
||
|
errno = EFAULT;
|
||
| ... | ... | |
|
return NULL;
|
||
|
}
|
||
|
/* Make a copy of cmd so CreateProcessW() can modify it if it needs to. */
|
||
|
_tcscpy_s(tmpCmd, MAX_PATH *2, (WCHAR *)cmd);
|
||
|
RUBY_CRITICAL({
|
||
|
fRet = CreateProcessW(prog, (WCHAR *)cmd, psa, psa,
|
||
|
fRet = CreateProcessW(prog, tmpCmd, psa, psa,
|
||
|
psa->bInheritHandle, dwCreationFlags, NULL, NULL,
|
||
|
&aStartupInfo, &aProcessInformation);
|
||
|
errno = map_errno(GetLastError());
|
||