PBGetVolSync
PBGetVol Obtain default volume/directory name and reference
#include <Files.h> File Manager (PBxxx)
OSErr PBGetVol(pb, async );
ParmBlkPtr pb ; address of a 64-byte VolumeParam structure
Boolean async ; 0=await completion; 1=immediate return
returns Error Code; 0=no error
Use PBGetVol to find out which volume or directory is the current default.
The File Manager will use this default volume in future calls in which you
specify no volume name and a volume reference number of 0.
pb is the address of a 64-byte VolumeParam structure or any of the
variants that contain all the relevant fields:
Out-In Name Type Size Offset Description
-> ioCompletion ProcPtr 4 12 Completion routine address (if async =TRUE)
<- ioResult OSErr 2 16 Error Code (0=no error, 1=not done yet)
<- ioNamePtr StringPtr 4 18 Buffer receives 28-byte maximum volume name
<- ioVRefNum short 2 22 Volume or working directory reference
async is a Boolean value. Use FALSE for normal (synchronous) operation
or TRUE to enqueue the request and resume control immediately. See
Async I/O.
Returns: an operating system Error Code. It will be one of:
noErr (0) No error
nsvErr (-35) No such volume
paramErr (-50) No default volume

Notes: PBGetVol may return information about a volume or a working
directory-depending upon the data passed in your most recent call to
PBSetVol or SetVol.
The ioNamePtr field can be NIL to ignore the name. Otherwise, it should
point to a 28-byte buffer to hold the maximum 27-character name of the
default volume. This does NOT return a multiple-name directory name,
even when a previous SetVol set the default to a working directory.