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.

99 lines
2.8 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997 - 1998
  5. //
  6. // File: ScopeAdm.hxx
  7. //
  8. // Contents: CI Scope Administration Interface
  9. //
  10. // Classes: CScopeAdm
  11. //
  12. // History: 12-10-97 mohamedn created
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. //
  17. // forward declarations
  18. //
  19. class CCatAdm;
  20. typedef CComObject<CCatAdm> CatAdmObject;
  21. //+---------------------------------------------------------------------------
  22. //
  23. // Class: CScopeAdm
  24. //
  25. // Purpose: Index Server scope administration interface
  26. //
  27. // History: 12-10-97 mohamedn created
  28. //
  29. //----------------------------------------------------------------------------
  30. class ATL_NO_VTABLE CScopeAdm :
  31. public CComObjectRootEx<CComMultiThreadModel>,
  32. public CComCoClass<CScopeAdm, &CLSID_ScopeAdm>,
  33. public ISupportErrorInfo,
  34. public IDispatchImpl<IScopeAdm, &IID_IScopeAdm, &LIBID_CIODMLib>
  35. {
  36. public:
  37. CScopeAdm() : _pICatAdm(0), _fValid(FALSE)
  38. {
  39. // do nothing
  40. }
  41. void SetParent( CatAdmObject * pICatAdm ) { _pICatAdm = pICatAdm; }
  42. void Initialize( XPtr<CScopeAdmin> & xScopeAdmin );
  43. void SetInvalid() { _fValid = FALSE; }
  44. ULONG InternalAddRef();
  45. ULONG InternalRelease();
  46. CScopeAdmin * GetScopeAdmin() { return _xScopeAdmin.GetPointer(); }
  47. void SetErrorInfo( HRESULT hRes );
  48. DECLARE_REGISTRY_RESOURCEID(IDR_SCOPEADM)
  49. BEGIN_COM_MAP(CScopeAdm)
  50. COM_INTERFACE_ENTRY(IScopeAdm)
  51. COM_INTERFACE_ENTRY(IDispatch)
  52. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  53. END_COM_MAP()
  54. // ISupportsErrorInfo
  55. STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
  56. // IScopeAdm
  57. public:
  58. //
  59. // interface methods/properties
  60. //
  61. STDMETHOD(get_Logon) ( BSTR *pVal);
  62. STDMETHOD(get_VirtualScope) ( VARIANT_BOOL *pVal);
  63. STDMETHOD(get_ExcludeScope) ( VARIANT_BOOL *pVal);
  64. STDMETHOD(put_ExcludeScope) ( VARIANT_BOOL newVal);
  65. STDMETHOD(get_Alias) ( BSTR *pVal);
  66. STDMETHOD(put_Alias) ( BSTR newVal);
  67. STDMETHOD(get_Path) ( BSTR *pVal);
  68. STDMETHOD(put_Path) ( BSTR newVal);
  69. STDMETHOD(Rescan) ( VARIANT_BOOL fFull);
  70. STDMETHOD(SetLogonInfo) ( BSTR bstrLogon, BSTR bstrPassword );
  71. private:
  72. //
  73. // utility routines
  74. //
  75. void SafeForScripting(void) { _pICatAdm->SafeForScripting(); }
  76. //
  77. // private members
  78. //
  79. CMutexSem _mtx;
  80. BOOL _fValid;
  81. CatAdmObject * _pICatAdm;
  82. XPtr<CScopeAdmin> _xScopeAdmin;
  83. };