1069 |
NSString *arg; |
NSString *arg; |
1070 |
NSEnumerator *arg_enum; |
NSEnumerator *arg_enum; |
1071 |
NSMutableString *args; |
NSMutableString *args; |
1072 |
wchar_t *w_args; |
wchar_t *w_args; |
1073 |
int result; |
int result; |
1074 |
const wchar_t *wexecutable; |
const wchar_t *wexecutable; |
1075 |
|
|
1082 |
wexecutable = [[lpath localFromOpenStepPath] unicharString]; |
wexecutable = [[lpath localFromOpenStepPath] unicharString]; |
1083 |
|
|
1084 |
args = [[NSMutableString alloc] initWithString: |
args = [[NSMutableString alloc] initWithString: |
1085 |
quotedFromString([NSString stringWithCharacters:wexecutable length:wcslen(wexecutable)])]; |
quotedFromString([NSString stringWithCharacters: wexecutable |
1086 |
|
length: wcslen(wexecutable)])]; |
1087 |
arg_enum = [[self arguments] objectEnumerator]; |
arg_enum = [[self arguments] objectEnumerator]; |
1088 |
while ((arg = [arg_enum nextObject])) |
while ((arg = [arg_enum nextObject])) |
1089 |
{ |
{ |
1091 |
[args appendString: quotedFromString(arg)]; |
[args appendString: quotedFromString(arg)]; |
1092 |
} |
} |
1093 |
|
|
1094 |
w_args = NSZoneMalloc(NSDefaultMallocZone(),sizeof(wchar_t) *([args length]+1)); |
w_args = NSZoneMalloc(NSDefaultMallocZone(), |
1095 |
|
sizeof(wchar_t) * ([args length] + 1)); |
1096 |
[args getCharacters: (unichar*)w_args]; |
[args getCharacters: (unichar*)w_args]; |
1097 |
|
|
1098 |
memset (&start_info, 0, sizeof(start_info)); |
memset (&start_info, 0, sizeof(start_info)); |
1103 |
start_info.hStdError = [[self standardError] nativeHandle]; |
start_info.hStdError = [[self standardError] nativeHandle]; |
1104 |
|
|
1105 |
result = CreateProcessW(wexecutable, |
result = CreateProcessW(wexecutable, |
1106 |
w_args, |
w_args, |
1107 |
NULL, /* proc attrs */ |
NULL, /* proc attrs */ |
1108 |
NULL, /* thread attrs */ |
NULL, /* thread attrs */ |
1109 |
1, /* inherit handles */ |
1, /* inherit handles */ |
1110 |
0, /* creation flags */ |
0, /* creation flags */ |
1111 |
NULL, /* env block */ |
NULL, /* env block */ |
1112 |
[[[self currentDirectoryPath] localFromOpenStepPath] unicharString], |
[[[self currentDirectoryPath] localFromOpenStepPath] unicharString], |
1113 |
&start_info, |
&start_info, |
1114 |
&procInfo); |
&procInfo); |
1115 |
NSZoneFree(NSDefaultMallocZone(), w_args); |
NSZoneFree(NSDefaultMallocZone(), w_args); |
1116 |
if (result == 0) |
if (result == 0) |
1117 |
{ |
{ |
1126 |
[tasksLock lock]; |
[tasksLock lock]; |
1127 |
NSMapInsert(activeTasks, (void*)_taskId, (void*)self); |
NSMapInsert(activeTasks, (void*)_taskId, (void*)self); |
1128 |
[tasksLock unlock]; |
[tasksLock unlock]; |
1129 |
/* |
/* |
1130 |
* Create thread to watch for termination of process. |
* Create thread to watch for termination of process. |
1131 |
*/ |
*/ |
1132 |
wThread = CreateThread(NULL, 0, _threadFunction, (LPVOID)self, 0, &tid); |
wThread = CreateThread(NULL, 0, _threadFunction, (LPVOID)self, 0, &tid); |
1133 |
} |
} |
1134 |
|
|