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.

182 lines
4.2 KiB

  1. // SSRTEngine.h : Declaration of the CSSRTEngine
  2. #pragma once
  3. #include "resource.h" // main symbols
  4. #include "global.h"
  5. #include "SSRLog.h"
  6. using namespace std;
  7. class CSsrFilePair;
  8. class CMemberAD;
  9. class CSsrMembership;
  10. class CSafeArray;
  11. interface ISsrActionData;
  12. class CSsrActionData;
  13. /////////////////////////////////////////////////////////////////////////////
  14. // CSSRTEngine
  15. class ATL_NO_VTABLE CSsrEngine :
  16. public CComObjectRootEx<CComSingleThreadModel>,
  17. public IDispatchImpl<ISsrEngine, &IID_ISsrEngine, &LIBID_SSRLib>
  18. {
  19. protected:
  20. CSsrEngine();
  21. virtual ~CSsrEngine();
  22. //
  23. // we don't want anyone (include self) to be able to do an assignment
  24. // or invoking copy constructor.
  25. //
  26. CSsrEngine (const CSsrEngine& );
  27. void operator = (const CSsrEngine& );
  28. DECLARE_REGISTRY_RESOURCEID(IDR_SSRTENGINE)
  29. DECLARE_PROTECT_FINAL_CONSTRUCT()
  30. BEGIN_COM_MAP(CSsrEngine)
  31. COM_INTERFACE_ENTRY(ISsrEngine)
  32. COM_INTERFACE_ENTRY(IDispatch)
  33. END_COM_MAP()
  34. // ISsrEngine
  35. public:
  36. STDMETHOD(DoActionVerb) (
  37. IN BSTR bstrActionVerb,
  38. IN LONG lActionType,
  39. IN VARIANT varFeedbackSink,
  40. IN LONG lFlag
  41. );
  42. HRESULT GetActionData (
  43. OUT ISsrActionData ** ppAD
  44. );
  45. private:
  46. //
  47. // Do a transformation for the given action.
  48. //
  49. HRESULT DoTransforms (
  50. IN SsrActionVerb lActionVerb,
  51. IN CSsrFilePair * pfp,
  52. IN OUT IXMLDOMDocument2 ** ppXmlDom,
  53. IN LONG lFlag
  54. );
  55. //
  56. // Will invoke those custom implementation for the given action.
  57. //
  58. HRESULT DoCustom (
  59. IN SsrActionVerb lActionVerb,
  60. IN LONG lActionType,
  61. IN const BSTR bstrProgID,
  62. IN VARIANT varFeedbackSink,
  63. IN LONG lFlag
  64. );
  65. //
  66. // Do memberwise transform
  67. //
  68. HRESULT DoMemberTransform (
  69. IN CSsrFilePair * pfp,
  70. IN LPCWSTR pwszXslFilesDir,
  71. IN LPCWSTR pwszResultFilesDir,
  72. IN IXMLDOMDocument2 * pXmlDOM,
  73. IN IXSLTemplate * pXslTemplate,
  74. IN LONG lFlag
  75. );
  76. //
  77. // Given the XSL file, we will do a transformation
  78. // using the input data DOM object.
  79. //
  80. HRESULT Transform (
  81. IN BSTR bstrXslPath,
  82. IN BSTR bstrResultPath,
  83. IN IXMLDOMDocument2 * pXmlDOM,
  84. IN IXSLTemplate * pXslTemplate,
  85. IN LONG lFlag
  86. );
  87. //
  88. // This is the work horse for our transformation
  89. //
  90. HRESULT PrivateTransform (
  91. IN BSTR bstrXsl,
  92. IN IXMLDOMDocument2 * pxmlDom,
  93. IN IXSLTemplate * pxslTemplate,
  94. IN LONG lFlag,
  95. OUT BSTR * pbstrResult
  96. );
  97. //
  98. // Given the scripts (pvarSAScripts) in the given
  99. // directory, we will launch them sequentially.
  100. //
  101. HRESULT RunScript (
  102. IN BSTR bstrDirPath,
  103. IN BSTR bstrScriptFile
  104. );
  105. //
  106. // see if the given file is a script file. We won't blindly
  107. // launch scripts to those files that we don't recognize
  108. //
  109. bool IsScriptFile (
  110. IN LPCWSTR pwszFileName
  111. )const;
  112. //
  113. // Will check to see if this xml policy
  114. // contains only sections we recognize.
  115. //
  116. HRESULT VerifyDOM(
  117. IN IXMLDOMDocument2 * pXmlPolicy,
  118. OUT BSTR * pbstrUnknownMember,
  119. OUT BSTR * pbstrExtraInfo
  120. );
  121. HRESULT CleanupOutputFiles(
  122. IN CSafeArray * psaMemberNames,
  123. IN SsrActionVerb lAction,
  124. IN bool bLog
  125. );
  126. //
  127. // will backup/restore the rollback files by moving them
  128. // from one place to another.
  129. //
  130. HRESULT MoveRollbackFiles(
  131. IN CSafeArray * psaMemberNames,
  132. IN LPCWSTR pwszSrcDirPath,
  133. IN LPCWSTR pwszDestDirPath,
  134. IN bool bLog
  135. );
  136. CComObject<CSsrActionData> * m_pActionData;
  137. CComObject<CSsrMembership> * m_pMembership;
  138. };