Changeset 51163 in vbox for trunk/src/VBox/Main
- Timestamp:
- Apr 29, 2014 12:47:21 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 93512
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/darwin/iokit.cpp
r51159 r51163 39 39 # include <IOKit/usb/IOUSBLib.h> 40 40 # include <IOKit/IOCFPlugIn.h> 41 # include <IOKit/storage/IOMedia.h> 41 42 #endif 42 43 … … 737 738 static bool darwinIsMassStorageInterfaceInUse(io_object_t MSDObj, io_name_t pszNameBuf) 738 739 { 739 io_object_t MediaObj = darwinFindObjectByClass(MSDObj, "IOMedia", pszNameBuf);740 io_object_t MediaObj = darwinFindObjectByClass(MSDObj, kIOMediaClass, pszNameBuf); 740 741 if (MediaObj) 741 742 { 743 CFMutableDictionaryRef pProperties; 744 kern_return_t krc; 745 bool fInUse = true; 746 747 krc = IORegistryEntryCreateCFProperties(MediaObj, &pProperties, kCFAllocatorDefault, kNilOptions); 748 if (krc == KERN_SUCCESS) 749 { 750 CFBooleanRef pBoolValue = (CFBooleanRef)CFDictionaryGetValue(pProperties, CFSTR(kIOMediaOpenKey)); 751 if (pBoolValue) 752 fInUse = CFBooleanGetValue(pBoolValue); 753 754 CFRelease(pProperties); 755 } 756 742 757 /* more checks? */ 743 758 IOObjectRelease(MediaObj); 744 return true; 745 } 759 return fInUse; 760 } 761 746 762 return false; 747 763 }
Note:
See TracChangeset
for help on using the changeset viewer.