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.

150 lines
6.4 KiB

  1. // IISSCO50.h : Declaration of the CIISSCO50
  2. #ifndef __IISSCO50_H_
  3. #define __IISSCO50_H_
  4. #include "resource.h" // main symbols
  5. #include <map> // Used for enum property key value pairs
  6. #include <string> // Used in parseBSTR and AddBackSlashesToString
  7. using namespace std;
  8. typedef map<CComBSTR,CComBSTR> Map;
  9. enum IIsAction { start, stop, pause }; // Actions related to start/stopping webs
  10. /////////////////////////////////////////////////////////////////////////////
  11. // CIISSCO50
  12. class ATL_NO_VTABLE CIISSCO50 :
  13. public CComCoClass<CIISSCO50, &CLSID_IISSCO50>,
  14. public CProvProviderBase<&LIBID_IISSCOV50Lib>
  15. {
  16. public:
  17. //Declarations of functions for EnumConfigRecursive Action
  18. HRESULT EnumConfigRecursive_Execute(IXMLDOMNode *pXMLNode);
  19. //Declarations of functions for EnumConfigRecursive Action
  20. //HRESULT EnumConfigRecursive_Execute(IXMLDOMNode *pXMLNode);
  21. //Declarations of functions for EnumConfig Action
  22. HRESULT EnumConfig_Execute(IXMLDOMNode *pXMLNode);
  23. //Declarations of functions for GetConfigProperty Action
  24. HRESULT GetConfigProperty_Execute(IXMLDOMNode *pXMLNode);
  25. //Declarations of functions for SetConfigProperty Action
  26. HRESULT SetConfigProperty_Execute(IXMLDOMNode *pXMLNode);
  27. HRESULT SetConfigProperty_Rollback(IXMLDOMNode *pXMLNode);
  28. //Declarations of functions for DeleteVDir Action
  29. HRESULT DeleteVDir_Execute(IXMLDOMNode *pXMLNode);
  30. HRESULT DeleteVDir_Rollback(IXMLDOMNode *pXMLNode);
  31. //Declarations of functions for CreateVDir Action
  32. HRESULT CreateVDir_Execute(IXMLDOMNode *pXMLNode);
  33. HRESULT CreateVDir_Rollback(IXMLDOMNode *pXMLNode);
  34. //Declarations of functions for DeleteFTPSite Action
  35. HRESULT DeleteFTPSite_Execute(IXMLDOMNode *pXMLNode);
  36. HRESULT DeleteFTPSite_Rollback(IXMLDOMNode *pXMLNode);
  37. //Declarations of functions for CreateFTPSite Action
  38. HRESULT CreateFTPSite_Execute(IXMLDOMNode *pXMLNode);
  39. HRESULT CreateFTPSite_Rollback(IXMLDOMNode *pXMLNode);
  40. //Declarations of functions for DeleteWebSite Action
  41. HRESULT DeleteWebSite_Execute(IXMLDOMNode *pXMLNode);
  42. HRESULT DeleteWebSite_Rollback(IXMLDOMNode *pXMLNode);
  43. //Declarations of functions for CreateWebSite Action
  44. HRESULT CreateWebSite_Execute(IXMLDOMNode *pXMLNode);
  45. HRESULT CreateWebSite_Rollback(IXMLDOMNode *pXMLNode);
  46. DECLARE_REGISTRY_RESOURCEID(IDR_IISSCO50)
  47. DECLARE_GET_CONTROLLING_UNKNOWN()
  48. DECLARE_PROTECT_FINAL_CONSTRUCT()
  49. BEGIN_COM_MAP(CIISSCO50)
  50. COM_INTERFACE_ENTRY(IProvProvider)
  51. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  52. END_COM_MAP()
  53. HRESULT FinalConstruct();
  54. //Mapping Action/Rollback to NameSpaces.
  55. BEGIN_ACTION_MAP(CIISSCO50)
  56. //
  57. ACTION_MAP_ENTRY_NOROLLBACK("EnumConfigRecursive", EnumConfigRecursive_Execute)
  58. ACTION_MAP_ENTRY_NOROLLBACK("EnumConfig", EnumConfig_Execute)
  59. ACTION_MAP_ENTRY_NOROLLBACK("GetConfigProperty", GetConfigProperty_Execute)
  60. ACTION_MAP_ENTRY("SetConfigProperty", SetConfigProperty_Execute, SetConfigProperty_Rollback)
  61. ACTION_MAP_ENTRY("DeleteVDir", DeleteVDir_Execute, DeleteVDir_Rollback)
  62. ACTION_MAP_ENTRY("CreateVDir", CreateVDir_Execute, CreateVDir_Rollback)
  63. ACTION_MAP_ENTRY("DeleteFTPSite", DeleteFTPSite_Execute, DeleteFTPSite_Rollback)
  64. ACTION_MAP_ENTRY("CreateFTPSite", CreateFTPSite_Execute, CreateFTPSite_Rollback)
  65. ACTION_MAP_ENTRY("DeleteWebSite", DeleteWebSite_Execute, DeleteWebSite_Rollback)
  66. ACTION_MAP_ENTRY("CreateWebSite", CreateWebSite_Execute, CreateWebSite_Rollback)
  67. // ACTION_MAP_ENTRY("SignupUser", Action1, Rollback1)
  68. // ACTION_MAP_ENTRY_NOROLLBACK("UnsubscribeUser", Action2)
  69. // ACTION_MAP_ENTRY_TWOPHASE("CreateOrg", Action3, Rollback3, Prepare3,
  70. // Commit3)
  71. END_ACTION_MAP()
  72. private:
  73. // Used with IIsScoLogFailure(failstring) macro
  74. HINSTANCE g_ErrorModule;
  75. // adsi helper methods used by SCO action handlers
  76. HRESULT GetMetaPropertyValue(CComPtr<IADs> pADs, CComBSTR bstrName, CComBSTR& pVal);
  77. HRESULT SetMetaPropertyValue(CComPtr<IADs> pADs, CComBSTR bstrName, CComBSTR bstrValue);
  78. HRESULT DeleteMetaPropertyValue(CComPtr<IADs> pADs, CComBSTR bstrName);
  79. HRESULT CreateIIs50Site(CComBSTR bstrType,CComBSTR bADsPath,
  80. CComBSTR bServerNumber, CComBSTR &bstrConfigPath);
  81. HRESULT DeleteIIs50Site(CComBSTR bstrType,CComBSTR bADsPath,CComBSTR bServerNumber);
  82. HRESULT CreateIIs50VDir(CComBSTR bstrType,CComBSTR bADsPath, CComBSTR bVDirName,
  83. CComBSTR bAppFriendName, CComBSTR bVDirPath,CComBSTR &bstrConfigPath);
  84. HRESULT DeleteIIs50VDir(CComBSTR bstrType,CComBSTR bADsPath,CComBSTR bVDirName);
  85. HRESULT SetVDirProperty(CComPtr<IADs> pADs, CComBSTR bVDirProperty,CComBSTR bVDirValue);
  86. HRESULT EnumPropertyValue(CComBSTR bstrPath, CComBSTR bstrIsInHerit, Map& mVar);
  87. HRESULT EnumPaths(BOOL bRecursive, CComBSTR bstrPath, Map& mVar);
  88. BOOL EnumIsSet(CComPtr<IISBaseObject> pBase, CComBSTR bstrPath, CComBSTR bstrProperty);
  89. // misc adsi helper methods
  90. HRESULT IIsServerAction(CComBSTR bADsPath,IIsAction action);
  91. HRESULT ParseBSTR(CComBSTR bString,CComBSTR sDelim, int iFirstPiece, int iLastPiece,CComBSTR &pVal);
  92. void AddBackSlashesToString(CComBSTR& bString);
  93. HRESULT GetNextIndex(CComBSTR bstrPath, CComBSTR& pIndex);
  94. HRESULT CheckBindings(CComBSTR bADsPath, CComBSTR bstrNewBindings);
  95. HRESULT CreateBindingString(CComBSTR bstrIP,CComBSTR bstrPort,
  96. CComBSTR bstrHostName,CComBSTR& bstrString);
  97. BOOL IsPositiveInteger(CComBSTR bstrPort);
  98. BOOL StringCompare(CComBSTR bstrString1, CComBSTR bstrString2);
  99. int NumberOfDelims(CComBSTR& bString, CComBSTR sDelim);
  100. // xml helper methods used by SCO action handlers above
  101. HRESULT GetInputParam(CComPtr<IXMLDOMNode> pNode, CComBSTR elementName, CComBSTR& pVal);
  102. HRESULT GetInputAttr(CComPtr<IXMLDOMNode> pNode, CComBSTR elementName, CComBSTR AttributeName, CComBSTR& pVal);
  103. HRESULT PutElement(CComPtr<IXMLDOMNode> pNode, CComBSTR elementName, CComBSTR newVal);
  104. HRESULT AppendElement(CComPtr<IXMLDOMNode> pNode, CComBSTR xmlString,CComPtr<IXMLDOMNode>& pNewNode);
  105. HRESULT GetNodeLength(CComPtr<IXMLDOMNode> pTopNode, CComBSTR elementName, long *lLength);
  106. HRESULT GetElementValueByAttribute(CComPtr<IXMLDOMNode> pTopNode,CComBSTR elementName,
  107. CComBSTR attributeName, CComBSTR& pVal);
  108. };
  109. #endif //__IISSCO50_H_