Example #1
0
        internal ReplicationNeighborCollection ConstructNeighbors(IntPtr info, DirectoryServer server, LoadLibrarySafeHandle libHandle)
        {
            ReplicationNeighborCollection collection = new ReplicationNeighborCollection(server);
            int count = 0;

            try
            {
                if (info != (IntPtr)0)
                {
                    DS_REPL_NEIGHBORS neighbors = new DS_REPL_NEIGHBORS();
                    Marshal.PtrToStructure(info, neighbors);
                    Debug.Assert(neighbors != null);
                    count = neighbors.cNumNeighbors;
                    if (count > 0)
                    {
                        collection.AddHelper(neighbors, info);
                    }
                }
            }
            finally
            {
                FreeReplicaInfo(DS_REPL_INFO_TYPE.DS_REPL_INFO_NEIGHBORS, info, libHandle);
            }
            return(collection);
        }
        internal ReplicationNeighborCollection ConstructNeighbors(IntPtr info, DirectoryServer server, LoadLibrarySafeHandle libHandle)
        {
            ReplicationNeighborCollection neighbors = new ReplicationNeighborCollection(server);

            try
            {
                if (info != IntPtr.Zero)
                {
                    DS_REPL_NEIGHBORS structure = new DS_REPL_NEIGHBORS();
                    Marshal.PtrToStructure(info, structure);
                    if (structure.cNumNeighbors > 0)
                    {
                        neighbors.AddHelper(structure, info);
                    }
                }
            }
            finally
            {
                this.FreeReplicaInfo(DS_REPL_INFO_TYPE.DS_REPL_INFO_NEIGHBORS, info, libHandle);
            }
            return(neighbors);
        }
Example #3
0
        internal ReplicationNeighborCollection ConstructNeighbors(IntPtr info, DirectoryServer server, LoadLibrarySafeHandle libHandle)
        {
            ReplicationNeighborCollection replicationNeighborCollection = new ReplicationNeighborCollection(server);

            try
            {
                if (info != (IntPtr)0)
                {
                    DS_REPL_NEIGHBORS dSREPLNEIGHBOR = new DS_REPL_NEIGHBORS();
                    Marshal.PtrToStructure(info, dSREPLNEIGHBOR);
                    int num = dSREPLNEIGHBOR.cNumNeighbors;
                    if (num > 0)
                    {
                        replicationNeighborCollection.AddHelper(dSREPLNEIGHBOR, info);
                    }
                }
            }
            finally
            {
                this.FreeReplicaInfo(DS_REPL_INFO_TYPE.DS_REPL_INFO_NEIGHBORS, info, libHandle);
            }
            return(replicationNeighborCollection);
        }
Example #4
0
        internal ReplicationNeighborCollection ConstructNeighbors(IntPtr info, DirectoryServer server, LoadLibrarySafeHandle libHandle)
        {
            ReplicationNeighborCollection collection = new ReplicationNeighborCollection(server);
            int count = 0;

            try
            {
                if (info != (IntPtr)0)
                {
                    DS_REPL_NEIGHBORS neighbors = new DS_REPL_NEIGHBORS();
                    Marshal.PtrToStructure(info, neighbors);
                    Debug.Assert(neighbors != null);
                    count = neighbors.cNumNeighbors;
                    if (count > 0)
                        collection.AddHelper(neighbors, info);
                }
            }
            finally
            {
                FreeReplicaInfo(DS_REPL_INFO_TYPE.DS_REPL_INFO_NEIGHBORS, info, libHandle);
            }
            return collection;
        }
Example #5
0
		internal ReplicationNeighborCollection ConstructNeighbors(IntPtr info, DirectoryServer server, LoadLibrarySafeHandle libHandle)
		{
			ReplicationNeighborCollection replicationNeighborCollection = new ReplicationNeighborCollection(server);
			try
			{
				if (info != (IntPtr)0)
				{
					DS_REPL_NEIGHBORS dSREPLNEIGHBOR = new DS_REPL_NEIGHBORS();
					Marshal.PtrToStructure(info, dSREPLNEIGHBOR);
					int num = dSREPLNEIGHBOR.cNumNeighbors;
					if (num > 0)
					{
						replicationNeighborCollection.AddHelper(dSREPLNEIGHBOR, info);
					}
				}
			}
			finally
			{
				this.FreeReplicaInfo(DS_REPL_INFO_TYPE.DS_REPL_INFO_NEIGHBORS, info, libHandle);
			}
			return replicationNeighborCollection;
		}
 internal ReplicationNeighborCollection ConstructNeighbors(IntPtr info, DirectoryServer server, LoadLibrarySafeHandle libHandle)
 {
     ReplicationNeighborCollection neighbors = new ReplicationNeighborCollection(server);
     try
     {
         if (info != IntPtr.Zero)
         {
             DS_REPL_NEIGHBORS structure = new DS_REPL_NEIGHBORS();
             Marshal.PtrToStructure(info, structure);
             if (structure.cNumNeighbors > 0)
             {
                 neighbors.AddHelper(structure, info);
             }
         }
     }
     finally
     {
         this.FreeReplicaInfo(DS_REPL_INFO_TYPE.DS_REPL_INFO_NEIGHBORS, info, libHandle);
     }
     return neighbors;
 }