1 // restarter.cpp : Defines the entry point for the console application.
7 int _tmain(int argc
, _TCHAR
* argv
[])
9 if (argc
< 3) return 0;
10 int ppid
= _ttoi(argv
[1]);
11 HANDLE parent_process
= OpenProcess(SYNCHRONIZE
, FALSE
, ppid
);
14 WaitForSingleObject(parent_process
, INFINITE
);
15 CloseHandle(parent_process
);
18 int rc
= _texecv(argv
[2], argv
+2);
21 _tprintf(_T("Error restarting process: errno is %d"), errno
);