internal ReplicationOperationInformation ConstructPendingOperations(IntPtr info, DirectoryServer server, LoadLibrarySafeHandle libHandle) { ReplicationOperationInformation replicationOperationInformation = new ReplicationOperationInformation(); ReplicationOperationCollection replicationOperationCollection = new ReplicationOperationCollection(server); replicationOperationInformation.collection = replicationOperationCollection; try { if (info != (IntPtr)0) { DS_REPL_PENDING_OPS dSREPLPENDINGOP = new DS_REPL_PENDING_OPS(); Marshal.PtrToStructure(info, dSREPLPENDINGOP); int num = dSREPLPENDINGOP.cNumPendingOps; if (num > 0) { replicationOperationCollection.AddHelper(dSREPLPENDINGOP, info); replicationOperationInformation.startTime = DateTime.FromFileTime(dSREPLPENDINGOP.ftimeCurrentOpStarted); replicationOperationInformation.currentOp = replicationOperationCollection.GetFirstOperation(); } } } finally { this.FreeReplicaInfo(DS_REPL_INFO_TYPE.DS_REPL_INFO_PENDING_OPS, info, libHandle); } return(replicationOperationInformation); }
internal ReplicationOperationInformation ConstructPendingOperations(IntPtr info, DirectoryServer server, LoadLibrarySafeHandle libHandle) { ReplicationOperationInformation replicationInfo = new ReplicationOperationInformation(); ReplicationOperationCollection collection = new ReplicationOperationCollection(server); replicationInfo.collection = collection; int count = 0; try { if (info != (IntPtr)0) { DS_REPL_PENDING_OPS operations = new DS_REPL_PENDING_OPS(); Marshal.PtrToStructure(info, operations); count = operations.cNumPendingOps; if (count > 0) { collection.AddHelper(operations, info); replicationInfo.startTime = DateTime.FromFileTime(operations.ftimeCurrentOpStarted); replicationInfo.currentOp = collection.GetFirstOperation(); } } } finally { FreeReplicaInfo(DS_REPL_INFO_TYPE.DS_REPL_INFO_PENDING_OPS, info, libHandle); } return(replicationInfo); }
internal ReplicationOperationInformation ConstructPendingOperations(IntPtr info, DirectoryServer server, LoadLibrarySafeHandle libHandle) { ReplicationOperationInformation information = new ReplicationOperationInformation(); ReplicationOperationCollection operations = new ReplicationOperationCollection(server); information.collection = operations; try { if (info != IntPtr.Zero) { DS_REPL_PENDING_OPS structure = new DS_REPL_PENDING_OPS(); Marshal.PtrToStructure(info, structure); if (structure.cNumPendingOps > 0) { operations.AddHelper(structure, info); information.startTime = DateTime.FromFileTime(structure.ftimeCurrentOpStarted); information.currentOp = operations.GetFirstOperation(); } } } finally { this.FreeReplicaInfo(DS_REPL_INFO_TYPE.DS_REPL_INFO_PENDING_OPS, info, libHandle); } return(information); }
internal void AddHelper(DS_REPL_PENDING_OPS operations, IntPtr info) { int num = operations.cNumPendingOps; for (int i = 0; i < num; i++) { IntPtr intPtr = (IntPtr)((long)info + (long)Marshal.SizeOf(typeof(DS_REPL_PENDING_OPS)) + (long)(i * Marshal.SizeOf(typeof(DS_REPL_OP)))); ReplicationOperation replicationOperation = new ReplicationOperation(intPtr, this.server, this.nameTable); this.Add(replicationOperation); } }
internal void AddHelper(DS_REPL_PENDING_OPS operations, IntPtr info) { int cNumPendingOps = operations.cNumPendingOps; IntPtr zero = IntPtr.Zero; for (int i = 0; i < cNumPendingOps; i++) { zero = (IntPtr) ((((long) info) + Marshal.SizeOf(typeof(DS_REPL_PENDING_OPS))) + (i * Marshal.SizeOf(typeof(DS_REPL_OP)))); ReplicationOperation operation = new ReplicationOperation(zero, this.server, this.nameTable); this.Add(operation); } }
internal void AddHelper(DS_REPL_PENDING_OPS operations, IntPtr info) { int num = operations.cNumPendingOps; for (int i = 0; i < num; i++) { IntPtr intPtr = (IntPtr)((long)info + (long)Marshal.SizeOf(typeof(DS_REPL_PENDING_OPS)) + (long)(i * Marshal.SizeOf(typeof(DS_REPL_OP)))); ReplicationOperation replicationOperation = new ReplicationOperation(intPtr, this.server, this.nameTable); this.Add(replicationOperation); } }
internal void AddHelper(DS_REPL_PENDING_OPS operations, IntPtr info) { int cNumPendingOps = operations.cNumPendingOps; IntPtr zero = IntPtr.Zero; for (int i = 0; i < cNumPendingOps; i++) { zero = (IntPtr)((((long)info) + Marshal.SizeOf(typeof(DS_REPL_PENDING_OPS))) + (i * Marshal.SizeOf(typeof(DS_REPL_OP)))); ReplicationOperation operation = new ReplicationOperation(zero, this.server, this.nameTable); this.Add(operation); } }
internal void AddHelper(DS_REPL_PENDING_OPS operations, IntPtr info) { // get the count int count = operations.cNumPendingOps; IntPtr addr = (IntPtr)0; for (int i = 0; i < count; i++) { addr = IntPtr.Add(info, Marshal.SizeOf(typeof(DS_REPL_PENDING_OPS)) + i * Marshal.SizeOf(typeof(DS_REPL_OP))); ReplicationOperation managedOperation = new ReplicationOperation(addr, _server, _nameTable); Add(managedOperation); } }
internal void AddHelper(DS_REPL_PENDING_OPS operations, IntPtr info) { // get the count int count = operations.cNumPendingOps; IntPtr addr = (IntPtr)0; for (int i = 0; i < count; i++) { addr = IntPtr.Add(info, Marshal.SizeOf(typeof(DS_REPL_PENDING_OPS)) + i * Marshal.SizeOf(typeof(DS_REPL_OP))); ReplicationOperation managedOperation = new ReplicationOperation(addr, _server, _nameTable); Add(managedOperation); } }
internal ReplicationOperationInformation ConstructPendingOperations(IntPtr info, DirectoryServer server, LoadLibrarySafeHandle libHandle) { ReplicationOperationInformation replicationInfo = new ReplicationOperationInformation(); ReplicationOperationCollection collection = new ReplicationOperationCollection(server); replicationInfo.collection = collection; int count = 0; try { if (info != (IntPtr)0) { DS_REPL_PENDING_OPS operations = new DS_REPL_PENDING_OPS(); Marshal.PtrToStructure(info, operations); count = operations.cNumPendingOps; if (count > 0) { collection.AddHelper(operations, info); replicationInfo.startTime = DateTime.FromFileTime(operations.ftimeCurrentOpStarted); replicationInfo.currentOp = collection.GetFirstOperation(); } } } finally { FreeReplicaInfo(DS_REPL_INFO_TYPE.DS_REPL_INFO_PENDING_OPS, info, libHandle); } return replicationInfo; }
internal ReplicationOperationInformation ConstructPendingOperations(IntPtr info, DirectoryServer server, LoadLibrarySafeHandle libHandle) { ReplicationOperationInformation replicationOperationInformation = new ReplicationOperationInformation(); ReplicationOperationCollection replicationOperationCollection = new ReplicationOperationCollection(server); replicationOperationInformation.collection = replicationOperationCollection; try { if (info != (IntPtr)0) { DS_REPL_PENDING_OPS dSREPLPENDINGOP = new DS_REPL_PENDING_OPS(); Marshal.PtrToStructure(info, dSREPLPENDINGOP); int num = dSREPLPENDINGOP.cNumPendingOps; if (num > 0) { replicationOperationCollection.AddHelper(dSREPLPENDINGOP, info); replicationOperationInformation.startTime = DateTime.FromFileTime(dSREPLPENDINGOP.ftimeCurrentOpStarted); replicationOperationInformation.currentOp = replicationOperationCollection.GetFirstOperation(); } } } finally { this.FreeReplicaInfo(DS_REPL_INFO_TYPE.DS_REPL_INFO_PENDING_OPS, info, libHandle); } return replicationOperationInformation; }
internal ReplicationOperationInformation ConstructPendingOperations(IntPtr info, DirectoryServer server, LoadLibrarySafeHandle libHandle) { ReplicationOperationInformation information = new ReplicationOperationInformation(); ReplicationOperationCollection operations = new ReplicationOperationCollection(server); information.collection = operations; try { if (info != IntPtr.Zero) { DS_REPL_PENDING_OPS structure = new DS_REPL_PENDING_OPS(); Marshal.PtrToStructure(info, structure); if (structure.cNumPendingOps > 0) { operations.AddHelper(structure, info); information.startTime = DateTime.FromFileTime(structure.ftimeCurrentOpStarted); information.currentOp = operations.GetFirstOperation(); } } } finally { this.FreeReplicaInfo(DS_REPL_INFO_TYPE.DS_REPL_INFO_PENDING_OPS, info, libHandle); } return information; }