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.

212 lines
5.3 KiB

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