beautypg.com

Apple AppleShare 3.0 Users and Groups Programming Interface User Manual

Page 17

background image

should be a pointer to a zero-length Str31. If ugNamePtr is used, then

ugGroupID should be 0. If both fields have values, then ugGroupID takes

precedence. The new name is specified by ugMisc (a pointer to a Str31).

Result Codes

noErr 0 No error.

ugUserAlreadyExists 1 User with the same name exists.

ugGroupAlreadyExists 2 Group with the same name exists.

ugGroupNotFound 6 The group is not in the users and

groups file.

ugNotAGroup 8 ugGroupID is not the ID of a group.

ugBadParamErr 13 async is TRUE, the new group name

contains a colon, the group name points

to a string longer than 31 characters,

or ugMisc points to a string shorter

than 1 character or longer than 31

characters.

ugServerRunning 16 Server is running.

ugAdminRunning 17 Admin is running.

ugNotBtree 18 Users and groups file is not a B-Tree

file.

ugBadUID 21 The ID in ugAccessID is wrong. The

users and groups file may not be open.

ugFatalError 99 There is a problem with the users and

groups file. Delete it and re-create it

UGGetGroupInfo

FUNCTION UGGetGroupInfo (thePB: UserGroupPBPtr; async: BOOLEAN): OSErr;

pascal OSErr UGGetGroupInfo (UserGroupPBPtr thePB, Boolean async);

Parameter Block 18 ugNamePtr long pointer to group

name

24 ugRefNum word file reference

number

30 ugAccessID long program access ID

38 ugGroupID long group ID

42 ugPosOffset word position offset

UGGetGroupInfo can be used to get information about a specific group or to

enumerate all of the groups in the file. In both cases, the ugGroupID and the

ugNamePtr (a pointer to a Str31) are returned.