Exemplo n.º 1
0
        internal ActiveDirectoryReplicationMetadata ConstructMetaData(bool advanced, IntPtr info, DirectoryServer server, LoadLibrarySafeHandle libHandle)
        {
            ActiveDirectoryReplicationMetadata collection = new ActiveDirectoryReplicationMetadata(server);
            int count = 0;

            if (advanced)
            {
                try
                {
                    if (info != (IntPtr)0)
                    {
                        DS_REPL_OBJ_META_DATA_2 objMetaData = new DS_REPL_OBJ_META_DATA_2();
                        Marshal.PtrToStructure(info, objMetaData);

                        count = objMetaData.cNumEntries;
                        if (count > 0)
                        {
                            collection.AddHelper(count, info, true);
                        }
                    }
                }
                finally
                {
                    FreeReplicaInfo(DS_REPL_INFO_TYPE.DS_REPL_INFO_METADATA_2_FOR_OBJ, info, libHandle);
                }
            }
            else
            {
                try
                {
                    DS_REPL_OBJ_META_DATA objMetadata = new DS_REPL_OBJ_META_DATA();
                    Marshal.PtrToStructure(info, objMetadata);

                    count = objMetadata.cNumEntries;
                    if (count > 0)
                    {
                        collection.AddHelper(count, info, false);
                    }
                }
                finally
                {
                    FreeReplicaInfo(DS_REPL_INFO_TYPE.DS_REPL_INFO_METADATA_FOR_OBJ, info, libHandle);
                }
            }

            return(collection);
        }
Exemplo n.º 2
0
        internal ActiveDirectoryReplicationMetadata ConstructMetaData(bool advanced, IntPtr info, DirectoryServer server, LoadLibrarySafeHandle libHandle)
        {
            int num;
            ActiveDirectoryReplicationMetadata activeDirectoryReplicationMetadatum = new ActiveDirectoryReplicationMetadata(server);

            if (!advanced)
            {
                try
                {
                    DS_REPL_OBJ_META_DATA dSREPLOBJMETADATum = new DS_REPL_OBJ_META_DATA();
                    Marshal.PtrToStructure(info, dSREPLOBJMETADATum);
                    num = dSREPLOBJMETADATum.cNumEntries;
                    if (num > 0)
                    {
                        activeDirectoryReplicationMetadatum.AddHelper(num, info, false);
                    }
                }
                finally
                {
                    this.FreeReplicaInfo(DS_REPL_INFO_TYPE.DS_REPL_INFO_METADATA_FOR_OBJ, info, libHandle);
                }
            }
            else
            {
                try
                {
                    if (info != (IntPtr)0)
                    {
                        DS_REPL_OBJ_META_DATA_2 dSREPLOBJMETADATA2 = new DS_REPL_OBJ_META_DATA_2();
                        Marshal.PtrToStructure(info, dSREPLOBJMETADATA2);
                        num = dSREPLOBJMETADATA2.cNumEntries;
                        if (num > 0)
                        {
                            activeDirectoryReplicationMetadatum.AddHelper(num, info, true);
                        }
                    }
                }
                finally
                {
                    this.FreeReplicaInfo(DS_REPL_INFO_TYPE.DS_REPL_INFO_METADATA_2_FOR_OBJ, info, libHandle);
                }
            }
            return(activeDirectoryReplicationMetadatum);
        }
        internal ActiveDirectoryReplicationMetadata ConstructMetaData(bool advanced, IntPtr info, DirectoryServer server, LoadLibrarySafeHandle libHandle)
        {
            ActiveDirectoryReplicationMetadata metadata = new ActiveDirectoryReplicationMetadata(server);
            int count = 0;

            if (advanced)
            {
                try
                {
                    if (info != IntPtr.Zero)
                    {
                        DS_REPL_OBJ_META_DATA_2 structure = new DS_REPL_OBJ_META_DATA_2();
                        Marshal.PtrToStructure(info, structure);
                        count = structure.cNumEntries;
                        if (count > 0)
                        {
                            metadata.AddHelper(count, info, true);
                        }
                    }
                    return(metadata);
                }
                finally
                {
                    this.FreeReplicaInfo(DS_REPL_INFO_TYPE.DS_REPL_INFO_METADATA_2_FOR_OBJ, info, libHandle);
                }
            }
            try
            {
                DS_REPL_OBJ_META_DATA ds_repl_obj_meta_data = new DS_REPL_OBJ_META_DATA();
                Marshal.PtrToStructure(info, ds_repl_obj_meta_data);
                count = ds_repl_obj_meta_data.cNumEntries;
                if (count > 0)
                {
                    metadata.AddHelper(count, info, false);
                }
            }
            finally
            {
                this.FreeReplicaInfo(DS_REPL_INFO_TYPE.DS_REPL_INFO_METADATA_FOR_OBJ, info, libHandle);
            }
            return(metadata);
        }
 internal ActiveDirectoryReplicationMetadata ConstructMetaData(bool advanced, IntPtr info, DirectoryServer server, LoadLibrarySafeHandle libHandle)
 {
     ActiveDirectoryReplicationMetadata metadata = new ActiveDirectoryReplicationMetadata(server);
     int count = 0;
     if (advanced)
     {
         try
         {
             if (info != IntPtr.Zero)
             {
                 DS_REPL_OBJ_META_DATA_2 structure = new DS_REPL_OBJ_META_DATA_2();
                 Marshal.PtrToStructure(info, structure);
                 count = structure.cNumEntries;
                 if (count > 0)
                 {
                     metadata.AddHelper(count, info, true);
                 }
             }
             return metadata;
         }
         finally
         {
             this.FreeReplicaInfo(DS_REPL_INFO_TYPE.DS_REPL_INFO_METADATA_2_FOR_OBJ, info, libHandle);
         }
     }
     try
     {
         DS_REPL_OBJ_META_DATA ds_repl_obj_meta_data = new DS_REPL_OBJ_META_DATA();
         Marshal.PtrToStructure(info, ds_repl_obj_meta_data);
         count = ds_repl_obj_meta_data.cNumEntries;
         if (count > 0)
         {
             metadata.AddHelper(count, info, false);
         }
     }
     finally
     {
         this.FreeReplicaInfo(DS_REPL_INFO_TYPE.DS_REPL_INFO_METADATA_FOR_OBJ, info, libHandle);
     }
     return metadata;
 }
Exemplo n.º 5
0
        internal ActiveDirectoryReplicationMetadata ConstructMetaData(bool advanced, IntPtr info, DirectoryServer server, LoadLibrarySafeHandle libHandle)
        {
            ActiveDirectoryReplicationMetadata collection = new ActiveDirectoryReplicationMetadata(server);
            int count = 0;

            if (advanced)
            {
                try
                {
                    if (info != (IntPtr)0)
                    {
                        DS_REPL_OBJ_META_DATA_2 objMetaData = new DS_REPL_OBJ_META_DATA_2();
                        Marshal.PtrToStructure(info, objMetaData);

                        count = objMetaData.cNumEntries;
                        if (count > 0)
                        {
                            collection.AddHelper(count, info, true);
                        }
                    }
                }
                finally
                {
                    FreeReplicaInfo(DS_REPL_INFO_TYPE.DS_REPL_INFO_METADATA_2_FOR_OBJ, info, libHandle);
                }
            }
            else
            {
                try
                {
                    DS_REPL_OBJ_META_DATA objMetadata = new DS_REPL_OBJ_META_DATA();
                    Marshal.PtrToStructure(info, objMetadata);

                    count = objMetadata.cNumEntries;
                    if (count > 0)
                    {
                        collection.AddHelper(count, info, false);
                    }
                }
                finally
                {
                    FreeReplicaInfo(DS_REPL_INFO_TYPE.DS_REPL_INFO_METADATA_FOR_OBJ, info, libHandle);
                }
            }

            return collection;
        }
Exemplo n.º 6
0
		internal ActiveDirectoryReplicationMetadata ConstructMetaData(bool advanced, IntPtr info, DirectoryServer server, LoadLibrarySafeHandle libHandle)
		{
			int num;
			ActiveDirectoryReplicationMetadata activeDirectoryReplicationMetadatum = new ActiveDirectoryReplicationMetadata(server);
			if (!advanced)
			{
				try
				{
					DS_REPL_OBJ_META_DATA dSREPLOBJMETADATum = new DS_REPL_OBJ_META_DATA();
					Marshal.PtrToStructure(info, dSREPLOBJMETADATum);
					num = dSREPLOBJMETADATum.cNumEntries;
					if (num > 0)
					{
						activeDirectoryReplicationMetadatum.AddHelper(num, info, false);
					}
				}
				finally
				{
					this.FreeReplicaInfo(DS_REPL_INFO_TYPE.DS_REPL_INFO_METADATA_FOR_OBJ, info, libHandle);
				}
			}
			else
			{
				try
				{
					if (info != (IntPtr)0)
					{
						DS_REPL_OBJ_META_DATA_2 dSREPLOBJMETADATA2 = new DS_REPL_OBJ_META_DATA_2();
						Marshal.PtrToStructure(info, dSREPLOBJMETADATA2);
						num = dSREPLOBJMETADATA2.cNumEntries;
						if (num > 0)
						{
							activeDirectoryReplicationMetadatum.AddHelper(num, info, true);
						}
					}
				}
				finally
				{
					this.FreeReplicaInfo(DS_REPL_INFO_TYPE.DS_REPL_INFO_METADATA_2_FOR_OBJ, info, libHandle);
				}
			}
			return activeDirectoryReplicationMetadatum;
		}