/* ** CheckVol gets the volume's real vRefNum and builds a volID. The volID ** is used to help insure that calls to resume searching with IndexedSearch ** are to the same volume as the last call to IndexedSearch. */ static OSErr CheckVol(ConstStr255Param pathname, short vRefNum, short *realVRefNum, long *volID) { HParamBlockRec pb; OSErr error; error = GetVolumeInfoNoName(pathname, vRefNum, &pb); if ( error == noErr ) { /* Return the real vRefNum */ *realVRefNum = pb.volumeParam.ioVRefNum; /* Add together a bunch of things that aren't supposed to change on */ /* a mounted volume that's being searched and that should come up with */ /* a fairly unique number */ *volID = pb.volumeParam.ioVCrDate + pb.volumeParam.ioVRefNum + pb.volumeParam.ioVNmAlBlks + pb.volumeParam.ioVAlBlkSiz + pb.volumeParam.ioVFSID; } return ( error ); }
static pascal OSErr DetermineVRefNum(ConstStr255Param pathname, short vRefNum, short *realVRefNum) { HParamBlockRec pb; OSErr error; error = GetVolumeInfoNoName(pathname,vRefNum, &pb); if ( error == noErr ) { *realVRefNum = pb.volumeParam.ioVRefNum; } return ( error ); }