示例#1
0
        public bool MoveNext()
        {
            var nextObject = IOIteratorStatic.IOIteratorNext(Handle);

            Current = (nextObject == IntPtr.Zero) ? null : IOObject.MarshalNativeObject <T> (nextObject, true);
            if (!IOIteratorStatic.IOIteratorIsValid(Handle))
            {
                throw new InvalidOperationException();
            }
            return(Current != null);
        }
示例#2
0
        internal static IOService GetMatchingService(IntPtr masterPortRef, IntPtr matchingDictionary)
        {
            CFType.Retain(matchingDictionary);
            var serviceRef = IOServiceGetMatchingService(masterPortRef, matchingDictionary);

            if (serviceRef == IntPtr.Zero)
            {
                return(null);
            }
            return(IOObject.MarshalNativeObject <IOService> (serviceRef, true));
        }