Add wrappers for ExitProcess, TerminateProcess

Charles Wilson
Tue Oct 6 21:01:00 GMT 2009

Christopher Faylor wrote:
> On Tue, Oct 06, 2009 at 03:51:26PM -0400, Charles Wilson wrote:
>> Having said all that, I really don't care one way or the other. We have
>> three possibilities:
>> 1) current iteration (BOOL in cygwin_internal coerced to bool for static
>> function exit_process)
>> 2) use bool throughout, and expect caller to use C++ bool,
>> C99 bool, or stdbool.h bool.
> Since, as you say, we use DWORD in other places, I'm going to opt for
> what I originally proposed.  Change BOOL to bool since there is no reason
> to use the Windows API BOOL type.  Do that everywhere in your change that
> it makes sense.  Leave the UINT alone.

Hmm...this is interesting:

/usr/src/devel/kernel/src/winsup/cygwin/ In function 'long
unsigned int cygwin_internal(cygwin_getinfo_types, ...)':
/usr/src/devel/kernel/src/winsup/cygwin/ error: 'bool'
is promoted to 'int' when passed through '...'
/usr/src/devel/kernel/src/winsup/cygwin/ note: (so you
should pass 'int' not 'bool' to 'va_arg')
/usr/src/devel/kernel/src/winsup/cygwin/ note: if this
code is reached, the program will abort

This didn't happen with BOOL, because it is typedef int, anyway:


typedef unsigned long DWORD;
/* FIXME: Is there a good solution to this? */
#ifndef XFree86Server
#ifndef __OBJC__
typedef unsigned char BYTE;
#endif /* ndef XFree86Server */

So, to avoid requiring #include <windows.h>, I guess the next best thing
is option #3, right?

> 3) use bool in static function exit_process, use unsigned long in
> cygwin_internal and callers.


More information about the Cygwin-patches mailing list