_set_abort_behavior
Specifies the action to be taken when a program aborts.
unsigned int _set_abort_behavior( unsigned int flags, unsigned int mask );
Parameters
- [in] flags
-
New value of the abort flags.
- [in] mask
-
Mask for the abort flags bits to set.
There are two abort flags: _WRITE_ABORT_MSG and _CALL_REPORTFAULT. _WRITE_ABORT_MSG determines whether a helpful text message is printed when a program is aborted. The message states in English that the application has requested the runtime to terminate it in an unusual way and suggests that the user contact the application's support team for more information. The default behavior is to print the message. _CALL_REPORTFAULT, if set, specifies that a Watson crash dump is generated and reported when abort is called. Crash dump reporting is enabled by default.
| Routine | Required header | Compatibility |
|---|---|---|
| _set_abort_behavior | <stdlib.h> | Windows 95, Windows 98, Windows 98 Second Edition, Windows Millennium Edition, Windows NT 4.0, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 |
For more compatibility information, see Compatibility in the Introduction.
// crt_set_abort_behavior.c
// compile with: /c
#include <stdlib.h>
int main()
{
printf("Suppressing the abort message. If successful, this message"
" will be the only output.\n");
// Suppress the abort message
_set_abort_behavior( 0, _WRITE_ABORT_MSG);
abort();
}
Sample Output
Suppressing the abort message. If successful, this message will be the only output.