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.

77 lines
4.0 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, IUnknown* pVarSetDnMap);
  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. STDMETHOD(GetNonBaseProperties)(/*[in]*/ BSTR bstrDomainName, /*[out, retval]*/ BSTR* pbstrPropertyList);
  46. private:
  47. BOOL TranslateDNs(ADS_ATTR_INFO* pAttrInfo, DWORD dwRet, BSTR sSource, BSTR sTarget, IUnknown *pCheckList, IVarSet* pDnMap, bool *pAllocArray);
  48. HRESULT CObjPropBuilder::GetClassProperties( IADsClass * pClass, IUnknown *& pVarSet );
  49. HRESULT FillupVarsetFromVariant(IADsClass * pClass, VARIANT * pVar, BSTR sPropType, IUnknown *& pVarSet);
  50. HRESULT FillupVarsetWithProperty(BSTR sPropName, BSTR sPropType, IUnknown *& pVarSet);
  51. HRESULT FillupVarsetFromVariantArray(IADsClass * pClass, SAFEARRAY * pArray, BSTR sPropType, IUnknown *& pVarSet);
  52. void SetValuesInVarset(ADS_ATTR_INFO attrInfo, IVarSetPtr pVar);
  53. bool GetAttrInfo(_variant_t varX, const _variant_t & var, ADS_ATTR_INFO& attrInfo);
  54. bool IsPropSystemOnly(const WCHAR * sName, const WCHAR * sDomain, bool& bSystemFlag, bool* pbBaseObject = NULL);
  55. BOOL GetProgramDirectory(WCHAR * filename);
  56. static bool __stdcall GetSidAndRidFromVariant(const VARIANT& varSid, _bstr_t& strSid, _bstr_t& strRid);
  57. WCHAR m_sDomainName[255];
  58. WCHAR m_sNamingConvention[255];
  59. // cached schema search interface for IsPropSystemOnly()
  60. _bstr_t m_strSchemaDomain;
  61. CComPtr<IDirectorySearch> m_spSchemaSearch;
  62. //
  63. long m_lVer;
  64. };
  65. #endif //__OBJPROPBUILDER_H_