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.

63 lines
1.7 KiB

  1. //==========================================================================
  2. //
  3. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  4. // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  5. // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  6. // PURPOSE.
  7. //
  8. // Copyright 1998 - 1999 Microsoft Corporation. All Rights Reserved.
  9. //
  10. //--------------------------------------------------------------------------
  11. #include "precomp.h"
  12. //+---------------------------------------------------------------------------
  13. //
  14. // Function: FnAssert, public
  15. //
  16. // Synopsis: Displays the Assert dialog
  17. //
  18. // Arguments: [lpstrExptr] - Expression
  19. // [lpstrMsg] - Msg, if any, to append to the Expression
  20. // [lpstrFilename] - File Assert Occured in
  21. // [iLine] - Line Number of Assert
  22. //
  23. // Returns: Appropriate status code
  24. //
  25. // Modifies:
  26. //
  27. //
  28. //----------------------------------------------------------------------------
  29. #if DBG == 1
  30. STDAPI FnAssert( LPSTR lpstrExpr, LPSTR lpstrMsg, LPSTR lpstrFileName, UINT iLine )
  31. {
  32. int iResult;
  33. char lpTemp[] = "";
  34. char lpBuffer[512];
  35. char lpLocBuffer[256];
  36. if (NULL == lpstrMsg)
  37. lpstrMsg = lpTemp;
  38. wsprintfA(lpBuffer, "Assertion \"%s\" failed! %s", lpstrExpr, lpstrMsg);
  39. wsprintfA(lpLocBuffer, "File %s, line %d; (A=exit; R=break; I=continue)",
  40. lpstrFileName, iLine);
  41. iResult = MessageBoxA(NULL, lpLocBuffer, lpBuffer,
  42. MB_ABORTRETRYIGNORE | MB_SYSTEMMODAL);
  43. if (iResult == IDRETRY)
  44. {
  45. DebugBreak();
  46. }
  47. else if (iResult == IDABORT)
  48. {
  49. FatalAppExitA(0, "Assertion failure");
  50. }
  51. return NOERROR;
  52. }
  53. #endif