Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1003 B

  1. #include "precomp.hxx"
  2. #include "util4d.h"
  3. #include "assert4d.h"
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. /****************************************************************************
  8. FUNCTION: _assert
  9. PURPOSE: Override system _assert function.
  10. RETURNS: void
  11. ****************************************************************************/
  12. void __stdcall _assert4d( LPTSTR condition, LPTSTR file, unsigned line)
  13. {
  14. TCHAR szAssertText[512];
  15. //Build line, show assertion and exit program
  16. wsprintf(szAssertText,
  17. TEXT("Assertion failed. - Line:%u, File:%s, Condition:%s"),
  18. line, file, condition);
  19. switch (MessageBox(NULL, szAssertText, TEXT("ASSERTION FAILURE"),
  20. MB_OKCANCEL | MB_ICONHAND | MB_TASKMODAL))
  21. {
  22. case IDCANCEL:
  23. // Cause a breakpoint so the debugger is activated.
  24. // I would call DebugBreak() here but the IDE gives a bogus
  25. // callstack if I do that.
  26. __asm int 3
  27. break;
  28. }
  29. }
  30. #ifdef __cplusplus
  31. }
  32. #endif