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.3 31 Oct 1996 10:12:50 KLILLEVO $
  27. * $Log: S:\h26x\src\common\cldebug.cpv $
  28. //
  29. // Rev 1.3 31 Oct 1996 10:12:50 KLILLEVO
  30. // changed from DBOUT to DBgLog
  31. //
  32. // Rev 1.2 27 Dec 1995 14:11:42 RMCKENZX
  33. //
  34. // Added copyright notice
  35. */
  36. #include "precomp.h"
  37. #ifdef _DEBUG
  38. UINT DebugH26x = 0;
  39. /*****************************************************************************
  40. *
  41. * AssertFailed
  42. *
  43. * Print out a message indicating that the assertion failed. If in Ring3
  44. * give the user the option of aborting. Otherwise just output the message.
  45. */
  46. extern void
  47. AssertFailed(
  48. void FAR * fpFileName,
  49. int iLine,
  50. void FAR * fpExp)
  51. {
  52. #ifndef RING0
  53. char szBuf[500];
  54. int n;
  55. wsprintf(szBuf,"Assertion (%s) failed in file '%s' at line %d - Abort?",
  56. fpExp, fpFileName, iLine);
  57. DBOUT(szBuf);
  58. n = MessageBox(GetFocus(), szBuf, "Assertion Failure",
  59. MB_ICONSTOP | MB_YESNO | MB_SETFOREGROUND);
  60. if (n == IDYES)
  61. abort();
  62. #else
  63. SYS_printf("Assertion (%s) failed in file '%s' at line %d",
  64. fpExp, fpFileName, iLine);
  65. _asm int 3;
  66. #endif
  67. } /* end AssertFailed() */
  68. #endif