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.

43 lines
1.0 KiB

  1. /****************************Module*Header***********************************\
  2. * Module Name: WASSERT
  3. *
  4. * Module Descripton: Quick Win32 assert code.
  5. *
  6. * Warnings:
  7. *
  8. * Created: 15 July 1993
  9. *
  10. * Author: Raymond E. Endres [rayen@microsoft.com]
  11. \****************************************************************************/
  12. #include <windows.h>
  13. #include "wassert.h"
  14. #ifdef _DEBUG
  15. void vAssert(TCHAR * pszExp, TCHAR * pszFile, int iLine)
  16. {
  17. TCHAR szTmp[1024];
  18. int iReply;
  19. wsprintf(szTmp, TEXT("Assertion (%s) at line %d, file %s failed.\nPress Abort to quit the program, Retry to debug the program, or Ignore to continue."),
  20. pszExp, iLine, pszFile);
  21. iReply = MessageBox(NULL, szTmp, TEXT("Assertion failed:"), MB_ABORTRETRYIGNORE | MB_TASKMODAL );
  22. switch ( iReply )
  23. {
  24. case IDABORT:
  25. PostQuitMessage( -1 );
  26. break;
  27. case IDRETRY:
  28. DebugBreak();
  29. break;
  30. case IDIGNORE:
  31. default:
  32. // do nothing, program will try to continue;
  33. break;
  34. }
  35. }
  36. #endif