Add wrappers for ExitProcess, TerminateProcess
Tue Oct 6 21:58:00 GMT 2009
Christopher Faylor wrote:
> On Tue, Oct 06, 2009 at 05:19:03PM -0400, Charles Wilson wrote:
>> Do I need to increment the minor version when adding a new
>> cygwin_internal call? It seems so:
> Yes. Thanks for catching that.
As committed (and tested):
2009-10-05 Charles Wilson <email@example.com>
Add cygwin wrapper for ExitProcess and TerminateProcess.
* include/sys/cygwin.h: Declare new cygwin_getinfo_type
* external.cc (exit_process): New function.
(cygwin_internal): Handle CW_EXIT_PROCESS.
* pinfo.h (pinfo::set_exit_code): New method.
* pinfo.cc (pinfo::set_exit_code): New, refactored from...
(pinfo::maybe_set_exit_code_from_windows): here. Call it.
* include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR
to 215 to reflect the above change.
#define STATUS_ILLEGAL_DLL_RELOCATION ((NTSTATUS) 0xc0000269)
#define STATUS_ILLEGAL_DLL_PSEUDO_RELOCATION ((NTSTATUS) 0xe0000269)
#define STATUS_DLL_NOT_FOUND ((NTSTATUS) 0xc0000135)
int main(int argc, char* argv)
Note that neither cygwin nor ExitProcess/TerminateProcess care that they
have no idea what the '0xe0000269' status code means -- for this test I
stripped out all of the new pseudo-reloc support code from my repo.
However, cygwin just says: "this value is > 0xc00000000, and I don't
have a special case to handle it, so default: exit_code = 127;"
Which is what we want, for now.
$ gcc -o foo.exe foo.c
$ echo $?
P.S. Thanks for all the reviews, folks! Public interface changes should
always be subject to "strict scrutiny", even more so than purely
internal implementation details, so this was good...
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
More information about the Cygwin-patches