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.

139 lines
4.3 KiB

  1. //
  2. //
  3. //
  4. // This file cannot be compiled as a C++ file, otherwise the linker
  5. // will bail on unresolved externals (even with extern "C" wrapping
  6. // this).
  7. #include "priv.h"
  8. // Define some things for debug.h
  9. //
  10. #define SZ_DEBUGINI "ccshell.ini"
  11. #define SZ_DEBUGSECTION "shdocvw"
  12. #define SZ_MODULE "SHDOCVW"
  13. #define DECLARE_DEBUG
  14. #include <debug.h>
  15. // Include the standard helper functions to dump common ADTs
  16. #undef lstrcpy
  17. #undef wsprintf
  18. #undef StrCpyW
  19. #define lstrcpy StrCpyW
  20. #undef wsprintfW
  21. #define wsprintf wsprintfW
  22. #include "..\inc\dump.c"
  23. #undef lstrcpy
  24. #define lstrcpy Do_not_use_lstrcpy_use_StrCpyN
  25. #undef wsprintf
  26. #define wsprintf Do_not_use_wsprintf_use_wnsprintf
  27. #define StrCpyW Do_not_use_StrCpyW_use_StrCpyNW
  28. #define wsprintfW Do_not_use_wsprintfW_use_wnsprintfW
  29. #ifdef DEBUG
  30. void DumpMsg(LPCTSTR pszLabel, MSG * pmsg)
  31. {
  32. ASSERT(IS_VALID_STRING_PTR(pszLabel, -1));
  33. ASSERT(pmsg);
  34. switch (pmsg->message)
  35. {
  36. case WM_LBUTTONDOWN:
  37. TraceMsg(TF_ALWAYS, "%s: msg = WM_LBUTTONDOWN hwnd = %#08lx x = %d y = %d",
  38. pszLabel, pmsg->hwnd, pmsg->pt.x, pmsg->pt.y);
  39. TraceMsg(TF_ALWAYS, " keys = %#04lx x = %d y = %d",
  40. pmsg->wParam, LOWORD(pmsg->lParam), HIWORD(pmsg->lParam));
  41. break;
  42. case WM_LBUTTONUP:
  43. TraceMsg(TF_ALWAYS, "%s: msg = WM_LBUTTONUP hwnd = %#08lx x = %d y = %d",
  44. pszLabel, pmsg->hwnd, pmsg->pt.x, pmsg->pt.y);
  45. TraceMsg(TF_ALWAYS, " keys = %#04lx x = %d y = %d",
  46. pmsg->wParam, LOWORD(pmsg->lParam), HIWORD(pmsg->lParam));
  47. break;
  48. case WM_KEYDOWN:
  49. case WM_SYSKEYDOWN:
  50. case WM_KEYUP:
  51. case WM_SYSKEYUP:
  52. BLOCK
  53. {
  54. LPTSTR pcsz = TEXT("(unknown)");
  55. switch (pmsg->message)
  56. {
  57. STRING_CASE(WM_KEYDOWN);
  58. STRING_CASE(WM_SYSKEYDOWN);
  59. STRING_CASE(WM_KEYUP);
  60. STRING_CASE(WM_SYSKEYUP);
  61. }
  62. TraceMsg(TF_ALWAYS, "%s: msg = %s hwnd = %#08lx",
  63. pszLabel, pcsz, pmsg->hwnd);
  64. TraceMsg(TF_ALWAYS, " vk = %#04lx count = %u flags = %#04lx",
  65. pmsg->wParam, LOWORD(pmsg->lParam), HIWORD(pmsg->lParam));
  66. }
  67. break;
  68. case WM_CHAR:
  69. case WM_SYSCHAR:
  70. BLOCK
  71. {
  72. LPTSTR pcsz = TEXT("(unknown)");
  73. switch (pmsg->message)
  74. {
  75. STRING_CASE(WM_CHAR);
  76. STRING_CASE(WM_SYSCHAR);
  77. }
  78. TraceMsg(TF_ALWAYS, "%s: msg = %s hwnd = %#08lx",
  79. pszLabel, pcsz, pmsg->hwnd);
  80. TraceMsg(TF_ALWAYS, " char = '%c' count = %u flags = %#04lx",
  81. pmsg->wParam, LOWORD(pmsg->lParam), HIWORD(pmsg->lParam));
  82. }
  83. break;
  84. case WM_MOUSEMOVE:
  85. #if 0
  86. TraceMsg(TF_ALWAYS, "%s: msg = WM_MOUSEMOVE hwnd = %#08lx x=%d y=%d",
  87. pszLabel, pmsg->hwnd, LOWORD(pmsg->lParam), HIWORD(pmsg->lParam));
  88. #endif
  89. break;
  90. case WM_TIMER:
  91. #if 0
  92. TraceMsg(TF_ALWAYS, "%s: msg = WM_TIMER hwnd = %#08lx x = %d y = %d",
  93. pszLabel, pmsg->hwnd, pmsg->pt.x, pmsg->pt.y);
  94. TraceMsg(TF_ALWAYS, " id = %#08lx",
  95. pmsg->wParam);
  96. #endif
  97. break;
  98. case WM_MENUSELECT:
  99. TraceMsg(TF_ALWAYS, "%s: msg = WM_MENUSELECT hwnd = %#08lx x = %d y = %d",
  100. pszLabel, pmsg->hwnd, pmsg->pt.x, pmsg->pt.y);
  101. TraceMsg(TF_ALWAYS, " uItem = %#04lx flags = %#04lx hmenu = %#08lx",
  102. GET_WM_MENUSELECT_CMD(pmsg->wParam, pmsg->lParam),
  103. GET_WM_MENUSELECT_FLAGS(pmsg->wParam, pmsg->lParam),
  104. GET_WM_MENUSELECT_HMENU(pmsg->wParam, pmsg->lParam));
  105. break;
  106. default:
  107. if (WM_USER > pmsg->message)
  108. {
  109. TraceMsg(TF_ALWAYS, "%s: msg = %#04lx hwnd=%#04lx wP=%#08lx lP=%#08lx",
  110. pszLabel, pmsg->message, pmsg->hwnd, pmsg->wParam, pmsg->lParam);
  111. }
  112. break;
  113. }
  114. }
  115. #endif