Esempio n. 1
0
        internal ReplicationNeighbor(IntPtr addr, DirectoryServer server, Hashtable table)
        {
            DS_REPL_NEIGHBOR dSREPLNEIGHBOR = new DS_REPL_NEIGHBOR();

            Marshal.PtrToStructure(addr, dSREPLNEIGHBOR);
            this.namingContext  = Marshal.PtrToStringUni(dSREPLNEIGHBOR.pszNamingContext);
            this.sourceServerDN = Marshal.PtrToStringUni(dSREPLNEIGHBOR.pszSourceDsaDN);
            string stringUni = Marshal.PtrToStringUni(dSREPLNEIGHBOR.pszAsyncIntersiteTransportDN);

            if (stringUni != null)
            {
                string rdnFromDN = Utils.GetRdnFromDN(stringUni);
                string value     = Utils.GetDNComponents(rdnFromDN)[0].Value;
                if (string.Compare(value, "SMTP", StringComparison.OrdinalIgnoreCase) != 0)
                {
                    this.transportType = ActiveDirectoryTransportType.Rpc;
                }
                else
                {
                    this.transportType = ActiveDirectoryTransportType.Smtp;
                }
            }
            this.replicaFlags = (ReplicationNeighbor.ReplicationNeighborOptions)((long)dSREPLNEIGHBOR.dwReplicaFlags);
            this.uuidSourceDsaInvocationID = dSREPLNEIGHBOR.uuidSourceDsaInvocationID;
            this.usnLastObjChangeSynced    = dSREPLNEIGHBOR.usnLastObjChangeSynced;
            this.usnAttributeFilter        = dSREPLNEIGHBOR.usnAttributeFilter;
            this.timeLastSyncSuccess       = DateTime.FromFileTime(dSREPLNEIGHBOR.ftimeLastSyncSuccess);
            this.timeLastSyncAttempt       = DateTime.FromFileTime(dSREPLNEIGHBOR.ftimeLastSyncAttempt);
            this.lastSyncResult            = dSREPLNEIGHBOR.dwLastSyncResult;
            this.consecutiveSyncFailures   = dSREPLNEIGHBOR.cNumConsecutiveSyncFailures;
            this.server    = server;
            this.nameTable = table;
        }
Esempio n. 2
0
		internal ReplicationNeighbor(IntPtr addr, DirectoryServer server, Hashtable table)
		{
			DS_REPL_NEIGHBOR dSREPLNEIGHBOR = new DS_REPL_NEIGHBOR();
			Marshal.PtrToStructure(addr, dSREPLNEIGHBOR);
			this.namingContext = Marshal.PtrToStringUni(dSREPLNEIGHBOR.pszNamingContext);
			this.sourceServerDN = Marshal.PtrToStringUni(dSREPLNEIGHBOR.pszSourceDsaDN);
			string stringUni = Marshal.PtrToStringUni(dSREPLNEIGHBOR.pszAsyncIntersiteTransportDN);
			if (stringUni != null)
			{
				string rdnFromDN = Utils.GetRdnFromDN(stringUni);
				string value = Utils.GetDNComponents(rdnFromDN)[0].Value;
				if (string.Compare(value, "SMTP", StringComparison.OrdinalIgnoreCase) != 0)
				{
					this.transportType = ActiveDirectoryTransportType.Rpc;
				}
				else
				{
					this.transportType = ActiveDirectoryTransportType.Smtp;
				}
			}
			this.replicaFlags = (ReplicationNeighbor.ReplicationNeighborOptions)((long)dSREPLNEIGHBOR.dwReplicaFlags);
			this.uuidSourceDsaInvocationID = dSREPLNEIGHBOR.uuidSourceDsaInvocationID;
			this.usnLastObjChangeSynced = dSREPLNEIGHBOR.usnLastObjChangeSynced;
			this.usnAttributeFilter = dSREPLNEIGHBOR.usnAttributeFilter;
			this.timeLastSyncSuccess = DateTime.FromFileTime(dSREPLNEIGHBOR.ftimeLastSyncSuccess);
			this.timeLastSyncAttempt = DateTime.FromFileTime(dSREPLNEIGHBOR.ftimeLastSyncAttempt);
			this.lastSyncResult = dSREPLNEIGHBOR.dwLastSyncResult;
			this.consecutiveSyncFailures = dSREPLNEIGHBOR.cNumConsecutiveSyncFailures;
			this.server = server;
			this.nameTable = table;
		}