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


PBHMapID

You can use the PBHMapID function to determine the name of a user or group if you know the user or group ID.

FUNCTION PBHMapID (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
The PBHMapID function returns the name of a user or group given its unique ID. The ioObjID field contains the ID to be mapped. (AppleShare uses the value 0 to signify <Any User>.) The ioObjType field is the mapping function code; its value is 1 if you're mapping a user ID to a user name or 2 if you're mapping a group ID to a group name. The name is returned in ioObjNamePtr; the maximum size of the name is 31 characters (preceded by a length byte).

Because user and group IDs are interchangeable under AFP 2.1 and later volumes, you might not need to specify a value in the ioObjType field.

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

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