// DfsCore.idl : IDL source for DfsCore.dll // // --------------------------------------------------------------------------- // This idl file contains definitions for the following objects and their interfaces: // DfsRoot // IDfsRoot // DfsJunctionPoint // IDfsJunctionPoint // DfsReplica // IDfsReplica // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- // OVERVIEW // --------------------------------------------------------------------------- // You can use the objects in this file for performing DFS related operations import "oaidl.idl"; import "ocidl.idl"; //////////////////////////////////////////////////////////////////////////////////// // Interface IDfsRoot //////////////////////////////////////////////////////////////////////////////////// // Use this object for managing DfsRoots. // // To use the interface IDfsRoot, you must first call initialize, before you can use // any of the properties / methods. // The properties that are supported by IDfsRoot are - // DomainName - The Domain Name of the domain, of which the server is a member. // DfsType - The type of the DfsRoot viz. StandAlone or Fault Tolerant. // State - Specifies whether the Dfs is Online or Offline. // DfsName - The name of the DfsRoot. // Comment - The comment associated with the DfsRoot // To Enumerate the child Junction points in the DfsRoot - // 0. Call put_EnumFilter to "JunctionPoint". // 1. Use _NewEnum to get an IEnumVARIANT*. // 2. Using the IEnumVariant::Next function, you can get a pointer to the IDfsJunctionPoint // interface. // Call 2 successively to get the next junction point object, till there are no more // junction points to be enumerated. // To Enumerate the Root Level Replicas in the JunctionPoint - // 0. Call put_EnumFilter to "Replica". // 1. Use _NewEnum to get an IEnumVARIANT*. // 2. Using the IEnumVariant::Next function, you can get a pointer to the IDfsReplica // interface. // Call 2 successively to get the next Replica object, till there are no more // Replicas to be enumerated. // // Note that if you have created the DfsRoot object yourself, then you need to call its // Initialize() method before you can use any of its properties / methods. // // To create a Junction point - // Call NewDfsJunctionPoint passing the following parameters - // i_pszEntryPath - The entry path for the new junction point. // i_pszServerName - The server name on which the new junction // point is to be created. // i_pszShareName - The share that the junction point should point to. // o_pIDfsJunctionPoint - Address of a VARIANT structure in which the IJunctionPoint // pointer of the newly created junction point object will be // returned. // To delete a Junction Point // Call DeleteJunctionPoint, passing the entry path for the junction point to be deleted // as a parameter. [ object, uuid(A741D3FA-31BE-11D1-9A4A-0080ADAA5C4B), dual, helpstring("IDfsRoot Interface"), pointer_default(unique) ] interface IDfsRoot : IDispatch { [propget, id(1), helpstring("property DfsName")] HRESULT DfsName ( [out, retval] BSTR *pVal ); [propget, id(2), helpstring("property DfsType")] HRESULT DfsType ([ out, retval] long *pVal ); [propget, id(3), helpstring("Gets the Root Entry Path for the DfsRoot.")] HRESULT RootEntryPath ( BSTR * pVal ); [propget, id(4), helpstring("property State")] HRESULT State ( [out, retval] long *pVal ); [propget, id(5), helpstring("DfsRoot Comment")] HRESULT Comment ( [out, retval] BSTR *pVal ); [propput, id(5), helpstring("DfsRoot Comment")] HRESULT Comment ( [in] BSTR newVal ); [propget, id(6), helpstring("Gets the timeout of the Junciton Point")] HRESULT Timeout ( [out, retval] long *pVal ); [propput, id(6), helpstring("Puts the timeout of the Junciton Point")] HRESULT Timeout ( [in] long newVal ); [propget, id(7), helpstring("property DomainName")] HRESULT DomainName ( [out, retval] BSTR *pVal ); [propget, id(8), helpstring("property DomainGuid")] HRESULT DomainGuid ( [out, retval] BSTR *pVal ); [propget, id(9), helpstring("property DomainDN")] HRESULT DomainDN ( [out, retval] BSTR *pVal ); [propget, id(10), helpstring("property ReplicaSetDN")] HRESULT ReplicaSetDN ( [out, retval] BSTR *pVal ); [propget, id(11), helpstring("property ReplicaSetExist")] HRESULT ReplicaSetExist ( [out, retval] BOOL *pVal ); [propput, id(11), helpstring("property ReplicaSetExist")] HRESULT ReplicaSetExist ( [in] BOOL newVal ); [propget, id(12), helpstring("property CountOfDfsJunctionPoints")] HRESULT CountOfDfsJunctionPoints ( [out, retval] long *pVal ); [propget, id(13), helpstring("property CountOfDfsJunctionPointsFiltered")] HRESULT CountOfDfsJunctionPointsFiltered ( [out, retval] long *pVal ); [propget, id(14), helpstring("property CountOfDfsRootReplicas")] HRESULT CountOfDfsRootReplicas ( [out, retval] long *pVal ); [propget, id(15), helpstring("Gets the type of Enumeration Filter on junction points.")] HRESULT EnumFilterType ( [out, retval] long* pVal ); [propput, id(15), helpstring("Sets the type of Enumeration Filter on junction points.")] HRESULT EnumFilterType ( [in] long newVal ); [propget, id(16), helpstring("Gets the Enumeration Filter on junction points.")] HRESULT EnumFilter ( [out, retval] BSTR* pVal ); [propput, id(16), helpstring("Sets the Enumeration Filter on junction points.")] HRESULT EnumFilter ( [in] BSTR newVal ); [propget, restricted, id(DISPID_NEWENUM), helpstring("Gets the enumerator on junction points.")] HRESULT _NewEnum ( [out, retval] IUnknown** ppEnumerator ); [id(17), helpstring("Gets the enumerator on root replicas.")] HRESULT get_RootReplicaEnum ( [out, retval] IUnknown** ppEnumerator ); [id(18), helpstring("method Initialize")] HRESULT Initialize ( [in] BSTR i_pszDfsName ); [id(19), helpstring("Creates a New Dfs Junction Point.")] HRESULT CreateJunctionPoint ( [in] BSTR i_pszJPName, [in] BSTR i_pszServerName, [in] BSTR i_pszShareName, [in] BSTR i_pszComment, [in] long i_lTimeout, [out]VARIANT *o_pIDfsJunctionPoint ); [id(20), helpstring("Deletes a Junction Point.")] HRESULT DeleteJunctionPoint ( [in] BSTR i_pszEntryPath ); [id(21), helpstring("Deletes a Dfs root replica.")] HRESULT DeleteDfsHost ( [in] BSTR i_bstrServerName, [in] BSTR i_bstrShareName, [in] BOOL i_bForce ); [id(22), helpstring("Get info of a Dfs root replica")] HRESULT GetOneDfsHost ( [out] BSTR* o_pbstrServerName, [out] BSTR* o_pbstrShareName ); [id(23), helpstring("Is JP existed")] HRESULT IsJPExisted ( [in] BSTR i_bstrJPName ); [id(24), helpstring("Refresh Root Replicas")] HRESULT RefreshRootReplicas ( ); [id(25), helpstring("Get interface pointer to the Root JP")] HRESULT GetRootJP ( [out]VARIANT *o_pIDfsJunctionPoint ); [id(26), helpstring("Delete all replica sets related to this Dfs root")] HRESULT DeleteAllReplicaSets ( ); [id(27), helpstring("refresh bReplicaSetExist and retrieve its value")] HRESULT get_ReplicaSetExistEx ( [out] BSTR *pbstrDC, [out] BOOL *pVal ); }; //////////////////////////////////////////////////////////////////////////////////// // Interface IDfsReplica //////////////////////////////////////////////////////////////////////////////////// // Use this object to manage Replicas (or Alternates). // To use the interface IDfsReplica, you must first call initialize, before you can use // any of its properties / methods. // Call Initialize with the following parameters - // i_szEntryPath - The Entry path to the Replica that you wish to manage. // i_szStorageServerName - The name of the Server pointed to by this replica, // on which the actual storage resides. // i_szStorageShareName - The name of the share on the above mentioned server to // which this replica points. // The properties that are supported by IDfsReplica are - // State - Specifies whether the Dfs is Online or Offline. // StorageServerName - The name of the server pointed to by the Replica which hosts // the actual data storage. // StorageShareName - The share on the server which hosts the actual data storage. // EntryPath - The Domain Name of the domain, of which the server is a member. // Note that if you have created the DfsReplica object yourself, then you need to call its // initialize method before you can use any of its properties / methods. // In case you get an IDfsReplica pointer from an enumeration on a JunctionPoint object, // then Initialize has already been called, and you can start using it right away. [ object, uuid(A741D3FD-31BE-11D1-9A4A-0080ADAA5C4B), dual, helpstring("IDfsReplica Interface"), pointer_default(unique) ] interface IDfsReplica : IDispatch { [propget, id(1), helpstring("property EntryPath")] HRESULT EntryPath ( [out, retval] BSTR *pVal ); [propget, id(2), helpstring("Gets the state of the Replica.")] HRESULT State ( [out, retval] long *pVal ); [propput, id(2), helpstring("Sets the state of the Replica.")] HRESULT State ( [in] long newVal ); [propget, id(3), helpstring("property StorageServerName")] HRESULT StorageServerName ( [out, retval] BSTR *pVal ); [propget, id(4), helpstring("property StorageShareName")] HRESULT StorageShareName ( [out, retval] BSTR *pVal ); [id(5), helpstring("method Initialize")] HRESULT Initialize ( [in] BSTR i_szEntryPath, [in] BSTR i_szStorageServerName, [in] BSTR i_szStorageShareName, [in] long i_lState ); [id(6), helpstring("FindTarget")] HRESULT FindTarget ( ); }; //////////////////////////////////////////////////////////////////////////////////// // Interface IDfsJunctionPoint //////////////////////////////////////////////////////////////////////////////////// // Use this object for managing Junction Points. // // To use the interface IDfsJunctionPoint, you must first call initialize, before you // can use any of its properties / methods. // // Call Initialize with the EntryPath of the junction point as the parameter. // // The properties that are supported by IDfsJunctionPoint are - // State - Specifies whether the Junction Point is Online or Offline. // EntryPath - The Entry Path for the Junction point. // JunctionName - The name of the Junction point. // Comment - Any comment that you wish to associate with the Junction point. // CountOfDfsReplicas - // The number of Replicas that are hosted by this Junction Point. // To Enumerate the Replicas in the JunctionPoint - // 1. Use _NewEnum to get an IEnumVARIANT*. // 2. Using the IEnumVariant::Next function, you can get a pointer to the IDfsReplica // interface. // Call 2 successively to get the next Replica object, till there are no more // Replicas to be enumerated. // // Note that if you have created the DfsJunctionPoint object yourself, then you need // to call its initialize method before you can use any of its properties / methods. // [ object, uuid(A741D3FF-31BE-11D1-9A4A-0080ADAA5C4B), dual, helpstring("IDfsJunctionPoint Interface"), pointer_default(unique) ] interface IDfsJunctionPoint : IDispatch { [propget, id(1), helpstring("property EntryPath")] HRESULT EntryPath ( [out, retval] BSTR *pVal ); [id(2), helpstring("get property JunctionName")] HRESULT get_JunctionName ( [in] BOOL i_bDfsNameIncluded, [out, retval] BSTR *pVal ); [propget, id(3), helpstring("property State")] HRESULT State ( [out, retval] long *pVal ); [propget, id(4), helpstring("property Comment")] HRESULT Comment ( [out, retval] BSTR *pVal ); [propput, id(4), helpstring("property Comment")] HRESULT Comment ( [in] BSTR newVal ); [propget, id(5), helpstring ("Gets the timeout for the Replica.")] HRESULT Timeout ( [out, retval] long* pVal ); [propput, id(5), helpstring ("Sets the timeout for the Replica.")] HRESULT Timeout ( [in] long newVal ); [propget, id(6), helpstring("property CountOfDfsReplicas")] HRESULT CountOfDfsReplicas ( [out, retval] long *pVal ); [propget, id(7), helpstring("property ReplicaSetDN")] HRESULT ReplicaSetDN ( [out, retval] BSTR *pVal ); [propget, id(8), helpstring("property ReplicaSetExist")] HRESULT ReplicaSetExist ( [out, retval] BOOL *pVal ); [propput, id(8), helpstring("property ReplicaSetExist")] HRESULT ReplicaSetExist ( [in] BOOL newVal ); [propget, restricted, id(DISPID_NEWENUM), helpstring("Gets the enumerator on replicas.")] HRESULT _NewEnum ( [out, retval] IUnknown** ppEnumerator ); [id(9), helpstring("method Initialize")] HRESULT Initialize ( [in] IUnknown *piDfsRoot, [in] BSTR i_szEntryPath, [in] BOOL i_bReplicaSetExist, [in] BSTR i_bstrReplicaSetDN ); [id(10), helpstring("Adds a Replica to the Junction Point.")] HRESULT AddReplica ( [in] BSTR i_szServerName, [in] BSTR i_szShareName, [out, retval] VARIANT* o_pvarReplicaObject ); [id(11), helpstring("Removes a Replica from the Junction Point.")] HRESULT RemoveReplica ( [in] BSTR i_szServerName, [in] BSTR i_szShareName ); [id(12), helpstring("Delete the Junction Point.")] HRESULT RemoveAllReplicas ( ); [id(13), helpstring("Deletes a Dfs root replica.")] HRESULT DeleteRootReplica ( [in] BSTR i_bstrDomainName, [in] BSTR i_bstrDfsName, [in] BSTR i_bstrServerName, [in] BSTR i_bstrShareName, [in] BOOL i_bForce ); [id(14), helpstring("Get info of a Dfs root replica")] HRESULT GetOneRootReplica ( [out] BSTR* o_pbstrServerName, [out] BSTR* o_pbstrShareName ); [id(15), helpstring("Initialize using buffer returned by NetDfsEnum")] HRESULT InitializeEx ( [in] IUnknown *piDfsRoot, [in] VARIANT *pVar, [in] BOOL bReplicaSetExist, [in] BSTR bstrReplicaSetDN ); [id(16), helpstring("refresh bReplicaSetExist and retrieve its value")] HRESULT get_ReplicaSetExistEx ( [out] BSTR *pbstrDC, [out] BOOL *pVal ); }; //////////////////////////////////////////////////////////////////////////////////// // Interface IReplicaSet //////////////////////////////////////////////////////////////////////////////////// // Use this object for managing ntfrs replica set. // // To use this object, you first call Initialize on FQDN of an nTFRSReplicaSet object. // // The properties that are supported by IReplicaSet are - // Type - SYSVOL, Dfs, or non Dfs. // TopologyPref - Specifies the preferred topology for this replica set. // Hub - The hub server if TopologyPref is hub & spoke. // PrimaryMember - The primary server. // DfsEntryPath - If 'Type' is Dfs, it is the entry path of the associated Dfs root or link. [ object, uuid(6DC4917C-7A5F-48F0-80CC-6E730B8423BF), dual, helpstring("IReplicaSet Interface"), pointer_default(unique) ] interface IReplicaSet : IDispatch { [propget, id(1), helpstring("property Type")] HRESULT Type ( [out, retval] BSTR *pVal ); [propput, id(1), helpstring("property Type")] HRESULT Type ( [in] BSTR newVal ); [propget, id(2), helpstring("property TopologyPref")] HRESULT TopologyPref ( [out, retval] BSTR *pVal ); [propput, id(2), helpstring("property TopologyPref")] HRESULT TopologyPref ( [in] BSTR newVal ); [propget, id(3), helpstring("property HubMemberDN")] HRESULT HubMemberDN ( [out, retval] BSTR *pVal ); [propput, id(3), helpstring("property HubMemberDN")] HRESULT HubMemberDN ( [in] BSTR newVal ); [propget, id(4), helpstring("property PrimaryMemberDN")] HRESULT PrimaryMemberDN ( [out, retval] BSTR *pVal ); [propput, id(4), helpstring("property PrimaryMemberDN")] HRESULT PrimaryMemberDN ( [in] BSTR newVal ); [propget, id(5), helpstring("property FileFilter")] HRESULT FileFilter ( [out, retval] BSTR *pVal ); [propput, id(5), helpstring("property FileFilter")] HRESULT FileFilter ( [in] BSTR newVal ); [propget, id(6), helpstring("property DirFilter")] HRESULT DirFilter ( [out, retval] BSTR *pVal ); [propput, id(6), helpstring("property DirFilter")] HRESULT DirFilter ( [in] BSTR newVal ); [propget, id(7), helpstring("property DfsEntryPath")] HRESULT DfsEntryPath ( [out, retval] BSTR *pVal ); [propget, id(8), helpstring("property Domain")] HRESULT Domain ( [out, retval] BSTR *pVal ); [propget, id(9), helpstring("property ReplicaSetDN")] HRESULT ReplicaSetDN ( [out, retval] BSTR *pVal ); [propget, id(10), helpstring("Number of Frs members")] HRESULT NumOfMembers ( [out, retval] long *pVal ); [propget, id(11), helpstring("Number of Frs connections")] HRESULT NumOfConnections ( [out, retval] long *pVal ); [propget, id(12), helpstring("targeted DC")] HRESULT TargetedDC ( [out, retval] BSTR *pVal ); [id(13), helpstring("method Initialize")] HRESULT Create ( [in] BSTR i_bstrDomain, [in] BSTR i_bstrReplicaSetDN, [in] BSTR i_bstrType, [in] BSTR i_bstrTopologyPref, [in] BSTR i_bstrHubServer, [in] BSTR i_bstrPrimaryMember, [in] BSTR i_bstrFileFilter, [in] BSTR i_bstrDirFilter ); [id(14), helpstring("method Initialize")] HRESULT Initialize ( [in] BSTR i_bstrDomain, [in] BSTR i_bstrReplicaSetDN ); [id(15), helpstring("return an array of member DNs.")] HRESULT GetMemberList ( [out, retval] VARIANT* o_pvarMemberDNs ); [id(16), helpstring("return an array of member infos, which is an array of BSTRs.")] HRESULT GetMemberListEx ( [out, retval] VARIANT* o_pVal ); [id(17), helpstring("Get info of one member.")] HRESULT GetMemberInfo ( [in] BSTR i_bstrMemberDN, [out, retval] VARIANT* o_pvarMember ); [id(18), helpstring("Find if a member exists.")] HRESULT IsFRSMember ( [in] BSTR i_bstrDnsHostName, [in] BSTR i_bstrRootPath ); [id(19), helpstring("Find if it is the hub member.")] HRESULT IsHubMember ( [in] BSTR i_bstrDnsHostName, [in] BSTR i_bstrRootPath ); [id(20), helpstring("Add one member.")] HRESULT AddMember ( [in] BSTR i_bstrServer, [in] BSTR i_bstrRootPath, [in] BSTR i_bstrStagingPath, [in] BOOL i_bAddConnectionNow, [out, retval] BSTR* o_pbstrMemberDN ); [id(21), helpstring("Remove one member.")] HRESULT RemoveMember ( [in] BSTR i_bstrMemberDN ); [id(22), helpstring("Remove one member.")] HRESULT RemoveMemberEx ( [in] BSTR i_bstrDnsHostName, [in] BSTR i_bstrRootPath ); [id(23), helpstring("Remove all members.")] HRESULT RemoveAllMembers ( ); [id(24), helpstring("return an array of connection DNs.")] HRESULT GetConnectionList ( [out, retval] VARIANT* o_pvarConnectionDNs ); [id(25), helpstring("return an array of connection infos, which is an array of BSTRs.")] HRESULT GetConnectionListEx ( [out, retval] VARIANT* o_pVal ); [id(26), helpstring("Get info of one connection.")] HRESULT GetConnectionInfo ( [in] BSTR i_bstrConnectionDN, [out, retval] VARIANT* o_pvarConnection ); [id(27), helpstring("Add one connection.")] HRESULT AddConnection ( [in] BSTR i_bstrFromMemberDN, [in] BSTR i_bstrToMemberDN, [in] BOOL i_bEnable, [in] BOOL i_bSyncImmediately, [in] long i_nPriority, [out, retval] BSTR* o_pbstrConnectionDN ); [id(28), helpstring("Remove one connection.")] HRESULT RemoveConnection ( [in] BSTR i_bstrConnectionDN ); [id(29), helpstring("Remove one connection.")] HRESULT RemoveConnectionEx ( [in] BSTR i_bstrFromMemberDN, [in] BSTR i_bstrToMemberDN ); [id(30), helpstring("Remove all connections.")] HRESULT RemoveAllConnections ( ); [id(31), helpstring("Enable/disbale one connection.")] HRESULT EnableConnection ( [in] BSTR i_bstrConnectionDN, [in] BOOL i_bEnable ); [id(32), helpstring("Enable/disbale one connection.")] HRESULT EnableConnectionEx ( [in] BSTR i_bstrFromMemberDN, [in] BSTR i_bstrToMemberDN, [in] BOOL i_bEnable ); [id(33), helpstring("Get schedule on one connection.")] HRESULT GetConnectionSchedule ( [in] BSTR i_bstrConnectionDN, [out, retval] VARIANT* o_pVar ); [id(34), helpstring("Get schedule on one connection.")] HRESULT GetConnectionScheduleEx ( [in] BSTR i_bstrFromMemberDN, [in] BSTR i_bstrToMemberDN, [out, retval] VARIANT* o_pVar ); [id(35), helpstring("Set schedule on one connection.")] HRESULT SetConnectionSchedule ( [in] BSTR i_bstrConnectionDN, [in] VARIANT* i_pVar ); [id(36), helpstring("Set schedule on one connection.")] HRESULT SetConnectionScheduleEx ( [in] BSTR i_bstrFromMemberDN, [in] BSTR i_bstrToMemberDN, [in] VARIANT* i_pVar ); [id(37), helpstring("Set schedule on all connections.")] HRESULT SetScheduleOnAllConnections ( [in] VARIANT* i_pVar ); [id(38), helpstring("Set options on one connection.")] HRESULT SetConnectionOptions ( [in] BSTR i_bstrConnectionDN, [in] BOOL i_bSyncImmediately, [in] long i_nPriority ); [id(39), helpstring("Set options on one connection.")] HRESULT SetConnectionOptionsEx ( [in] BSTR i_bstrFromMemberDN, [in] BSTR i_bstrToMemberDN, [in] BOOL i_bSyncImmediately, [in] long i_nPriority ); [id(40), helpstring("Create connections from scratch based on the current TopologyPref.")] HRESULT CreateConnections ( ); [id(41), helpstring("Delete the replica set.")] HRESULT Delete ( ); [id(42), helpstring("Get info of a possible bad member.")] HRESULT GetBadMemberInfo ( [in] BSTR i_bstrServerName, [out, retval] VARIANT* o_pvarMember ); }; //////////////////////////////////////////////////////////////////////////////////// // The definition for the DFSCORELib Type Library. //////////////////////////////////////////////////////////////////////////////////// [ uuid(A741D3E4-31BE-11D1-9A4A-0080ADAA5C4B), version(1.0), helpstring("DfsCore 1.0 Type Library") ] library DFSCORELib { importlib("stdole32.tlb"); importlib("stdole2.tlb"); [ uuid(A741D3FB-31BE-11D1-9A4A-0080ADAA5C4B), helpstring("DfsRoot Class") ] coclass DfsRoot { [default] interface IDfsRoot; }; [ uuid(A741D3FE-31BE-11D1-9A4A-0080ADAA5C4B), helpstring("DfsReplica Class") ] coclass DfsReplica { [default] interface IDfsReplica; }; [ uuid(A741D400-31BE-11D1-9A4A-0080ADAA5C4B), helpstring("DfsJunctionPoint Class") ] coclass DfsJunctionPoint { [default] interface IDfsJunctionPoint; }; [ uuid(A741D403-31BE-11D1-9A4A-0080ADAA5C4B), helpstring("JunctionPointEnum Class") ] coclass JunctionPointEnum { [default] interface IUnknown; }; [ uuid(A741D404-31BE-11D1-9A4A-0080ADAA5C4B), helpstring("ReplicaEnum Class") ] coclass ReplicaEnum { [default] interface IUnknown; }; [ uuid(6DC4917D-7A5F-48F0-80CC-6E730B8423BF), helpstring("ReplicaSet Class") ] coclass ReplicaSet { [default] interface IReplicaSet; }; };