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.

53 lines
1.4 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1993.
  5. //
  6. // File: assert.cxx
  7. //
  8. // Functions: FnAssert
  9. // DbgDllSetSiftObject
  10. //
  11. // History: 4-Jan-94 CraigWi Created
  12. // 16-Jun-94 t-ChriPi Added DbgDllSetSiftObject
  13. //
  14. //----------------------------------------------------------------------------
  15. #ifdef unix
  16. #include <windows.h>
  17. #endif /* unix */
  18. #include <ole2.h>
  19. STDAPI_(void) Win4AssertEx(
  20. char const * szFile,
  21. int iLine,
  22. char const * szMessage);
  23. //+-------------------------------------------------------------------
  24. //
  25. // Function: FnAssert, public
  26. //
  27. // Synopsis: Prints a message and optionally stops the program
  28. //
  29. // Effects: Simply maps to Win4AssertEx for now.
  30. //
  31. // History: 4-Jan-94 CraigWi Created for Win32 OLE2.
  32. //
  33. //--------------------------------------------------------------------
  34. STDAPI FnAssert( LPSTR lpstrExpr, LPSTR lpstrMsg, LPSTR lpstrFileName, UINT iLine )
  35. {
  36. #if DBG == 1
  37. char szMessage[1024];
  38. if (lpstrMsg == NULL)
  39. lstrcpyA(szMessage, lpstrExpr);
  40. else
  41. wsprintfA(szMessage, "%s; %s", lpstrExpr, lpstrMsg);
  42. Win4AssertEx(lpstrFileName, iLine, szMessage);
  43. #endif
  44. return NOERROR;
  45. }