21 #ifdef GPR_WINDOWS_SUBPROCESS
35 PROCESS_INFORMATION pi;
46 PROCESS_INFORMATION pi;
51 args_tchar = gpr_char_to_tchar(
args);
54 memset(&si, 0,
sizeof(si));
56 memset(&pi, 0,
sizeof(pi));
58 if (!CreateProcess(NULL, args_tchar, NULL, NULL,
FALSE,
59 CREATE_NEW_PROCESS_GROUP, NULL, NULL, &si, &pi)) {
78 CloseHandle(
p->pi.hProcess);
81 CloseHandle(
p->pi.hThread);
89 if (GetExitCodeProcess(
p->pi.hProcess, &dwExitCode)) {
90 if (dwExitCode == STILL_ACTIVE) {
91 if (WaitForSingleObject(
p->pi.hProcess, INFINITE) == WAIT_OBJECT_0) {
104 if (
p->interrupted) {
107 if (GetExitCodeProcess(
p->pi.hProcess, &dwExitCode)) {
108 return (
int)dwExitCode;
116 if (GetExitCodeProcess(
p->pi.hProcess, &dwExitCode)) {
117 if (dwExitCode == STILL_ACTIVE) {
119 GenerateConsoleCtrlEvent(CTRL_BREAK_EVENT,
p->pi.dwProcessId);