PBHGetVolSync
PBHGetVol Get default volume/directory name and reference
#include <Files.h> File Manager (PBxxx)
OSErr PBHGetVol(pb, async ); WDPBPtr pb ; address of a 52-byte WDPBRec structure Boolean async ; 0=await completion; 1=immediate return Use PBHGetVol to find out which volume and/or working directory is the current default. This is similar to PBGetVol except that it returns the
default working directory reference in a separate field of the parameter block.
pb is the address of a 52-byte WDPBRec structure. The following fields are relevant:
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 to receive 28-byte max volume name <- ioVRefNum short 2 22 Volume or directory reference (see notes)
<- ioWDProcID long 4 28 Working dir user ref ( application's signature)
<- ioWDVRefNum short 2 32 Volume in which default working dir is located
<- ioWDDirID long 4 48 Default working directory's directory ID
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.
noErr (0) No error
nsvErr (-35) No default volume
Notes: The File Manager will use this new default volume in subsequent calls in
which you specify a volume name of NIL (or an invalid name) and a volume
reference number of 0.
If the previous call to PBSetVol or PBHSetVol used a working directory
number in the ioVRefNum field, then that number will be returned.
Otherwise, this function returns a volume reference in ioVRefNum.
The ioNamePtr field can be NIL to ignore the name. Otherwise, it should
point to a 28-byte buffer to hold the maximum-length name of the default
volume (returned as a pascal-style string). Note that this does NOT return
a multiple-name directory name.