Windows NT 4.0 source code leak
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.

38 lines
693 B

4 years ago
  1. // ASSERT.cpp -- Assertion support code
  2. #include "stdafx.h"
  3. #include "Assert.h"
  4. HWND hwndMain= NULL;
  5. void SetMainWindow(HWND hwnd)
  6. {
  7. hwndMain= hwnd;
  8. }
  9. void AssertionFailure(PSZ pszFileName, int nLine)
  10. {
  11. char abMessage[513];
  12. wsprintf(abMessage, "Assertion Failure on line %d of %s!", nLine, pszFileName);
  13. int iResult= ::MessageBox(hwndMain, abMessage, "Assertion Failure!",
  14. MB_ABORTRETRYIGNORE | MB_APPLMODAL | MB_ICONSTOP
  15. );
  16. switch(iResult)
  17. {
  18. case IDABORT:
  19. ExitProcess(-nLine);
  20. case IDRETRY:
  21. DebugBreak();
  22. break;
  23. case IDIGNORE:
  24. break;
  25. }
  26. }