Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Files /
Chapter 2 - File Manager / File Manager Reference
Shared Environment Routines / Mounting Volumes


PBVolumeMount

You can use the PBVolumeMount function to mount a volume, using either the information returned by the PBGetVolMountInfo function or a structure filled in by your application.

FUNCTION PBVolumeMount (paramBlock: ParmBlkPtr): OSErr;
paramBlock
A pointer to a basic File Manager parameter block.
-->ioCompletionLongIntA pointer to a completion routine.
<--ioResultOSErrThe function's result code.
<--ioVRefNumIntegerA volume reference number.
-->ioBufferLongIntA pointer to mounting information.

DESCRIPTION
The PBVolumeMount function mounts a volume and returns its volume reference number. If you're mounting an AppleShare volume, place the volume's AFP mounting information record in the buffer pointed to by the ioBuffer field.

The PBGetVolMountInfo function does not return the user and volume passwords; they're returned blank. Typically, your application asks the user for any necessary passwords and fills in those fields just before calling PBVolumeMount. If you want to mount a volume with guest status, pass an empty string as the user password.

If you have enough information about the volume, you can fill in the mounting record yourself and call PBVolumeMount, even if you did not save the mounting information while the volume was mounted. To mount an AFP volume, you must fill in the record with at least the zone name, server name, user name, user password, and volume password. You can lay out the fields in any order within the data field, as long as you specify the correct offsets.

SPECIAL CONSIDERATIONS
The File Sharing workstation software introduced in system software version 7.0 does not currently pass the volume password. The AppleShare 3.0 workstation software does, however, pass the volume password.

AFP volumes currently ignore the user authentication method passed in the uamType field of the volume mounting information record whose address is passed in ioBuffer. The most secure available method is used by default, except when a user mounts the volume as <Guest> and uses the kNoUserAuthentication authentication method.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for PBVolumeMount are
Trap macroSelector
_HFSDispatch$0041

RESULT CODES
noErr0No error
notOpenErr-28AppleTalk is not open
nsvErr-35Volume not found
paramErr-50Parameter error; typically, zone, server, and volume name combination is not valid or not complete, or the user name is not recognized
extFSErr-58External file system error; typically, file system signature was not recognized, or function is
not available for that volume
memFullErr-108Not enough memory to create a new volume control block for mounting the volume
afpBadUAM-5002User authentication method is unknown
afpBadVersNum-5003Workstation is using an AFP version that the server doesn't recognize
afpNoServer-5016Server is not responding
afpUserNotAuth-5023User authentication failed (usually, password
is not correct)
afpPwdExpired-5042Password has expired on server
afpBadDirIDType-5060Not a fixed directory ID volume
afpCantMountMoreSrvrs-5061Maximum number of volumes has
been mounted
afpAlreadyMounted-5062Volume already mounted
afpSameNodeErr-5063Attempt to log on to a server running on the same machine

Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996