Add wrappers for ExitProcess, TerminateProcess

Charles Wilson cygwin@cwilson.fastmail.fm
Tue Oct 6 03:59:00 GMT 2009


Christopher Faylor wrote:
> On Mon, Oct 05, 2009 at 04:49:11PM -0400, Charles Wilson wrote:
>> hmm...probably
>>     cygwin_internal (CW_TERMINATE_PROCESS, HANDLE, UINT)
>>     cygwin_internal (CW_EXIT_PROCESS, UINT)
>> right?
> 
> Do we really have to provide the ability to kill some other process?
> Maybe we really only need one call with two arguments - one which is the
> exit value and one which indicates whether to exit with prejudice.
> 
> cygwin_internal (CW_EXIT_PROCESS, UINT, bool);
> 
> where the bool argument is true if we want to call TerminateProcess on
> this process.

Fine with me. The two-function version was just a derivative of my
earlier "just wrap [Exit|Terminate]Process" approach, trying to mimic
the w32api.

However

by going the cgywin_internal route, there's really no point in slavishly
following the w32api. And besides, the implementation of
cygwin_internal(CW_TERMINATE_PROCESS,...) really does nothing special if
called with a HANDLE to a different process -- you might as well call
TerminateProcess() itself, in that case.

I'll wait for other comments, before taking any additional action, tho.

--
Chuck



More information about the Cygwin-patches mailing list