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.

188 lines
4.2 KiB

  1. #include "priv.h"
  2. // Define some things for debug.h
  3. //
  4. #define SZ_DEBUGINI "ccshell.ini"
  5. #define SZ_DEBUGSECTION "shlwapi"
  6. #define SZ_MODULE "SHLWAPI"
  7. #define DECLARE_DEBUG
  8. #include <debug.h>
  9. #ifdef DEBUG
  10. /*
  11. * macro for simplifying result to string translation, assumes result string
  12. * pointer pcsz
  13. */
  14. #define STRING_CASE(val) case val: pcsz = TEXT(#val); break
  15. #if 0
  16. //
  17. // Debug value-to-string mapping functions
  18. //
  19. /*----------------------------------------------------------
  20. Purpose: Return the string form of the clipboard format.
  21. Returns: pointer to a static string
  22. Cond: --
  23. */
  24. LPCTSTR
  25. Dbg_GetCFName(
  26. UINT ucf)
  27. {
  28. LPCTSTR pcsz;
  29. static TCHAR s_szCFName[MAX_PATH];
  30. switch (ucf)
  31. {
  32. STRING_CASE(CF_TEXT);
  33. STRING_CASE(CF_BITMAP);
  34. STRING_CASE(CF_METAFILEPICT);
  35. STRING_CASE(CF_SYLK);
  36. STRING_CASE(CF_DIF);
  37. STRING_CASE(CF_TIFF);
  38. STRING_CASE(CF_OEMTEXT);
  39. STRING_CASE(CF_DIB);
  40. STRING_CASE(CF_PALETTE);
  41. STRING_CASE(CF_PENDATA);
  42. STRING_CASE(CF_RIFF);
  43. STRING_CASE(CF_WAVE);
  44. STRING_CASE(CF_UNICODETEXT);
  45. STRING_CASE(CF_ENHMETAFILE);
  46. STRING_CASE(CF_HDROP);
  47. STRING_CASE(CF_LOCALE);
  48. STRING_CASE(CF_MAX);
  49. STRING_CASE(CF_OWNERDISPLAY);
  50. STRING_CASE(CF_DSPTEXT);
  51. STRING_CASE(CF_DSPBITMAP);
  52. STRING_CASE(CF_DSPMETAFILEPICT);
  53. STRING_CASE(CF_DSPENHMETAFILE);
  54. default:
  55. if (! GetClipboardFormatName(ucf, s_szCFName, SIZECHARS(s_szCFName)))
  56. lstrcpy(s_szCFName, TEXT("UNKNOWN CLIPBOARD FORMAT"));
  57. pcsz = s_szCFName;
  58. break;
  59. }
  60. ASSERT(pcsz);
  61. return(pcsz);
  62. }
  63. LPCTSTR
  64. Dbg_GetHRESULTName(
  65. HRESULT hr)
  66. {
  67. LPCTSTR pcsz;
  68. static TCHAR s_rgchHRESULT[] = TEXT("0x12345678");
  69. switch (hr)
  70. {
  71. STRING_CASE(S_OK);
  72. STRING_CASE(S_FALSE);
  73. STRING_CASE(DRAGDROP_S_CANCEL);
  74. STRING_CASE(DRAGDROP_S_DROP);
  75. STRING_CASE(DRAGDROP_S_USEDEFAULTCURSORS);
  76. STRING_CASE(E_UNEXPECTED);
  77. STRING_CASE(E_NOTIMPL);
  78. STRING_CASE(E_OUTOFMEMORY);
  79. STRING_CASE(E_INVALIDARG);
  80. STRING_CASE(E_NOINTERFACE);
  81. STRING_CASE(E_POINTER);
  82. STRING_CASE(E_HANDLE);
  83. STRING_CASE(E_ABORT);
  84. STRING_CASE(E_FAIL);
  85. STRING_CASE(E_ACCESSDENIED);
  86. STRING_CASE(CLASS_E_NOAGGREGATION);
  87. STRING_CASE(CO_E_NOTINITIALIZED);
  88. STRING_CASE(CO_E_ALREADYINITIALIZED);
  89. STRING_CASE(CO_E_INIT_ONLY_SINGLE_THREADED);
  90. STRING_CASE(DV_E_DVASPECT);
  91. STRING_CASE(DV_E_LINDEX);
  92. STRING_CASE(DV_E_TYMED);
  93. STRING_CASE(DV_E_FORMATETC);
  94. #ifdef __INTSHCUT_H__
  95. STRING_CASE(E_FLAGS);
  96. STRING_CASE(URL_E_INVALID_SYNTAX);
  97. STRING_CASE(URL_E_UNREGISTERED_PROTOCOL);
  98. STRING_CASE(IS_E_EXEC_FAILED);
  99. STRING_CASE(E_FILE_NOT_FOUND);
  100. STRING_CASE(E_PATH_NOT_FOUND);
  101. #endif
  102. default:
  103. wsprintf(s_rgchHRESULT, TEXT("%#lx"), hr);
  104. pcsz = s_rgchHRESULT;
  105. break;
  106. }
  107. ASSERT(IS_VALID_STRING_PTR(pcsz, -1));
  108. return(pcsz);
  109. }
  110. #define STRING_RIID(val) { &val, TEXT(#val) }
  111. struct
  112. {
  113. REFIID riid;
  114. LPCTSTR psz;
  115. } const c_mpriid[] =
  116. {
  117. STRING_RIID(IID_IUnknown),
  118. STRING_RIID(IID_IEnumUnknown),
  119. STRING_RIID(IID_IShellBrowser),
  120. STRING_RIID(IID_IShellView),
  121. STRING_RIID(IID_IContextMenu),
  122. STRING_RIID(IID_IShellFolder),
  123. STRING_RIID(IID_IShellExtInit),
  124. STRING_RIID(IID_IShellPropSheetExt),
  125. STRING_RIID(IID_IPersistFolder),
  126. STRING_RIID(IID_IExtractIcon),
  127. STRING_RIID(IID_IShellLink),
  128. STRING_RIID(IID_IDataObject),
  129. STRING_RIID(IID_IContextMenu2),
  130. STRING_RIID(IID_INewShortcutHook),
  131. STRING_RIID(IID_IPersist),
  132. STRING_RIID(IID_IPersistStream),
  133. STRING_RIID(IID_IUniformResourceLocator),
  134. };
  135. LPCTSTR
  136. Dbg_GetREFIIDName(
  137. REFIID riid)
  138. {
  139. int i;
  140. for (i = 0; i < ARRAYSIZE(c_mpriid); i++)
  141. {
  142. if (IsEqualIID(riid, c_mpriid[i].riid))
  143. return c_mpriid[i].psz;
  144. }
  145. return TEXT("Unknown REFIID");
  146. }
  147. #endif
  148. #endif // DEBUG