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.

129 lines
4.6 KiB

  1. //
  2. // Global variables
  3. //
  4. extern LONG g_cRefThisDll;
  5. extern HINSTANCE g_hInstance;
  6. extern HINSTANCE g_hUIInstance;
  7. extern GUID g_guidSnapinExt;
  8. extern GUID g_guidClientExt;
  9. extern CRITICAL_SECTION g_LayoutCriticalSection;
  10. extern CRITICAL_SECTION g_ContextMenuCriticalSection;
  11. // Constants/macros
  12. #define IEAK_SUBDIR TEXT("MICROSOFT\\IEAK")
  13. #define INS_NAME TEXT("install.ins")
  14. #define HELP_FILENAME L"ieakmmc.chm"
  15. // Snapin extension guid
  16. // {FC715823-C5FB-11D1-9EEF-00A0C90347FF}
  17. DEFINE_GUID(CLSID_IEAKSnapinExt,0xFC715823,0xC5FB,0x11D1,0x9E,0xEF,0x00,0xA0,0xC9,0x03,0x47,0xFF);
  18. // {D524927D-6C08-46bf-86AF-391534D779D3}
  19. DEFINE_GUID(CLSID_IEAKRSoPSnapinExt,0xd524927d,0x6c08,0x46bf,0x86,0xaf,0x39,0x15,0x34,0xd7,0x79,0xd3);
  20. // Client extension guid
  21. // {A2E30F80-D7DE-11d2-BBDE-00C04F86AE3B}
  22. DEFINE_GUID(CLSID_IEAKClientExt, 0xA2E30F80, 0xD7DE, 0x11d2, 0xBB, 0xDE, 0x00, 0xC0, 0x4F, 0x86, 0xAE, 0x3B);
  23. //
  24. // Functions to create class factories
  25. //
  26. HRESULT CreateComponentDataClassFactory (REFCLSID rclsid, REFIID riid, LPVOID* ppv);
  27. class CSnapIn;
  28. #include "cookie.h"
  29. //
  30. // SnapIn class
  31. //
  32. class CSnapIn:
  33. public IComponent,
  34. public IExtendPropertySheet,
  35. public IExtendContextMenu
  36. {
  37. protected:
  38. ULONG m_cRef;
  39. LPCONSOLE m_pConsole; // Console's IFrame interface
  40. CComponentData *m_pcd;
  41. LPRESULTDATA m_pResult; // Result pane's interface
  42. LPHEADERCTRL m_pHeader; // Result pane's header control interface
  43. LPIMAGELIST m_pImageResult; // Result pane's image list interface
  44. LPDISPLAYHELP m_pDisplayHelp; // IDisplayHelp interface
  45. LPCONSOLEVERB m_pConsoleVerb; // pointer the console verb
  46. TCHAR m_szColumn1[32]; // Text for column 1
  47. TCHAR m_szColumn2[32]; // Text for column 2
  48. INT m_nColumnSize1; // Size of column 1
  49. INT m_nColumnSize2; // Size of column 2
  50. LONG m_lViewMode; // View mode
  51. TCHAR m_szInsFile[MAX_PATH]; // current path to ins file in current GPO
  52. LPIEAKMMCCOOKIE m_lpCookieList; // list of cookies we allocated
  53. BOOL m_fOneTimeApply; // flag on whether to apply GPO once or always
  54. static unsigned int m_cfNodeType;
  55. public:
  56. CSnapIn(CComponentData *pComponent);
  57. ~CSnapIn();
  58. //
  59. // RSoP implementation methods
  60. //
  61. BOOL IsRSoP() {return m_pcd->IsRSoP();}
  62. BSTR GetRSoPNamespace() {return m_pcd->GetRSoPNamespace();}
  63. STDMETHODIMP SignalPolicyChanged(BOOL bMachine, BOOL bAdd, GUID *pGuidExtension,
  64. GUID *pGuidSnapin);
  65. STDMETHODIMP_(LPCTSTR) GetInsFile();
  66. STDMETHODIMP_(CComponentData *) GetCompData() {return m_pcd;}
  67. //
  68. // IUnknown methods
  69. //
  70. STDMETHODIMP QueryInterface(REFIID, LPVOID FAR *);
  71. STDMETHODIMP_(ULONG) AddRef();
  72. STDMETHODIMP_(ULONG) Release();
  73. //
  74. // Implemented IComponent methods
  75. //
  76. STDMETHODIMP Initialize(LPCONSOLE lpConsole);
  77. STDMETHODIMP Destroy(MMC_COOKIE cookie);
  78. STDMETHODIMP Notify(LPDATAOBJECT lpDataObject, MMC_NOTIFY_TYPE event, LPARAM arg, LPARAM param);
  79. STDMETHODIMP QueryDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES type, LPDATAOBJECT *ppDataObject);
  80. STDMETHODIMP GetDisplayInfo(LPRESULTDATAITEM pResult);
  81. STDMETHODIMP GetResultViewType(MMC_COOKIE cookie, LPOLESTR *ppViewType, long *pViewOptions);
  82. STDMETHODIMP CompareObjects(LPDATAOBJECT lpDataObjectA, LPDATAOBJECT lpDataObjectB);
  83. //
  84. // Implemented IExtendPropertySheet methods
  85. //
  86. STDMETHODIMP CreatePropertyPages(LPPROPERTYSHEETCALLBACK lpProvider,
  87. LONG_PTR handle, LPDATAOBJECT lpDataObject);
  88. STDMETHODIMP QueryPagesFor(LPDATAOBJECT lpDataObject);
  89. //
  90. // Implemented IExtendContextMenu methods
  91. //
  92. STDMETHODIMP AddMenuItems(LPDATAOBJECT lpDataObject,
  93. LPCONTEXTMENUCALLBACK piCallback, long *pInsertionAllowed);
  94. STDMETHODIMP Command(long lCommandID, LPDATAOBJECT lpDataObject);
  95. private:
  96. HRESULT AddPrecedencePropPage(LPPROPERTYSHEETCALLBACK lpProvider,
  97. LPPROPSHEETCOOKIE lpPropSheetCookie,
  98. LPCTSTR pszTitle, long nPageID);
  99. };