예제 #1
0
        internal unsafe DirectoryVirtualListView RetrieveVLVResponse()
        {
            if (_disposed)
            {
                throw new ObjectDisposedException(GetType().Name);
            }

            // get the vlv response back
            AdsSearchColumn  column  = new AdsSearchColumn();
            AdsSearchColumn *pColumn = &column;

            SearchObject.GetColumn(Handle, _adsVLVResponseName, (INTPTR_INTPTRCAST)pColumn);
            try
            {
                AdsValue *pValue = column.pADsValues;
                DirectoryVirtualListView value = (DirectoryVirtualListView) new AdsValueHelper(*pValue).GetVlvValue();
                return(value);
            }
            finally
            {
                try
                {
                    SearchObject.FreeColumn((INTPTR_INTPTRCAST)pColumn);
                }
                catch (COMException)
                {
                }
            }
        }
예제 #2
0
        internal unsafe byte[] RetrieveDirectorySynchronizationCookie()
        {
            if (_disposed)
            {
                throw new ObjectDisposedException(GetType().Name);
            }

            // get the dirsync cookie back
            AdsSearchColumn  column  = new AdsSearchColumn();
            AdsSearchColumn *pColumn = &column;

            SearchObject.GetColumn(Handle, _adsDirsynCookieName, (INTPTR_INTPTRCAST)pColumn);
            try
            {
                AdsValue *pValue = column.pADsValues;
                byte[]    value  = (byte[])new AdsValueHelper(*pValue).GetValue();

                return(value);
            }
            finally
            {
                try
                {
                    SearchObject.FreeColumn((INTPTR_INTPTRCAST)pColumn);
                }
                catch (COMException)
                {
                }
            }
        }
예제 #3
0
        internal unsafe byte[] RetrieveDirectorySynchronizationCookie()
        {
            byte[] buffer2;
            if (this.disposed)
            {
                throw new ObjectDisposedException(base.GetType().Name);
            }
            AdsSearchColumn  column    = new AdsSearchColumn();
            AdsSearchColumn *columnPtr = &column;

            this.SearchObject.GetColumn(this.Handle, this.AdsDirsynCookieName, (IntPtr)((ulong)columnPtr));
            try
            {
                buffer2 = (byte[])new AdsValueHelper(column.pADsValues[0]).GetValue();
            }
            finally
            {
                try
                {
                    this.SearchObject.FreeColumn((IntPtr)((ulong)columnPtr));
                }
                catch (COMException)
                {
                }
            }
            return(buffer2);
        }
예제 #4
0
        internal unsafe DirectoryVirtualListView RetrieveVLVResponse()
        {
            DirectoryVirtualListView view2;

            if (this.disposed)
            {
                throw new ObjectDisposedException(base.GetType().Name);
            }
            AdsSearchColumn  column    = new AdsSearchColumn();
            AdsSearchColumn *columnPtr = &column;

            this.SearchObject.GetColumn(this.Handle, this.AdsVLVResponseName, (IntPtr)((ulong)columnPtr));
            try
            {
                view2 = (DirectoryVirtualListView) new AdsValueHelper(column.pADsValues[0]).GetVlvValue();
            }
            finally
            {
                try
                {
                    this.SearchObject.FreeColumn((IntPtr)((ulong)columnPtr));
                }
                catch (COMException)
                {
                }
            }
            return(view2);
        }
예제 #5
0
            private unsafe SearchResult GetCurrentResult()
            {
                SearchResult entry         = new SearchResult(_parentCredentials, _parentAuthenticationType);
                int          hr            = 0;
                IntPtr       pszColumnName = (IntPtr)0;

                hr = _results.SearchObject.GetNextColumnName(_results.Handle, (INTPTR_INTPTRCAST)(&pszColumnName));
                while (hr == 0)
                {
                    try
                    {
                        AdsSearchColumn  column  = new AdsSearchColumn();
                        AdsSearchColumn *pColumn = &column;
                        _results.SearchObject.GetColumn(_results.Handle, pszColumnName, (INTPTR_INTPTRCAST)pColumn);
                        try
                        {
                            int       numValues = column.dwNumValues;
                            AdsValue *pValue    = column.pADsValues;
                            object[]  values    = new object[numValues];
                            for (int i = 0; i < numValues; i++)
                            {
                                values[i] = new AdsValueHelper(*pValue).GetValue();
                                pValue++;
                            }
                            entry.Properties.Add(Marshal.PtrToStringUni(pszColumnName), new ResultPropertyValueCollection(values));
                        }
                        finally
                        {
                            try
                            {
                                _results.SearchObject.FreeColumn((INTPTR_INTPTRCAST)pColumn);
                            }
                            catch (COMException)
                            {
                            }
                        }
                    }
                    finally
                    {
                        SafeNativeMethods.FreeADsMem(pszColumnName);
                    }
                    hr = _results.SearchObject.GetNextColumnName(_results.Handle, (INTPTR_INTPTRCAST)(&pszColumnName));
                }

                return(entry);
            }
예제 #6
0
            private unsafe SearchResult GetCurrentResult()
            {
                SearchResult result = new SearchResult(this.parentCredentials, this.parentAuthenticationType);
                int          num    = 0;
                IntPtr       zero   = IntPtr.Zero;

                for (num = this.results.SearchObject.GetNextColumnName(this.results.Handle, (IntPtr)((ulong)((IntPtr) & zero))); num == 0; num = this.results.SearchObject.GetNextColumnName(this.results.Handle, (IntPtr)((ulong)((IntPtr) & zero))))
                {
                    try
                    {
                        AdsSearchColumn  column    = new AdsSearchColumn();
                        AdsSearchColumn *columnPtr = &column;
                        this.results.SearchObject.GetColumn(this.results.Handle, zero, (IntPtr)((ulong)columnPtr));
                        try
                        {
                            int       dwNumValues = column.dwNumValues;
                            AdsValue *pADsValues  = column.pADsValues;
                            object[]  values      = new object[dwNumValues];
                            for (int i = 0; i < dwNumValues; i++)
                            {
                                values[i] = new AdsValueHelper(pADsValues[0]).GetValue();
                                pADsValues++;
                            }
                            result.Properties.Add(Marshal.PtrToStringUni(zero), new ResultPropertyValueCollection(values));
                        }
                        finally
                        {
                            try
                            {
                                this.results.SearchObject.FreeColumn((IntPtr)((ulong)columnPtr));
                            }
                            catch (COMException)
                            {
                            }
                        }
                    }
                    finally
                    {
                        SafeNativeMethods.FreeADsMem(zero);
                    }
                }
                return(result);
            }