Source code of Windows XP (NT5)
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.

186 lines
4.9 KiB

  1. #define ODS(sz) OutputDebugString(sz)
  2. #ifndef _SHELLEXT_H
  3. #define _SHELLEXT_H
  4. #define STR_GUID _T("{5a61f7a0-cde1-11cf-9113-00aa00425c62}")
  5. DEFINE_GUID(CLSID_ShellExtension, 0x5a61f7a0L, 0xcde1, 0x11cf, 0x91, 0x13, 0x00, 0xaa, 0x00, 0x42, 0x5c, 0x62 );
  6. #define STR_NAME _T("IIS Shell Extention")
  7. #define STR_THREAD_MODEL _T("Apartment")
  8. //==================================================================================
  9. // this class factory object creates context menu handlers for Windows 95 shell
  10. class CShellExtClassFactory : public IClassFactory
  11. {
  12. protected:
  13. ULONG m_cRef;
  14. public:
  15. CShellExtClassFactory();
  16. ~CShellExtClassFactory();
  17. //IUnknown members
  18. STDMETHODIMP QueryInterface(REFIID, LPVOID FAR *);
  19. STDMETHODIMP_(ULONG) AddRef();
  20. STDMETHODIMP_(ULONG) Release();
  21. //IClassFactory members
  22. STDMETHODIMP CreateInstance(LPUNKNOWN, REFIID, LPVOID FAR *);
  23. STDMETHODIMP LockServer(BOOL);
  24. };
  25. typedef CShellExtClassFactory *LPCSHELLEXTCLASSFACTORY;
  26. //==================================================================================
  27. // this is the actual OLE Shell context menu handler
  28. class CShellExt : public IShellExtInit,
  29. IShellPropSheetExt
  30. {
  31. public:
  32. TCHAR m_szPropSheetFileUserClickedOn[MAX_PATH*2];
  33. protected:
  34. ULONG m_cRef;
  35. LPDATAOBJECT m_pDataObj;
  36. public:
  37. CShellExt();
  38. ~CShellExt();
  39. //IUnknown members
  40. STDMETHODIMP QueryInterface(REFIID, LPVOID FAR *);
  41. STDMETHODIMP_(ULONG) AddRef();
  42. STDMETHODIMP_(ULONG) Release();
  43. //IShellExtInit methods
  44. STDMETHODIMP Initialize(LPCITEMIDLIST pIDFolder,
  45. LPDATAOBJECT pDataObj,
  46. HKEY hKeyID);
  47. //IShellPropSheetExt methods
  48. STDMETHODIMP AddPages(LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam);
  49. STDMETHODIMP ReplacePage(UINT uPageID,
  50. LPFNADDPROPSHEETPAGE lpfnReplaceWith,
  51. LPARAM lParam);
  52. public:
  53. // From here on down it is stuff that is specifict to the internal function of the page
  54. // unlike the routines above, these are implemented in webpg.cpp
  55. BOOL OnMessage(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
  56. void SinkNotify(
  57. /* [in] */ DWORD dwMDNumElements,
  58. /* [size_is][in] */ MD_CHANGE_OBJECT __RPC_FAR pcoChangeList[ ]);
  59. HWND m_hwnd;
  60. protected:
  61. void OnFinalRelease();
  62. BOOL OnCommand(HWND hDlg, WPARAM wParam, LPARAM lParam);
  63. // control event handling routines
  64. void OnRdoNot();
  65. void OnRdoShare();
  66. void OnAdd();
  67. void OnEdit();
  68. void OnRemove();
  69. void OnSelchangeComboServer();
  70. // control notification handling routines
  71. BOOL OnListBoxNotify(HWND hDlg, int idCtrl, WORD code, HWND hwndControl);
  72. // update the state of the server
  73. void UpdateState();
  74. // enable items as appropriate
  75. void EnableItems();
  76. // initialization
  77. void Init();
  78. BOOL InitControls();
  79. void BuildAliasList();
  80. void RecurseAddVDItems( CWrapMetaBase* pmb, LPCTSTR szMB );
  81. void EmptyList();
  82. void InitSeverInfo();
  83. BOOL InitializeSink();
  84. void TerminateSink();
  85. void ResetListContent();
  86. // access to the server-based root string
  87. void GetRootString( LPTSTR sz, DWORD cchMax );
  88. void GetVirtServerString( LPTSTR sz, DWORD cchMax );
  89. // CDialog simulation routines
  90. void UpdateData( BOOL fDialogToData );
  91. // initialize and uninitialize the metabase connections
  92. void CleanUpConnections();
  93. BOOL FInitMetabase();
  94. BOOL FCloseMetabase();
  95. // support for shutdown notification
  96. void OnTimer( UINT nIDEvent );
  97. void EnterShutdownMode();
  98. BOOL FIsW3Running();
  99. void CheckIfServerIsRunningAgain();
  100. void InspectServerList();
  101. // test if we have proper access to the metabase
  102. BOOL FIsAdmin();
  103. // the property page...
  104. HPROPSHEETPAGE m_hpage;
  105. // handles to the page's controls
  106. HWND m_icon_pws;
  107. HWND m_icon_iis;
  108. HWND m_static_share_on_title;
  109. HWND m_ccombo_server;
  110. HWND m_cbtn_share;
  111. HWND m_cbtn_not;
  112. HWND m_cstatic_alias_title;
  113. HWND m_cbtn_add;
  114. HWND m_cbtn_remove;
  115. HWND m_cbtn_edit;
  116. HWND m_clist_list;
  117. HWND m_static_status;
  118. // data from the controls
  119. int m_int_share;
  120. int m_int_server;
  121. // Server information
  122. BOOL m_fIsPWS;
  123. DWORD m_state;
  124. BOOL m_fInitialized;
  125. // sink things
  126. DWORD m_dwSinkCookie;
  127. CImpIMSAdminBaseSink* m_pEventSink;
  128. IConnectionPoint* m_pConnPoint;
  129. BOOL m_fInitializedSink;
  130. BOOL m_fShutdownMode;
  131. IMSAdminBase* m_pMBCom;
  132. CEditDirectory* m_pEditAliasDlg;
  133. };
  134. typedef CShellExt *LPCSHELLEXT;
  135. #endif //_SHELLEXT_H