Source code of Windows XP (NT5)
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.

84 lines
1.6 KiB

  1. /*++
  2. Copyright (c) 1994-1999 Microsoft Corporation
  3. Module Name :
  4. debugafx.cpp
  5. Abstract:
  6. Debugging routines using AFX/MFC extensions
  7. Author:
  8. Ronald Meijer (ronaldm)
  9. Sergei Antonov (sergeia)
  10. Project:
  11. Internet Services Manager
  12. Revision History:
  13. 3/20/2000 sergeia Made this compatible to ATL, not MFC
  14. --*/
  15. //
  16. // Include Files
  17. //
  18. #include "stdafx.h"
  19. #include "common.h"
  20. #if defined(_DEBUG) || DBG
  21. int
  22. IISUIFireAssert(
  23. const char * filename,
  24. const char * timestamp,
  25. int linenum,
  26. const char * expr
  27. )
  28. {
  29. char sz[4096];
  30. char * pch = sz;
  31. pch += wsprintfA(pch,
  32. "-------------------------------------------------------------------------------\n"
  33. "ASSERT FAILURE!\n"
  34. "-------------------------------------------------------------------------------\n"
  35. "File:\t\t%s\n"
  36. "Line:\t\t%u\n"
  37. "Time Stamp:\t%s\n"
  38. "-------------------------------------------------------------------------------\n",
  39. filename, linenum, timestamp
  40. );
  41. if (expr)
  42. {
  43. wsprintfA(pch, "Expression:\t%s\n"
  44. "-------------------------------------------------------------------------------\n",
  45. expr
  46. );
  47. }
  48. TRACEEOL(sz);
  49. int nReturn = MessageBoxA(
  50. NULL,
  51. sz,
  52. "ASSERT FAILURE!",
  53. MB_ABORTRETRYIGNORE | MB_DEFBUTTON1 | MB_ICONHAND
  54. );
  55. if (nReturn == IDABORT)
  56. {
  57. exit(-1);
  58. }
  59. //
  60. // Return 1 to break, 0 to ignore
  61. //
  62. return (nReturn == IDRETRY);
  63. }
  64. #endif // _DEBUG || DBG