PDA

View Full Version : DADiskCopyDescription returns NULL at times...




amudham
Jul 1, 2009, 08:21 AM
Hi,
Can some one help me with the below issue...
I am trying to find whether given volume path is removable or not, using DASession. Here DADiskCopyDescription() function returns NULL at times.. It working for some times and fails some time.. (Session still exists)

I am not sure. what makes this to fail.... my code is running under daemon context... there are some 12 threads running in parallel... can some one guess whats makes DADiskCopyDescription() to fail?

Please advice, if there are other ways to achieve the same.

part of the code which fails...
#################################
DASessionRef session;
if (inSession)
session = inSession;
else
session = DASessionCreate( NULL );

if (session)
{
DADiskRef dad = DADiskCreateFromBSDName( NULL, session, bsdName );
if (dad)
{
CFDictionaryRef description = DADiskCopyDescription(dad);
........
........
.........
}
}
#################################