Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
getting the Hard Drives in Mac Intel from qt
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="vishal.chauhan" data-source="post: 289050" data-attributes="member: 23833"><p>Hi All,</p><p></p><p>I m using Mac Intel having Mac OS 10.4.7.</p><p>I m using the following code to find the all the media drives present in the System.</p><p></p><p><span style="color: MediumTurquoise"><span style="color: Red">kern_return_t FindAllDrives( io_iterator_t *mediaIterator )</span></span></p><p><span style="color: MediumTurquoise"><span style="color: Red">{</span></span></p><p><span style="color: MediumTurquoise"><span style="color: Red"> CFMutableDictionaryRef classesToMatch;</span></span></p><p><span style="color: MediumTurquoise"><span style="color: Red"> kern_return_t kernResult = KERN_FAILURE; </span></span></p><p><span style="color: MediumTurquoise"><span style="color: Red"> </span></span></p><p><span style="color: MediumTurquoise"><span style="color: Red"> classesToMatch = IOServiceMatching( kIOMediaClass ); </span></span></p><p><span style="color: MediumTurquoise"><span style="color: Red"> if ( classesToMatch == NULL ) goto Bail;</span></span></p><p><span style="color: MediumTurquoise"><span style="color: Red"> CFDictionarySetValue( classesToMatch, CFSTR(kIOMediaWholeKey), kCFBooleanTrue ); </span></span></p><p><span style="color: MediumTurquoise"><span style="color: Red"> </span></span></p><p><span style="color: MediumTurquoise"><span style="color: Red"> kernResult = IOServiceGetMatchingServices( kIOMasterPortDefault, classesToMatch, mediaIterator ); </span></span></p><p><span style="color: MediumTurquoise"><span style="color: Red"> if ( KERN_SUCCESS != kernResult )</span></span></p><p><span style="color: MediumTurquoise"><span style="color: Red"> qDebug("IOServiceGetMatchingServices returned 0x%08x\n", kernResult );</span></span></p><p><span style="color: MediumTurquoise"><span style="color: Red"> </span></span></p><p><span style="color: MediumTurquoise"><span style="color: Red">Bail:</span></span></p><p><span style="color: MediumTurquoise"><span style="color: Red"> return( kernResult );</span></span></p><p><span style="color: MediumTurquoise"><span style="color: Red">}</span></span></p><p></p><p></p><p>I m running this code correctly in power pc but when I m using this code on my Mac intel Is giving the foolwing error.</p><p></p><p>Xcode could not locate source file:qatomic_macosx.h</p><p></p><p>If any one knows then plz plz help me.</p><p></p><p>thanks in advance</p><p>Vishal</p></blockquote><p></p>
[QUOTE="vishal.chauhan, post: 289050, member: 23833"] Hi All, I m using Mac Intel having Mac OS 10.4.7. I m using the following code to find the all the media drives present in the System. [COLOR="MediumTurquoise"][COLOR="Red"]kern_return_t FindAllDrives( io_iterator_t *mediaIterator ) { CFMutableDictionaryRef classesToMatch; kern_return_t kernResult = KERN_FAILURE; classesToMatch = IOServiceMatching( kIOMediaClass ); if ( classesToMatch == NULL ) goto Bail; CFDictionarySetValue( classesToMatch, CFSTR(kIOMediaWholeKey), kCFBooleanTrue ); kernResult = IOServiceGetMatchingServices( kIOMasterPortDefault, classesToMatch, mediaIterator ); if ( KERN_SUCCESS != kernResult ) qDebug("IOServiceGetMatchingServices returned 0x%08x\n", kernResult ); Bail: return( kernResult ); }[/COLOR][/COLOR] I m running this code correctly in power pc but when I m using this code on my Mac intel Is giving the foolwing error. Xcode could not locate source file:qatomic_macosx.h If any one knows then plz plz help me. thanks in advance Vishal [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
getting the Hard Drives in Mac Intel from qt
Top