midebug.cpp
Upload User: xhy777
Upload Date: 2007-02-14
Package Size: 24088k
Code Size: 2k
Category:

Windows Kernel

Development Platform:

Visual C++

  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. void
  23. DebugPrint(
  24.     HRESULT hr,
  25.     LPCTSTR  lpFormat,
  26.     ...
  27.     )
  28. {
  29.     va_list marker;
  30.     TCHAR    MessageBuffer[512];
  31.     void    *pMsgBuf;
  32.     
  33.     va_start(marker, lpFormat);
  34.     wvsprintf(MessageBuffer, lpFormat, marker);
  35.     va_end(marker);
  36.     if (hr != 0)
  37.     {                       
  38.         FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
  39.             NULL, hr, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&pMsgBuf,
  40.             0, NULL);
  41.                  
  42.         wsprintf(MessageBuffer, TEXT("%s %X (%s)"), MessageBuffer, hr, (LPTSTR)pMsgBuf);                 
  43.         LocalFree(pMsgBuf);
  44.     }
  45.     
  46.     OutputDebugString(TEXT("DATACLEN: "));
  47.     OutputDebugString(MessageBuffer);
  48.     OutputDebugString(TEXT("rn"));
  49. }
  50. #endif  //DEBUG