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); }
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)); }