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.

76 lines
1.9 KiB

  1. /* *************************************************************************
  2. ** INTEL Corporation Proprietary Information
  3. **
  4. ** This listing is supplied under the terms of a license
  5. ** agreement with INTEL Corporation and may not be copied
  6. ** nor disclosed except in accordance with the terms of
  7. ** that agreement.
  8. **
  9. ** Copyright (c) 1995 Intel Corporation.
  10. ** All Rights Reserved.
  11. **
  12. ** *************************************************************************
  13. */
  14. /*****************************************************************************
  15. *
  16. * cldebug.cpp
  17. *
  18. * Description:
  19. * This modules contains the debug support routines
  20. *
  21. * Routines:
  22. * AssertFailed
  23. *
  24. * Data:
  25. */
  26. /* $Header: S:\h26x\src\common\cldebug.cpv 1.2 27 Dec 1995 14:11:42 RMCKENZX $
  27. * $Log: S:\h26x\src\common\cldebug.cpv $
  28. //
  29. // Rev 1.2 27 Dec 1995 14:11:42 RMCKENZX
  30. //
  31. // Added copyright notice
  32. */
  33. #include "precomp.h"
  34. #ifdef _DEBUG
  35. // CurtSm hack ... don't spew all the time
  36. UINT DebugH26x = 0;
  37. /*****************************************************************************
  38. *
  39. * AssertFailed
  40. *
  41. * Print out a message indicating that the assertion failed. If in Ring3
  42. * give the user the option of aborting. Otherwise just output the message.
  43. */
  44. extern void
  45. AssertFailed(
  46. void FAR * fpFileName,
  47. int iLine,
  48. void FAR * fpExp)
  49. {
  50. #ifndef RING0
  51. char szBuf[500];
  52. int n;
  53. wsprintf(szBuf,"Assertion (%s) failed in file '%s' at line %d - Abort?",
  54. fpExp, fpFileName, iLine);
  55. DBOUT(szBuf);
  56. n = MessageBox(GetFocus(), szBuf, "Assertion Failure",
  57. MB_ICONSTOP | MB_YESNO | MB_SETFOREGROUND);
  58. if (n == IDYES)
  59. abort();
  60. #else
  61. SYS_printf("Assertion (%s) failed in file '%s' at line %d",
  62. fpExp, fpFileName, iLine);
  63. _asm int 3;
  64. #endif
  65. } /* end AssertFailed() */
  66. #endif