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.

45 lines
978 B

  1. /* debug.h
  2. * Copyright (c) 2000-2001 Microsoft Corporation
  3. */
  4. //
  5. // ISSUE-2000/09/29-FrankYe Try to use standard ntrtl debug
  6. // stuff. Check winweb/wem for guidance perhaps.
  7. //
  8. #ifdef ASSERT
  9. #undef ASSERT
  10. #endif
  11. #ifdef DBG
  12. #define ASSERT( exp ) \
  13. if (!(exp)) { \
  14. char msg[200]; \
  15. wsprintfA(msg, "Assert failure %s %d %s\n", __FILE__, __LINE__, #exp); \
  16. OutputDebugStringA(msg); \
  17. DebugBreak(); \
  18. }
  19. static int dprintf(PCTSTR pszFormat, ...)
  20. {
  21. PTSTR pstrTemp;
  22. va_list marker;
  23. int result = 0;
  24. pstrTemp = (PTSTR)HeapAlloc(GetProcessHeap(), 0, 500 * sizeof(TCHAR));
  25. if (pstrTemp)
  26. {
  27. va_start(marker, pszFormat);
  28. result = wvsprintf(pstrTemp, pszFormat, marker);
  29. OutputDebugString(TEXT("AudioSrv: "));
  30. OutputDebugString(pstrTemp);
  31. HeapFree(GetProcessHeap(), 0, pstrTemp);
  32. }
  33. return result;
  34. }
  35. #else
  36. #define ASSERT
  37. #define dprintf
  38. #endif