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.

43 lines
691 B

  1. #include <stdio.h>
  2. #include <stdarg.h>
  3. #include "debug.h"
  4. #if DBG
  5. void __cdecl
  6. Trace(
  7. LPCWSTR ptszFormat,
  8. ...)
  9. {
  10. WCHAR tszBuff[2048];
  11. va_list args;
  12. va_start(args, ptszFormat);
  13. vswprintf(tszBuff, ptszFormat, args);
  14. va_end(args);
  15. OutputDebugString(tszBuff);
  16. }
  17. void __cdecl
  18. Assert(
  19. LPCSTR pszFile,
  20. DWORD dwLine,
  21. LPCSTR pszCond)
  22. {
  23. CHAR pszBuf[2048];
  24. _snprintf(
  25. pszBuf,
  26. 2048,
  27. "%s, Line %u, Assertion failed: %s\n",
  28. pszFile,
  29. dwLine,
  30. pszCond);
  31. pszBuf[2047] = L'\0';
  32. OutputDebugStringA(pszBuf);
  33. DebugBreak();
  34. }
  35. #endif // DBG