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.

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