Пример #1
0
        public NspiStatus GetHierarchyInfo(NspiGetHierarchyInfoFlags flags, ref uint version, out PropRowSet rowset)
        {
            this.MarshalStatToNative();
            SafeRpcMemoryHandle rowsetHandle;
            NspiStatus          hierarchyInfo = this.client.GetHierarchyInfo(flags, this.statHandle.DangerousGetHandle(), ref version, out rowsetHandle);

            this.MarshalNativeToStat();
            rowset = NspiClient.GetRowSetAndDisposeHandle(rowsetHandle);
            return(hierarchyInfo);
        }
Пример #2
0
        public NspiStatus QueryRows(NspiQueryRowsFlags flags, int[] mids, int count, IList <PropTag> propTags, out PropRowSet rowset)
        {
            int[] intArrayFromPropTagArray = NspiClient.GetIntArrayFromPropTagArray(propTags);
            this.MarshalStatToNative();
            SafeRpcMemoryHandle rowsetHandle;
            NspiStatus          result = this.client.QueryRows(flags, this.statHandle.DangerousGetHandle(), mids, count, intArrayFromPropTagArray, out rowsetHandle);

            this.MarshalNativeToStat();
            rowset = NspiClient.GetRowSetAndDisposeHandle(rowsetHandle);
            return(result);
        }
Пример #3
0
        public NspiStatus SeekEntries(PropValue propValue, int[] mids, IList <PropTag> propTags, out PropRowSet rowset)
        {
            int[]             intArrayFromPropTagArray = NspiClient.GetIntArrayFromPropTagArray(propTags);
            IList <PropValue> list = new List <PropValue>();

            list.Add(propValue);
            NspiStatus result;

            using (SafeRpcMemoryHandle safeRpcMemoryHandle = new SafeRpcMemoryHandle(propValue.GetBytesToMarshal()))
            {
                PropValue.MarshalToNative(list, safeRpcMemoryHandle);
                this.MarshalStatToNative();
                SafeRpcMemoryHandle rowsetHandle;
                NspiStatus          nspiStatus = this.client.SeekEntries(this.statHandle.DangerousGetHandle(), safeRpcMemoryHandle.DangerousGetHandle(), mids, intArrayFromPropTagArray, out rowsetHandle);
                this.MarshalNativeToStat();
                rowset = NspiClient.GetRowSetAndDisposeHandle(rowsetHandle);
                result = nspiStatus;
            }
            return(result);
        }
Пример #4
0
        public NspiStatus GetMatches(Restriction restriction, object propName, int maxRows, IList <PropTag> propTags, out int[] mids, out PropRowSet rowset)
        {
            NspiStatus result;

            using (SafeRpcMemoryHandle safeRpcMemoryHandle = new SafeRpcMemoryHandle())
            {
                if (restriction != null)
                {
                    safeRpcMemoryHandle.Allocate(restriction.GetBytesToMarshalNspi());
                    restriction.MarshalToNativeNspi(safeRpcMemoryHandle);
                }
                int[] intArrayFromPropTagArray = NspiClient.GetIntArrayFromPropTagArray(propTags);
                this.MarshalStatToNative();
                SafeRpcMemoryHandle rowsetHandle;
                NspiStatus          matches = this.client.GetMatches(this.statHandle.DangerousGetHandle(), safeRpcMemoryHandle.DangerousGetHandle(), IntPtr.Zero, maxRows, intArrayFromPropTagArray, out mids, out rowsetHandle);
                this.MarshalNativeToStat();
                rowset = NspiClient.GetRowSetAndDisposeHandle(rowsetHandle);
                result = matches;
            }
            return(result);
        }
Пример #5
0
        public NspiStatus ResolveNames(byte[][] names, IList <PropTag> propTags, out ResolveResult[] results, out PropRowSet rowset)
        {
            int[] intArrayFromPropTagArray = NspiClient.GetIntArrayFromPropTagArray(propTags);
            this.MarshalStatToNative();
            int[] array;
            SafeRpcMemoryHandle rowsetHandle;
            NspiStatus          result = this.client.ResolveNames(this.statHandle.DangerousGetHandle(), intArrayFromPropTagArray, names, out array, out rowsetHandle);

            this.MarshalNativeToStat();
            rowset = NspiClient.GetRowSetAndDisposeHandle(rowsetHandle);
            if (array != null)
            {
                results = new ResolveResult[array.Length];
                for (int i = 0; i < array.Length; i++)
                {
                    results[i] = (ResolveResult)array[i];
                }
            }
            else
            {
                results = null;
            }
            return(result);
        }