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.

66 lines
1.8 KiB

  1. /*
  2. **------------------------------------------------------------------------------
  3. ** Module: Disk Cleanup Applet
  4. ** File: dmgrinfo.c
  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. LPCSTR lpFormat,
  28. ...
  29. )
  30. {
  31. if (!g_fSpew) return;
  32. va_list marker;
  33. CHAR MessageBuffer[512];
  34. void *pMsgBuf = NULL;
  35. va_start(marker, lpFormat);
  36. StringCchVPrintfA(MessageBuffer, ARRAYSIZE(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. StringCchPrintfA(MessageBuffer, ARRAYSIZE(MessageBuffer), "%s %X (%s)", MessageBuffer, hr, (LPTSTR)pMsgBuf);
  44. }
  45. OutputDebugStringA("CLEANMGR: ");
  46. OutputDebugStringA(MessageBuffer);
  47. OutputDebugStringA("\r\n");
  48. #ifdef MESSAGEBOX
  49. MessageBoxA(NULL, MessageBuffer, "CLEANMGR DEBUG MESSAGE", MB_OK);
  50. #endif
  51. LocalFree(pMsgBuf);
  52. }
  53. #endif //DEBUG