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.

106 lines
2.3 KiB

  1. // SSRMembership.h : Declaration of the CSSRMembership
  2. #pragma once
  3. #include "resource.h" // main symbols
  4. #include <map>
  5. #include "global.h"
  6. using namespace std;
  7. class CSsrMemberAccess;
  8. /////////////////////////////////////////////////////////////////////////////
  9. // CSsrMembership
  10. class ATL_NO_VTABLE CSsrMembership :
  11. public CComObjectRootEx<CComSingleThreadModel>,
  12. public IDispatchImpl<ISsrMembership, &IID_ISsrMembership, &LIBID_SSRLib>
  13. {
  14. protected:
  15. CSsrMembership();
  16. virtual ~CSsrMembership();
  17. //
  18. // we don't want anyone (include self) to be able to do an assignment
  19. // or invoking copy constructor.
  20. //
  21. CSsrMembership (const CSsrMembership& );
  22. void operator = (const CSsrMembership& );
  23. public:
  24. DECLARE_REGISTRY_RESOURCEID(IDR_SSRTENGINE)
  25. DECLARE_NOT_AGGREGATABLE(CSsrMembership)
  26. DECLARE_PROTECT_FINAL_CONSTRUCT()
  27. BEGIN_COM_MAP(CSsrMembership)
  28. COM_INTERFACE_ENTRY(ISsrMembership)
  29. COM_INTERFACE_ENTRY(IDispatch)
  30. END_COM_MAP()
  31. // ISsrMembership
  32. public:
  33. STDMETHOD(GetAllMembers) (
  34. OUT VARIANT * pvarArrayMembers // [out, retval]
  35. );
  36. STDMETHOD(GetMember) (
  37. IN BSTR bstrMemberName,
  38. OUT VARIANT * pvarMember //[out, retval]
  39. );
  40. STDMETHOD(GetDirectoryLocation) (
  41. IN BSTR bstrActionVerb,
  42. IN BOOL bIsScriptFile,
  43. OUT BSTR * pbstrLocPath
  44. )
  45. {
  46. SsrActionVerb lAction = SsrPGetActionVerbFromString(bstrActionVerb);
  47. if (lAction == ActionInvalid)
  48. {
  49. return E_INVALIDARG;
  50. }
  51. BSTR bstrDir = SsrPGetDirectory(lAction, bIsScriptFile);
  52. *pbstrLocPath = SysAllocString(bstrDir);
  53. HRESULT hr = S_OK;
  54. if (bstrDir == NULL)
  55. {
  56. hr = E_INVALIDARG;
  57. }
  58. else if (*pbstrLocPath == NULL)
  59. {
  60. hr = E_OUTOFMEMORY;
  61. }
  62. return hr;
  63. }
  64. CSsrMemberAccess * GetMemberByName (
  65. IN BSTR bstrMemberName
  66. );
  67. HRESULT
  68. LoadAllMember ();
  69. private:
  70. HRESULT
  71. LoadMember (
  72. IN LPCWSTR wszMemberFilePath
  73. );
  74. MapMemberAccess m_ssrMemberAccessMap;
  75. };