Source code of Windows XP (NT5)
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.

75 lines
3.6 KiB

  1. /*---------------------------------------------------------------------------
  2. File: ObjPropBuilder.h
  3. Comments: Declaration of CObjPropBuilder
  4. (c) Copyright 1999, Mission Critical Software, Inc., All Rights Reserved
  5. Proprietary and confidential to Mission Critical Software, Inc.
  6. REVISION LOG ENTRY
  7. Revision By: Sham Chauthani
  8. Revised on 07/02/99 12:40:00
  9. ---------------------------------------------------------------------------
  10. */
  11. #ifndef __OBJPROPBUILDER_H_
  12. #define __OBJPROPBUILDER_H_
  13. #include "resource.h" // main symbols
  14. //#import "\bin\mcsvarsetmin.tlb" no_namespace
  15. #import "VarSet.tlb" no_namespace rename("property", "aproperty")
  16. /////////////////////////////////////////////////////////////////////////////
  17. // CObjPropBuilder
  18. class ATL_NO_VTABLE CObjPropBuilder :
  19. public CComObjectRootEx<CComMultiThreadModel>,
  20. public CComCoClass<CObjPropBuilder, &CLSID_ObjPropBuilder>,
  21. public IObjPropBuilder
  22. {
  23. public:
  24. CObjPropBuilder()
  25. {
  26. m_lVer = -1;
  27. }
  28. DECLARE_REGISTRY_RESOURCEID(IDR_OBJPROPBUILDER)
  29. DECLARE_PROTECT_FINAL_CONSTRUCT()
  30. BEGIN_COM_MAP(CObjPropBuilder)
  31. COM_INTERFACE_ENTRY(IObjPropBuilder)
  32. END_COM_MAP()
  33. // IObjPropBuilder
  34. public:
  35. STDMETHOD(CopyNT4Props)(/*[in]*/ BSTR sSourceSam, /*[in]*/ BSTR sTargetSam, /*[in]*/ BSTR sSourceServer, /*[in]*/ BSTR sTargetServer, /*[in]*/ BSTR sType, long lGrpType, BSTR sExclude);
  36. STDMETHOD(ChangeGroupType)(/*[in]*/ BSTR sGroupPath, /*[in]*/ long lGroupType);
  37. STDMETHOD(MapProperties)(/*[in]*/ BSTR sSourceClass, /*[in]*/ BSTR sSourceDomain, long lSourceVer, /*[in]*/ BSTR sTargetClass, /*[in]*/ BSTR sTargetDomain, long lTargetVer, /*[in]*/ BOOL bIncName, /*[out]*/ IUnknown ** pUnk);
  38. STDMETHOD(SetPropertiesFromVarset)(/*[in]*/ BSTR sTargetPath, /*BSTR sTragetDomain,*/ IUnknown * pUnk, DWORD dwControl = ADS_ATTR_UPDATE);
  39. DWORD GetProperties(BSTR sObjPath, /*BSTR sDomainName, */IVarSet * pVar, ADS_ATTR_INFO*& pAttrInfo);
  40. STDMETHOD(CopyProperties)(/*[in]*/ BSTR sSourcePath, /*[in]*/ BSTR sSourceDomain, /*[in]*/ BSTR sTargetPath, /*[in]*/ BSTR sTargetDomain, /*[in]*/ IUnknown *pPropSet, /*[in]*/ IUnknown *pDBManager);
  41. STDMETHOD(GetObjectProperty)(/*[in]*/ BSTR sobjSubPath, /*[in]*/ /*BSTR sDomainName,*/ /*[in, out]*/ IUnknown ** ppVarset);
  42. STDMETHOD(GetClassPropEnum)(/*[in]*/ BSTR sClassName, /*[in]*/ BSTR sDomainName, long lVer, /*[out, retval]*/ IUnknown ** ppVarset);
  43. HRESULT SetProperties(BSTR sTargetPath, /*BSTR sTargetDomain,*/ ADS_ATTR_INFO* pAttrInfo, DWORD dwItems);
  44. STDMETHOD(ExcludeProperties)(/*[in]*/ BSTR sExclusionList, /*[in]*/ IUnknown *pPropSet, /*[out]*/ IUnknown ** ppUnk);
  45. private:
  46. BOOL TranslateDNs( ADS_ATTR_INFO * pAttrInfo, DWORD dwRet, BSTR sSource, BSTR sTarget, IUnknown *pCheckList);
  47. HRESULT CObjPropBuilder::GetClassProperties( IADsClass * pClass, IUnknown *& pVarSet );
  48. HRESULT FillupVarsetFromVariant(IADsClass * pClass, VARIANT * pVar, BSTR sPropType, IUnknown *& pVarSet);
  49. HRESULT FillupVarsetWithProperty(BSTR sPropName, BSTR sPropType, IUnknown *& pVarSet);
  50. HRESULT FillupVarsetFromVariantArray(IADsClass * pClass, SAFEARRAY * pArray, BSTR sPropType, IUnknown *& pVarSet);
  51. void SetValuesInVarset(ADS_ATTR_INFO attrInfo, IVarSetPtr pVar);
  52. bool GetAttrInfo(_variant_t varX, _variant_t var, ADS_ATTR_INFO& attrInfo);
  53. bool IsPropSystemOnly(const WCHAR * sName, const WCHAR * sDomain, bool& bSystemFlag);
  54. BOOL GetProgramDirectory(WCHAR * filename);
  55. WCHAR m_sDomainName[255];
  56. WCHAR m_sNamingConvention[255];
  57. // cached schema search interface for IsPropSystemOnly()
  58. _bstr_t m_strSchemaDomain;
  59. CComPtr<IDirectorySearch> m_spSchemaSearch;
  60. //
  61. long m_lVer;
  62. };
  63. #endif //__OBJPROPBUILDER_H_