GetDefaultUser
GetDefaultUser Get user number and name of current user
#include <PPCToolbox.h> PPC Toolbox
OSErr GetDefaultUser(userRef, userName);
unsigned long *userRef; User reference number
Str32 userName; User name
returns Error Code; 0=no error
On entry A0: pointer to a GetDefaultUserParams record
D0: selector (13)
On exit D0: result code
The GetDefaultUser function returns the user reference number and the
name of the default user. The default user is specified in the Sharing Setup
control panel. This function is useful if your application uses the PPCStart
function to initiate a session with an application that does not support guest
access.
If the GetDefaultUser function completes with no errors, then the userRef
parameter returns the user reference number that represents the user name
and password of the default user. The userName parameter must contain NIL or
a 32-byte character string. If the userName parameter contains NIL, then the
user name string is not returned. If the userName parameter is a 32-byte
character string, the 32-byte character string contains the user name that is
specified in the Sharing Setup control panel when the GetDefaultUser
function completes (with no errors).
Warning: If you are using Pascal, you cannot pass NIL for the userName
parameter. For example, you cannot pass StringPtr(NIL)^ due to Pascal
range checking of string bounds.
Returns: an operating system Error Code.
noErr (0) No error
noDefaultUserErr (-922) User has not specified owner name in Sharing Setup
control panel
noLoggedInErr (-923) Default user reference number does not yet exist