diff --git a/Hackintool.xcodeproj/project.pbxproj b/Hackintool.xcodeproj/project.pbxproj index b21f7096..61466cae 100644 --- a/Hackintool.xcodeproj/project.pbxproj +++ b/Hackintool.xcodeproj/project.pbxproj @@ -714,7 +714,7 @@ CODE_SIGN_INJECT_BASE_ENTITLEMENTS = NO; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 0327; + CURRENT_PROJECT_VERSION = 0329; DEVELOPMENT_TEAM = 5LGHPJM9ZR; ENABLE_HARDENED_RUNTIME = NO; ENABLE_STRICT_OBJC_MSGSEND = NO; @@ -728,7 +728,7 @@ HEADER_SEARCH_PATHS = "$(SDKROOT)/usr/include/libxml2"; INFOPLIST_FILE = "Hackintool/Hackintool-Info.plist"; LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks @executable_path/../Frameworks"; - MARKETING_VERSION = 3.2.7; + MARKETING_VERSION = 3.2.9; PRODUCT_BUNDLE_IDENTIFIER = com.Headsoft.Hackintool; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -748,7 +748,7 @@ CODE_SIGN_INJECT_BASE_ENTITLEMENTS = NO; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 0327; + CURRENT_PROJECT_VERSION = 0329; DEVELOPMENT_TEAM = 5LGHPJM9ZR; ENABLE_HARDENED_RUNTIME = NO; ENABLE_STRICT_OBJC_MSGSEND = NO; @@ -762,7 +762,7 @@ HEADER_SEARCH_PATHS = "$(SDKROOT)/usr/include/libxml2"; INFOPLIST_FILE = "Hackintool/Hackintool-Info.plist"; LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks @executable_path/../Frameworks"; - MARKETING_VERSION = 3.2.7; + MARKETING_VERSION = 3.2.9; PRODUCT_BUNDLE_IDENTIFIER = com.Headsoft.Hackintool; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/Hackintool.xcodeproj/project.xcworkspace/xcuserdata/headsoft.xcuserdatad/UserInterfaceState.xcuserstate b/Hackintool.xcodeproj/project.xcworkspace/xcuserdata/headsoft.xcuserdatad/UserInterfaceState.xcuserstate index c7b93339..a65f9946 100644 Binary files a/Hackintool.xcodeproj/project.xcworkspace/xcuserdata/headsoft.xcuserdatad/UserInterfaceState.xcuserstate and b/Hackintool.xcodeproj/project.xcworkspace/xcuserdata/headsoft.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Hackintool/IORegTools.m b/Hackintool/IORegTools.m index 770b03eb..c0d5d2f4 100644 --- a/Hackintool/IORegTools.m +++ b/Hackintool/IORegTools.m @@ -713,73 +713,81 @@ bool getUSBControllerInfoForUSBDevice(uint32_t idLocation, uint32_t idVendor, ui bool getIORegAudioDeviceArray(NSMutableArray **audioDeviceArray) { *audioDeviceArray = [[NSMutableArray array] retain]; - io_iterator_t iterator; + io_iterator_t pciIterator; - kern_return_t kr = IOServiceGetMatchingServices(kIOMasterPortDefault, IOServiceMatching("IOAudioDevice"), &iterator); + kern_return_t kr = IOServiceGetMatchingServices(kIOMasterPortDefault, IOServiceMatching("IOPCIDevice"), &pciIterator); if (kr != KERN_SUCCESS) return false; - for (io_service_t device; IOIteratorIsValid(iterator) && (device = IOIteratorNext(iterator)); IOObjectRelease(device)) + io_iterator_t iterator; + + for (io_service_t pciDevice; IOIteratorIsValid(pciIterator) && (pciDevice = IOIteratorNext(pciIterator)); IOObjectRelease(pciDevice)) { - io_name_t className {}; - kr = IOObjectGetClass(device, className); + kern_return_t kr = IORegistryEntryCreateIterator(pciDevice, kIOServicePlane, kIORegistryIterateRecursively, &iterator); if (kr != KERN_SUCCESS) continue; - CFMutableDictionaryRef propertyDictionaryRef = 0; - - kr = IORegistryEntryCreateCFProperties(device, &propertyDictionaryRef, kCFAllocatorDefault, kNilOptions); - - if (kr == KERN_SUCCESS) + for (io_service_t device; IOIteratorIsValid(iterator) && (device = IOIteratorNext(iterator)); IOObjectRelease(device)) { - NSMutableDictionary *propertyDictionary = (__bridge NSMutableDictionary *)propertyDictionaryRef; + if (!IOObjectConformsTo(device, "IOAudioDevice")) + continue; + + io_name_t className {}; + kr = IOObjectGetClass(device, className); + + if (kr != KERN_SUCCESS) + continue; + + CFMutableDictionaryRef propertyDictionaryRef = 0; - NSString *bundleID = [propertyDictionary objectForKey:@"CFBundleIdentifier"]; - NSString *audioDeviceName = [propertyDictionary objectForKey:@"IOAudioDeviceName"]; - NSString *audioDeviceModelID = [propertyDictionary objectForKey:@"IOAudioDeviceModelID"]; - NSString *audioDeviceManufacturerName = [propertyDictionary objectForKey:@"IOAudioDeviceManufacturerName"]; - uint32_t audioDeviceDeviceID = 0, audioDeviceVendorID = 0; - uint32_t audioDeviceDeviceIDNew = 0; + kr = IORegistryEntryCreateCFProperties(device, &propertyDictionaryRef, kCFAllocatorDefault, kNilOptions); - if (audioDeviceModelID != nil) + if (kr == KERN_SUCCESS) { - NSArray *modelIDArray = [audioDeviceModelID componentsSeparatedByString:@":"]; + NSMutableDictionary *propertyDictionary = (__bridge NSMutableDictionary *)propertyDictionaryRef; + + NSString *bundleID = [propertyDictionary objectForKey:@"CFBundleIdentifier"]; + NSString *audioDeviceName = [propertyDictionary objectForKey:@"IOAudioDeviceName"]; + NSString *audioDeviceModelID = [propertyDictionary objectForKey:@"IOAudioDeviceModelID"]; + NSString *audioDeviceManufacturerName = [propertyDictionary objectForKey:@"IOAudioDeviceManufacturerName"]; + uint32_t audioDeviceDeviceID = 0, audioDeviceVendorID = 0; + uint32_t audioDeviceDeviceIDNew = 0; - if ([modelIDArray count] == 3) + if (audioDeviceModelID != nil) { - NSScanner *deviceIDScanner = [NSScanner scannerWithString:[modelIDArray objectAtIndex:1]]; - NSScanner *productIDScanner = [NSScanner scannerWithString:[modelIDArray objectAtIndex:2]]; - - [deviceIDScanner setScanLocation:0]; - [deviceIDScanner scanHexInt:&audioDeviceVendorID]; - - [productIDScanner setScanLocation:0]; - [productIDScanner scanHexInt:&audioDeviceDeviceID]; - - audioDeviceDeviceIDNew = (audioDeviceVendorID << 16) | audioDeviceDeviceID; + NSArray *modelIDArray = [audioDeviceModelID componentsSeparatedByString:@":"]; + + if ([modelIDArray count] == 3) + { + NSScanner *deviceIDScanner = [NSScanner scannerWithString:[modelIDArray objectAtIndex:1]]; + NSScanner *productIDScanner = [NSScanner scannerWithString:[modelIDArray objectAtIndex:2]]; + + [deviceIDScanner setScanLocation:0]; + [deviceIDScanner scanHexInt:&audioDeviceVendorID]; + + [productIDScanner setScanLocation:0]; + [productIDScanner scanHexInt:&audioDeviceDeviceID]; + + audioDeviceDeviceIDNew = (audioDeviceVendorID << 16) | audioDeviceDeviceID; + } } - } - - io_service_t parentDevice; - - if (getIORegParent(device, @"IOPCIDevice", &parentDevice, true)) - { - CFMutableDictionaryRef parentPropertyDictionaryRef = 0; - kr = IORegistryEntryCreateCFProperties(parentDevice, &parentPropertyDictionaryRef, kCFAllocatorDefault, kNilOptions); + CFMutableDictionaryRef pciDevicePropertyDictionaryRef = 0; + + kr = IORegistryEntryCreateCFProperties(pciDevice, &pciDevicePropertyDictionaryRef, kCFAllocatorDefault, kNilOptions); if (kr == KERN_SUCCESS) { - NSMutableDictionary *parentPropertyDictionary = (__bridge NSMutableDictionary *)parentPropertyDictionaryRef; + NSMutableDictionary *pciDevicePropertyDictionary = (__bridge NSMutableDictionary *)pciDevicePropertyDictionaryRef; - uint32_t deviceID = propertyToUInt32([parentPropertyDictionary objectForKey:@"device-id"]); - uint32_t vendorID = propertyToUInt32([parentPropertyDictionary objectForKey:@"vendor-id"]); - uint32_t revisionID = propertyToUInt32([parentPropertyDictionary objectForKey:@"revision-id"]); - uint32_t alcLayoutID = propertyToUInt32([parentPropertyDictionary objectForKey:@"alc-layout-id"]); - uint32_t subSystemID = propertyToUInt32([parentPropertyDictionary objectForKey:@"subsystem-id"]); - uint32_t subSystemVendorID = propertyToUInt32([parentPropertyDictionary objectForKey:@"subsystem-vendor-id"]); + uint32_t deviceID = propertyToUInt32([pciDevicePropertyDictionary objectForKey:@"device-id"]); + uint32_t vendorID = propertyToUInt32([pciDevicePropertyDictionary objectForKey:@"vendor-id"]); + uint32_t revisionID = propertyToUInt32([pciDevicePropertyDictionary objectForKey:@"revision-id"]); + uint32_t alcLayoutID = propertyToUInt32([pciDevicePropertyDictionary objectForKey:@"alc-layout-id"]); + uint32_t subSystemID = propertyToUInt32([pciDevicePropertyDictionary objectForKey:@"subsystem-id"]); + uint32_t subSystemVendorID = propertyToUInt32([pciDevicePropertyDictionary objectForKey:@"subsystem-vendor-id"]); uint32_t deviceIDNew = (vendorID << 16) | deviceID; uint32_t subDeviceIDNew = (subSystemVendorID << 16) | subSystemID; @@ -826,13 +834,13 @@ bool getIORegAudioDeviceArray(NSMutableArray **audioDeviceArray) [audioDevice release]; } - - IOObjectRelease(parentDevice); } } + + IOObjectRelease(iterator); } - IOObjectRelease(iterator); + IOObjectRelease(pciIterator); return ([*audioDeviceArray count] > 0); }