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.

217 lines
5.4 KiB

  1. //==============================================================;
  2. //
  3. // This source code is only intended as a supplement to existing Microsoft documentation.
  4. //
  5. //
  6. //
  7. //
  8. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  9. // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  10. // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  11. // PURPOSE.
  12. //
  13. // Copyright (C) 1999 Microsoft Corporation. All Rights Reserved.
  14. //
  15. //
  16. //
  17. //==============================================================;
  18. #include "stdafx.h"
  19. #include <mmc.h>
  20. #include <winuser.h>
  21. #include <tchar.h>
  22. #include "globals.h"
  23. static TCHAR *MMCN_CrackVerb(MMC_CONSOLE_VERB verb)
  24. {
  25. static TCHAR error[64];
  26. switch (verb) {
  27. case MMC_VERB_NONE:
  28. return _T("NONE");
  29. case MMC_VERB_OPEN:
  30. return _T("OPEN");
  31. case MMC_VERB_COPY:
  32. return _T("COPY");
  33. case MMC_VERB_PASTE:
  34. return _T("PASTE");
  35. case MMC_VERB_DELETE:
  36. return _T("DELETE");
  37. case MMC_VERB_PROPERTIES:
  38. return _T("PROPERTIES");
  39. case MMC_VERB_RENAME:
  40. return _T("RENAME");
  41. case MMC_VERB_REFRESH:
  42. return _T("REFRESH");
  43. case MMC_VERB_PRINT:
  44. return _T("PRINT");
  45. case MMC_VERB_CUT:
  46. return _T("CUT");
  47. default:
  48. wsprintf(error, _T("Unknown verb id %d"), verb);
  49. return error;
  50. }
  51. }
  52. void MMCN_Crack(BOOL bComponentData,
  53. IDataObject *pDataObject,
  54. IComponentData *pCompData,
  55. IComponent *pComp,
  56. MMC_NOTIFY_TYPE event,
  57. LPARAM arg,
  58. LPARAM param)
  59. {
  60. #ifdef MMC_CRACK_MESSAGES
  61. TCHAR message[256] = {0};
  62. if (bComponentData == TRUE)
  63. OutputDebugString(_T("IComponentData::Notify( "));
  64. else
  65. OutputDebugString(_T("IComponent::Notify( "));
  66. wsprintf(message, _T("DataObject: %08x, CompData: %08x, Comp: %08x ) - "), pDataObject, pCompData, pComp);
  67. OutputDebugString(message);
  68. switch (event) {
  69. case MMCN_ACTIVATE:
  70. wsprintf(message, _T("MMCN_ACTIVATE\n\tActivate: %d\n"), arg);
  71. break;
  72. case MMCN_ADD_IMAGES:
  73. wsprintf(message, _T("MMCN_ADD_IMAGES\n\tImage List: %08x\n\tScope Item: %08x\n"), arg, param);
  74. break;
  75. case MMCN_BTN_CLICK:
  76. wsprintf(message, _T("MMCN_BTN_CLICK\n\tVerb: %ws\n"), MMCN_CrackVerb((MMC_CONSOLE_VERB)param));
  77. break;
  78. case MMCN_COLUMN_CLICK:
  79. wsprintf(message, _T("MMCN_COLUMN_CLICK\n\tColumn: %d\n\tSort Option: %d\n"), arg, param);
  80. break;
  81. case MMCN_COLUMNS_CHANGED:
  82. wsprintf(message, _T("MMCN_COLUMNS_CHANGED\n"));
  83. break;
  84. case MMCN_CONTEXTHELP:
  85. wsprintf(message, _T("MMCN_CONTEXTHELP\n"));
  86. break;
  87. case MMCN_CONTEXTMENU:
  88. wsprintf(message, _T("MMCN_CONTEXTMENU\n"));
  89. break;
  90. case MMCN_CUTORMOVE:
  91. wsprintf(message, _T("MMCN_CUTORMOVE\n"));
  92. break;
  93. case MMCN_DBLCLICK:
  94. wsprintf(message, _T("MMCN_DBLCLICK\n"));
  95. break;
  96. case MMCN_DELETE:
  97. wsprintf(message, _T("MMCN_DELETE\n"));
  98. break;
  99. case MMCN_DESELECT_ALL:
  100. wsprintf(message, _T("MMCN_DESELECT_ALL\n"));
  101. break;
  102. case MMCN_EXPAND:
  103. wsprintf(message, _T("MMCN_EXPAND\n\tExpand: %d\n\tScope Item: %08x\n"), arg, param);
  104. break;
  105. case MMCN_EXPANDSYNC:
  106. wsprintf(message, _T("MMCN_EXPANDSYNC\n"));
  107. break;
  108. case MMCN_FILTERBTN_CLICK:
  109. wsprintf(message, _T("MMCN_FILTERBTN_CLICK\n\tColumn: %d\n"), arg);
  110. break;
  111. case MMCN_FILTER_CHANGE:
  112. wsprintf(message, _T("MMCN_FILTER_CHANGE\n\tColumn: %d\n"), param);
  113. break;
  114. case MMCN_HELP:
  115. wsprintf(message, _T("MMCN_HELP\n"));
  116. break;
  117. case MMCN_INITOCX:
  118. wsprintf(message, _T("MMCN_INITOCX\n\tIUnknown: %08x\n"), param);
  119. break;
  120. case MMCN_LISTPAD:
  121. wsprintf(message, _T("MMCN_LISTPAD\n\tConnect: %d\n"), arg);
  122. break;
  123. case MMCN_MENU_BTNCLICK:
  124. wsprintf(message, _T("MMCN_MENU_BTNCLICK\n"));
  125. break;
  126. case MMCN_MINIMIZED:
  127. wsprintf(message, _T("MMCN_MINIMIZED\n\tMinimized: %d\n"), arg);
  128. break;
  129. case MMCN_PASTE:
  130. wsprintf(message, _T("MMCN_PASTE\n\tCopy: %d\n"), param == NULL);
  131. break;
  132. case MMCN_PRELOAD:
  133. wsprintf(message, _T("MMCN_PRELOAD\n\tScope Item: %08x\n"), arg);
  134. break;
  135. case MMCN_PRINT:
  136. wsprintf(message, _T("MMCN_PRINT\n"));
  137. break;
  138. case MMCN_PROPERTY_CHANGE:
  139. wsprintf(message, _T("MMCN_PROPERTY_CHANGE\n\tScope: %d\n\tArg: %08x\n"), arg, param);
  140. break;
  141. case MMCN_QUERY_PASTE:
  142. wsprintf(message, _T("MMCN_QUERY_PASTE\n"));
  143. break;
  144. case MMCN_REFRESH:
  145. wsprintf(message, _T("MMCN_REFRESH\n"));
  146. break;
  147. case MMCN_REMOVE_CHILDREN:
  148. wsprintf(message, _T("MMCN_REMOVE_CHILDREN\n\tScope Item: %08x\n"), arg);
  149. break;
  150. case MMCN_RENAME:
  151. wsprintf(message, _T("MMCN_RENAME\n\tNew Name: '%ws'\n"), (LPOLESTR)param);
  152. break;
  153. case MMCN_RESTORE_VIEW:
  154. wsprintf(message, _T("MMCN_RESTORE_VIEW\n"));
  155. break;
  156. case MMCN_SELECT:
  157. wsprintf(message, _T("MMCN_SELECT\n\tScope: %d\n\tSelect: %08x\n"), LOWORD(arg), HIWORD(arg));
  158. break;
  159. case MMCN_SHOW:
  160. wsprintf(message, _T("MMCN_SHOW\n\tShow: %d\n\tScope Item: %08x\n"), arg, param);
  161. break;
  162. case MMCN_SNAPINHELP:
  163. wsprintf(message, _T("MMCN_SNAPINHELP\n"));
  164. break;
  165. case MMCN_VIEW_CHANGE:
  166. wsprintf(message, _T("MMCN_VIEW_CHANGE\n\tData: %08x\n\tHint: %08x\n"), arg, param);
  167. break;
  168. }
  169. if (message[0] != 0)
  170. OutputDebugString(message);
  171. else
  172. OutputDebugString(_T("unknown event\n"));
  173. #endif
  174. return;
  175. }