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.

44 lines
1.3 KiB

  1. /*
  2. **------------------------------------------------------------------------------
  3. ** Module: Disk Cleanup Applet
  4. ** File: msprintf.cpp
  5. **
  6. ** Purpose: Print functions
  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 "msprintf.h"
  20. #include "resource.h"
  21. #include "diskutil.h" // cb1MEG
  22. /*
  23. **------------------------------------------------------------------------------
  24. ** Function definitions
  25. **------------------------------------------------------------------------------
  26. */
  27. TCHAR * cdecl SHFormatMessage( DWORD dwMessageId, ...)
  28. {
  29. va_list arg;
  30. va_start (arg, dwMessageId);
  31. LPVOID pBuffer = NULL;
  32. // use format message to build the string...
  33. DWORD dwRes = FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_HMODULE,
  34. NULL, dwMessageId, 0, (LPTSTR) & pBuffer, 0, &arg );
  35. return (TCHAR *) pBuffer;
  36. }