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.

109 lines
4.3 KiB

  1. #pragma once
  2. #include "globals.h"
  3. #include "delebase.h"
  4. #include <map>
  5. using namespace std;
  6. enum ConnectMode
  7. {
  8. CM_Reader = 0,
  9. CM_Writer,
  10. CM_Both
  11. };
  12. struct WebServerData
  13. {
  14. CDelegationBase *pBase;
  15. tstring szName;
  16. ConnectMode connectMode;
  17. };
  18. typedef map<tstring, tstring> CPropertyMap;
  19. class CUDDISiteNode;
  20. class CUDDIWebServerNode : public CDelegationBase
  21. {
  22. friend class CUDDISiteNode;
  23. public:
  24. CUDDIWebServerNode( const _TCHAR *szName, int id, CUDDISiteNode* parent, BOOL bExtension );
  25. virtual ~CUDDIWebServerNode();
  26. static BOOL IsWebServer( const WCHAR *pwszName );
  27. static BOOL IsAssignedToSite( const tstring& szWebServer, const ConnectMode& cm, tstring& szSite );
  28. static BOOL GetReaderConnectionString( const tstring& szName, tstring &szReader );
  29. static BOOL GetWriterConnectionString( const tstring& szName, tstring &szWriter );
  30. static BOOL SetReaderConnectionString( const tstring& szName, const tstring& szReader );
  31. static BOOL SetWriterConnectionString( const tstring& szName, const tstring& szWriter );
  32. static void CrackConnectionString( const tstring& strConnection, tstring& strDomain, tstring& strServer, tstring& strInstance );
  33. static tstring BuildConnectionString( const wstring& strComputer );
  34. static BOOL GetDBSchemaVersion( const wstring& strComputer, wstring& strVersion );
  35. static BOOL CALLBACK NewWebServerDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
  36. HRESULT GetData();
  37. HRESULT SaveData();
  38. BOOL Start();
  39. BOOL Stop();
  40. BOOL SetRunState( BOOL bStart );
  41. const BOOL IsRunning();
  42. const LPCTSTR GetName();
  43. BOOL GetDBSchemaVersion( tstring& szVersion );
  44. virtual const _TCHAR *GetDisplayName(int nCol = 0);
  45. virtual const GUID & getNodeType() { return thisGuid; }
  46. virtual const int GetBitmapIndex() { return INDEX_WEBSERVER; }
  47. virtual BOOL HasChildren() { return FALSE; }
  48. virtual BOOL ChildExists( const WCHAR *pwszName );
  49. BOOL IsDeleted() { return m_isDeleted; }
  50. void DeleteFromScopePane( IConsoleNameSpace *pConsoleNameSpace );
  51. //
  52. // Virtual functions go here (for MMCN_*)
  53. //
  54. virtual HRESULT OnAddMenuItems( IContextMenuCallback *pContextMenuCallback, long *pInsertionsAllowed );
  55. virtual HRESULT OnMenuCommand( IConsole *pConsole, IConsoleNameSpace *pConsoleNameSpace, long lCommandID, IDataObject *pDataObject );
  56. virtual HRESULT OnSelect(CComponent *pComponent, IConsole *pConsole, BOOL bScope, BOOL bSelect);
  57. virtual HRESULT OnPropertyChange(IConsole *pConsole, CComponent *pComponent);
  58. virtual HRESULT OnUpdateItem(IConsole *pConsole, long item, ITEM_TYPE itemtype);
  59. virtual HRESULT OnRefresh(IConsole *pConsole);
  60. virtual HRESULT OnDelete( IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsoleComp);
  61. virtual HRESULT OnSetToolbar( IControlbar *pControlbar, IToolbar *pToolbar, BOOL bScope, BOOL bSelect );
  62. virtual HRESULT OnToolbarCommand( IConsole *pConsole, MMC_CONSOLE_VERB verb, IDataObject *pDataObject );
  63. virtual HRESULT OnShowContextHelp(IDisplayHelp *pDisplayHelp, LPOLESTR helpFile);
  64. virtual HRESULT CreatePropertyPages(IPropertySheetCallback *lpProvider, LONG_PTR handle);
  65. virtual HRESULT HasPropertySheets();
  66. virtual HRESULT GetWatermarks(HBITMAP *lphWatermark, HBITMAP *lphHeader, HPALETTE *lphPalette, BOOL *bStretch );
  67. private:
  68. static const GUID thisGuid;
  69. enum WEBSERVER_STATUS { RUNNING, STOPPED } m_nStatus;
  70. enum menuItems { IDM_WEBSERVER_START = 1, IDM_WEBSERVER_STOP = 2 };
  71. BOOL m_bStdSvr;
  72. _TCHAR* m_szName;
  73. int m_nId;
  74. LONG_PTR m_ppHandle;
  75. CUDDISiteNode *m_pParent;
  76. BOOL m_isDeleted;
  77. CPropertyMap m_mapProperties;
  78. CPropertyMap m_mapChanges;
  79. IToolbar *m_pToolbar;
  80. BOOL m_isScopeItem;
  81. BOOL m_fDeleteFromScopePane;
  82. tstring m_strDisplayName;
  83. HWND m_hwndPropSheet;
  84. static BOOL CALLBACK GeneralDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
  85. static BOOL CALLBACK DatabaseConnectionDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
  86. static BOOL CALLBACK LoggingDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
  87. HRESULT UpdateScopePaneItem( IConsole *pConsole, HSCOPEITEM item );
  88. HRESULT UpdateResultPaneItem( IConsole *pConsole, HRESULTITEM item );
  89. BOOL IsW3SvcRunning();
  90. };