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.

62 lines
1.5 KiB

  1. /*
  2. **------------------------------------------------------------------------------
  3. ** Module: Disk Space Cleanup Property Sheets
  4. ** File: midebug.cpp
  5. **
  6. ** Purpose: Defines the CleanupMgrInfo class for the property tab
  7. ** Notes:
  8. ** Mod Log: Created by Jason Cobb (2/97)
  9. **
  10. ** Copyright (c)1997 Microsoft Corporation, All Rights Reserved
  11. **------------------------------------------------------------------------------
  12. */
  13. /*
  14. **------------------------------------------------------------------------------
  15. ** Project include files
  16. **------------------------------------------------------------------------------
  17. */
  18. #include "common.h"
  19. #include <stdio.h>
  20. #include <string.h>
  21. #ifdef DEBUG
  22. // Patch this to TRUE to see spew
  23. BOOL g_fSpew = FALSE;
  24. void
  25. DebugPrint(
  26. HRESULT hr,
  27. LPCTSTR lpFormat,
  28. ...
  29. )
  30. {
  31. if (!g_fSpew) return;
  32. va_list marker;
  33. TCHAR MessageBuffer[512];
  34. void *pMsgBuf;
  35. va_start(marker, lpFormat);
  36. wvsprintf(MessageBuffer, lpFormat, marker);
  37. va_end(marker);
  38. if (hr != 0)
  39. {
  40. FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
  41. NULL, hr, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&pMsgBuf,
  42. 0, NULL);
  43. wsprintf(MessageBuffer, TEXT("%s %X (%s)"), MessageBuffer, hr, (LPTSTR)pMsgBuf);
  44. LocalFree(pMsgBuf);
  45. }
  46. OutputDebugString(TEXT("DATACLEN: "));
  47. OutputDebugString(MessageBuffer);
  48. OutputDebugString(TEXT("\r\n"));
  49. }
  50. #endif //DEBUG