Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Akshya4You

macrumors newbie
Original poster
Oct 12, 2008
1
0
Hi,
I have to detect that, a drive is on USB or not.
our code was as

HParamBlockRec pb;
GetVolParmsInfoBuffer vParams;
pb.ioParam.ioNamePtr = NULL;
pb.ioParam.ioVRefNum = actualVolume;
pb.ioParam.ioBuffer = (Ptr)&vParams;
pb.ioParam.ioReqCount = sizeof(vParams);
OSErr gvperr = PBHGetVolParmsSync(&pb);


if (((vParams.vMExtendedAttributes & (1L << bIsEjectable)) != 0 ) ||
(vParams.vMServerAdr !=0 )){
//Ejectable or Network drive
continue;
}

But some cases it's not working properly.
Now am using one more flag "bIsOnExternalBus".
Is it ok??
Or there is any other way to know the Drives type(USB).
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.