Exemple #1
0
 private unsafe void FreeReplicaInfo(DS_REPL_INFO_TYPE type, IntPtr value, SafeLibraryHandle libHandle)
 {
     if (value != (IntPtr)0)
     {
         // call DsReplicaFreeInfo
         var dsReplicaFreeInfo = (delegate * unmanaged <int, IntPtr, int>)global::Interop.Kernel32.GetProcAddress(libHandle, "DsReplicaFreeInfo");
         if (dsReplicaFreeInfo == null)
         {
             throw ExceptionHelper.GetExceptionFromErrorCode(Marshal.GetLastWin32Error());
         }
         dsReplicaFreeInfo((int)type, value);
     }
 }
 private void FreeReplicaInfo(DS_REPL_INFO_TYPE type, IntPtr value, LoadLibrarySafeHandle libHandle)
 {
     if (value != IntPtr.Zero)
     {
         IntPtr procAddress = System.DirectoryServices.ActiveDirectory.UnsafeNativeMethods.GetProcAddress(libHandle, "DsReplicaFreeInfo");
         if (procAddress == IntPtr.Zero)
         {
             throw ExceptionHelper.GetExceptionFromErrorCode(Marshal.GetLastWin32Error());
         }
         System.DirectoryServices.ActiveDirectory.UnsafeNativeMethods.DsReplicaFreeInfo delegateForFunctionPointer = (System.DirectoryServices.ActiveDirectory.UnsafeNativeMethods.DsReplicaFreeInfo)Marshal.GetDelegateForFunctionPointer(procAddress, typeof(System.DirectoryServices.ActiveDirectory.UnsafeNativeMethods.DsReplicaFreeInfo));
         delegateForFunctionPointer((int)type, value);
     }
 }
        private ReplicationFailureCollection GetReplicationFailures(DS_REPL_INFO_TYPE type)
        {
            IntPtr zero     = IntPtr.Zero;
            bool   advanced = true;

            if (this.disposed)
            {
                throw new ObjectDisposedException(base.GetType().Name);
            }
            this.GetADAMHandle();
            zero = base.GetReplicationInfoHelper(this.ADAMHandle, (int)type, (int)type, null, ref advanced, 0, DirectoryContext.ADAMHandle);
            return(base.ConstructFailures(zero, this, DirectoryContext.ADAMHandle));
        }
Exemple #4
0
        private void FreeReplicaInfo(DS_REPL_INFO_TYPE type, IntPtr value, LoadLibrarySafeHandle libHandle)
        {
            if (value != (IntPtr)0)
            {
                // call DsReplicaFreeInfo
                IntPtr functionPtr = UnsafeNativeMethods.GetProcAddress(libHandle, "DsReplicaFreeInfo");
                if (functionPtr == (IntPtr)0)
                {
                    throw ExceptionHelper.GetExceptionFromErrorCode(Marshal.GetLastWin32Error());
                }
                UnsafeNativeMethods.DsReplicaFreeInfo dsReplicaFreeInfo = (UnsafeNativeMethods.DsReplicaFreeInfo)Marshal.GetDelegateForFunctionPointer(functionPtr, typeof(UnsafeNativeMethods.DsReplicaFreeInfo));

                dsReplicaFreeInfo((int)type, value);
            }
        }
        private ReplicationFailureCollection GetReplicationFailures(DS_REPL_INFO_TYPE type)
        {
            IntPtr info     = (IntPtr)0;
            bool   advanced = true;

            if (_disposed)
            {
                throw new ObjectDisposedException(GetType().Name);
            }

            // get the handle
            GetADAMHandle();
            info = GetReplicationInfoHelper(_ADAMHandle, (int)type, (int)type, null, ref advanced, 0, DirectoryContext.ADAMHandle);
            return(ConstructFailures(info, this, DirectoryContext.ADAMHandle));
        }
Exemple #6
0
        private ReplicationFailureCollection GetReplicationFailures(DS_REPL_INFO_TYPE type)
        {
            bool flag = true;

            if (!this.disposed)
            {
                this.GetADAMHandle();
                IntPtr replicationInfoHelper = base.GetReplicationInfoHelper(this.ADAMHandle, (int)type, (int)type, null, ref flag, 0, DirectoryContext.ADAMHandle);
                return(base.ConstructFailures(replicationInfoHelper, this, DirectoryContext.ADAMHandle));
            }
            else
            {
                throw new ObjectDisposedException(base.GetType().Name);
            }
        }
Exemple #7
0
        internal ReplicationFailureCollection GetReplicationFailures(DS_REPL_INFO_TYPE type)
        {
            IntPtr info = (IntPtr)0;
            bool advanced = true;

            if (_disposed)
                throw new ObjectDisposedException(GetType().Name);

            // get the handle
            GetDSHandle();
            info = GetReplicationInfoHelper(_dsHandle, (int)type, (int)type, null, ref advanced, 0, DirectoryContext.ADHandle);
            return ConstructFailures(info, this, DirectoryContext.ADHandle);
        }
Exemple #8
0
		private ReplicationFailureCollection GetReplicationFailures(DS_REPL_INFO_TYPE type)
		{
			bool flag = true;
			if (!this.disposed)
			{
				this.GetADAMHandle();
				IntPtr replicationInfoHelper = base.GetReplicationInfoHelper(this.ADAMHandle, (int)type, (int)type, null, ref flag, 0, DirectoryContext.ADAMHandle);
				return base.ConstructFailures(replicationInfoHelper, this, DirectoryContext.ADAMHandle);
			}
			else
			{
				throw new ObjectDisposedException(base.GetType().Name);
			}
		}
Exemple #9
0
        private void FreeReplicaInfo(DS_REPL_INFO_TYPE type, IntPtr value, LoadLibrarySafeHandle libHandle)
        {
            if (value != (IntPtr)0)
            {
                // call DsReplicaFreeInfo
                IntPtr functionPtr = UnsafeNativeMethods.GetProcAddress(libHandle, "DsReplicaFreeInfo");
                if (functionPtr == (IntPtr)0)
                {
                    throw ExceptionHelper.GetExceptionFromErrorCode(Marshal.GetLastWin32Error());
                }
                UnsafeNativeMethods.DsReplicaFreeInfo dsReplicaFreeInfo = (UnsafeNativeMethods.DsReplicaFreeInfo)Marshal.GetDelegateForFunctionPointer(functionPtr, typeof(UnsafeNativeMethods.DsReplicaFreeInfo));

                dsReplicaFreeInfo((int)type, value);
            }
        }
 private ReplicationFailureCollection GetReplicationFailures(DS_REPL_INFO_TYPE type)
 {
     IntPtr zero = IntPtr.Zero;
     bool advanced = true;
     if (this.disposed)
     {
         throw new ObjectDisposedException(base.GetType().Name);
     }
     this.GetADAMHandle();
     zero = base.GetReplicationInfoHelper(this.ADAMHandle, (int) type, (int) type, null, ref advanced, 0, DirectoryContext.ADAMHandle);
     return base.ConstructFailures(zero, this, DirectoryContext.ADAMHandle);
 }
 public static extern unsafe uint DsReplicaGetInfoW(void *hDS, DS_REPL_INFO_TYPE InfoType, ushort *pszObjectDN, GUID *puuidForSourceDsaObjGuid, void **ppInfo);
 public static extern unsafe void DsReplicaFreeInfo(DS_REPL_INFO_TYPE InfoType, void *pInfo);
 public static extern unsafe uint DsReplicaGetInfo2W(void *hDS, DS_REPL_INFO_TYPE InfoType, ushort *pszObjectDN, GUID *puuidForSourceDsaObjGuid, ushort *pszAttributeName, ushort *pszValueDN, uint dwFlags, uint dwEnumerationContext, void **ppInfo);
 private void FreeReplicaInfo(DS_REPL_INFO_TYPE type, IntPtr value, LoadLibrarySafeHandle libHandle)
 {
     if (value != IntPtr.Zero)
     {
         IntPtr procAddress = System.DirectoryServices.ActiveDirectory.UnsafeNativeMethods.GetProcAddress(libHandle, "DsReplicaFreeInfo");
         if (procAddress == IntPtr.Zero)
         {
             throw ExceptionHelper.GetExceptionFromErrorCode(Marshal.GetLastWin32Error());
         }
         System.DirectoryServices.ActiveDirectory.UnsafeNativeMethods.DsReplicaFreeInfo delegateForFunctionPointer = (System.DirectoryServices.ActiveDirectory.UnsafeNativeMethods.DsReplicaFreeInfo) Marshal.GetDelegateForFunctionPointer(procAddress, typeof(System.DirectoryServices.ActiveDirectory.UnsafeNativeMethods.DsReplicaFreeInfo));
         delegateForFunctionPointer((int) type, value);
     }
 }