Important: The information in this document is obsolete and should not be used for new development.
PBHMapName
You can use thePBHMapNamefunction 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. Given a name, the
DESCRIPTIONPBHMapNamefunction returns the corresponding unique user ID
or group ID. The name is passed as a string inioObjNamePtr. IfNILis passed, the ID returned is always 0. The maximum size of the name is 31 characters. TheioObjTypefield 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,ioObjIDcontains the mapped ID.Because user and group IDs are interchangeable under AFP 2.1 and later volumes, you might need to set the
ioObjTypefield 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 forPBHMapNameare
Trap macro Selector _HFSDispatch $0035 RESULT CODES
noErr 0 No error fnfErr -43 Unrecognizable owner or group name paramErr -50 Function not supported by volume