コード例 #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);
        }
コード例 #2
0
        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);
        }
コード例 #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);
        }
コード例 #4
0
ファイル: DirectoryServer.cs プロジェクト: chcosta/corefx
        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;
        }
コード例 #5
0
ファイル: DirectoryServer.cs プロジェクト: nickchal/pash
		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;
 }