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 / Controlling Login Access


PBHMapName

You can use the PBHMapName function to determine the user ID or group ID from a user or group name.

FUNCTION PBHMapName (paramBlock: HParmBlkPtr; async: Boolean):
                      OSErr;
paramBlock
A pointer to an objParam variant of the HFS parameter block.
async
A Boolean value that specifies asynchronous (TRUE) or synchronous (FALSE) execution.
-->ioCompletionProcPtrA pointer to a completion routine.
<--ioResultOSErrThe result code of the function.
-->ioNamePtrStringPtrA pointer to a pathname.
-->ioVRefNumIntegerA volume specification.
-->ioObjTypeIntegerThe login method.
-->ioObjNamePtrPtrA pointer to the user/group name.
<--ioObjIDLongIntThe user/group ID.

DESCRIPTION
Given a name, the PBHMapName function returns the corresponding unique user ID
or group ID. The name is passed as a string in ioObjNamePtr. If NIL is passed, the ID returned is always 0. The maximum size of the name is 31 characters. The ioObjType field is the mapping function code; its value is 3 if you're mapping a user name to a user ID or 4 if you're mapping a group name to a group ID. On exit, ioObjID contains the mapped ID.

Because user and group IDs are interchangeable under AFP 2.1 and later volumes, you might need to set the ioObjType field to determine which database (user or group) to search first. If both a user and a group have the same name, this field determines which kind of ID you receive.

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

RESULT CODES
noErr0No error
fnfErr-43Unrecognizable owner or group name
paramErr-50Function not supported by volume

Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996