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.

131 lines
3.3 KiB

  1. /*++
  2. Copyright (c) 2000-2001 Microsoft Corporation
  3. Module Name:
  4. SiteCreator.h
  5. Abstract:
  6. Definition of:
  7. CSiteCreator
  8. The public methods are thread-safe.
  9. Author:
  10. Mohit Srivastava 21-Mar-2001
  11. Revision History:
  12. --*/
  13. #ifndef __sitecreator_h__
  14. #define __sitecreator_h__
  15. #if _MSC_VER > 1000
  16. #pragma once
  17. #endif
  18. #include <windows.h>
  19. #include <atlbase.h>
  20. #include <iadmw.h>
  21. #include <iwamreg.h>
  22. #include "SafeCS.h"
  23. typedef /* [v1_enum] */
  24. enum tag_SC_SUPPORTED_SERVICES
  25. {
  26. SC_W3SVC = 1,
  27. SC_MSFTPSVC = 2
  28. } eSC_SUPPORTED_SERVICES;
  29. struct TService
  30. {
  31. eSC_SUPPORTED_SERVICES eId;
  32. LPCWSTR wszMDPath;
  33. ULONG cchMDPath;
  34. LPCWSTR wszServerKeyType;
  35. ULONG cchServerKeyType;
  36. LPCWSTR wszServerVDirKeyType;
  37. ULONG cchServerVDirKeyType;
  38. };
  39. struct TServiceData
  40. {
  41. static TService W3Svc;
  42. static TService MSFtpSvc;
  43. static TService* apService[];
  44. };
  45. //
  46. // CSiteCreator
  47. //
  48. class CSiteCreator
  49. {
  50. public:
  51. CSiteCreator();
  52. CSiteCreator(
  53. IMSAdminBase* pIABase);
  54. virtual ~CSiteCreator();
  55. HRESULT STDMETHODCALLTYPE CreateNewSite(
  56. /* [in] */ eSC_SUPPORTED_SERVICES eServiceId,
  57. /* [in] */ LPCWSTR wszServerComment,
  58. /* [out] */ PDWORD pdwSiteId,
  59. /* [in] */ PDWORD pdwRequestedSiteId=NULL);
  60. HRESULT STDMETHODCALLTYPE CreateNewSite2(
  61. /* [in] */ eSC_SUPPORTED_SERVICES eServiceId,
  62. /* [in] */ LPCWSTR wszServerComment,
  63. /* [in] */ LPCWSTR mszServerBindings,
  64. /* [in] */ LPCWSTR wszPathOfRootVirtualDir,
  65. /* [in] */ IIISApplicationAdmin* pIApplAdmin,
  66. /* [out] */ PDWORD pdwSiteId,
  67. /* [in] */ PDWORD pdwRequestedSiteId=NULL);
  68. private:
  69. HRESULT InternalInitIfNecessary();
  70. HRESULT InternalCreateNewSite(
  71. eSC_SUPPORTED_SERVICES i_eServiceId,
  72. LPCWSTR i_wszServerComment,
  73. LPCWSTR i_mszServerBindings,
  74. LPCWSTR i_wszPathOfRootVirtualDir,
  75. IIISApplicationAdmin* i_pIApplAdmin,
  76. PDWORD o_pdwSiteId,
  77. PDWORD i_pdwRequestedSiteId=NULL);
  78. HRESULT InternalSetData(
  79. METADATA_HANDLE i_hMD,
  80. LPCWSTR i_wszPath,
  81. DWORD i_dwIdentifier,
  82. LPBYTE i_pData,
  83. DWORD i_dwNrBytes,
  84. DWORD i_dwAttributes,
  85. DWORD i_dwDataType,
  86. DWORD i_dwUserType
  87. );
  88. HRESULT InternalCreateNode(
  89. TService* i_pService,
  90. LPCWSTR i_wszServerComment,
  91. PMETADATA_HANDLE o_phService,
  92. PDWORD o_pdwSiteId,
  93. const PDWORD i_pdwRequestedSiteId=NULL);
  94. HRESULT SetAdminACL(
  95. METADATA_HANDLE hW3Svc,
  96. LPCWSTR szKeyPath);
  97. DWORD GetMajorVersion(METADATA_HANDLE hKey);
  98. CSafeAutoCriticalSection m_SafeCritSec;
  99. CComPtr<IMSAdminBase> m_spIABase;
  100. bool m_bInit;
  101. };
  102. #endif // __sitecreator_h__