StartSecureSession
StartSecureSession Start secure PPC session
#include <PPCToolbox.h> PPC Toolbox
OSErr StartSecureSession(pb, userName, useDefault, allowGuest,
guestSelected, prompt);
PPCStartPBPtr pb; Pointer to PPC parameter block
Str32 userName; user name
Boolean useDefault; if TRUE, use default
Boolean allowGuest; if TRUE, allow guest
Boolean *guestSelected; if TRUE, guest is selected
ConstStr255Param prompt prompt text string
returns Error Code; 0=no error
On entry A0: pointer to a StartSecureParams record
D0: selector (14)
On exit D0: result code
The StartSecureSession function prompts for user name and password and
calls PPCStart-all in one synchronous procedure call. Use the
StartSecureSession function whenever a port destination requires
authentication.
Your program fills out a parameter block just as though it were calling the
PPCStart function. You specify all input fields in the parameter block
except for the userRefNum field. The userRefNum field is returned when the
StartSecureSession function successfully completes.
The pb parameter is a pointer to the PPCStart parameter block.
The userName parameter is a pointer to a 32-byte character string to be
displayed as the user's name. If the Pascal string length is 0, the default
user name is used. The default user name is the name specified in the Sharing
Setup control panel. The default user name is returned in the userName buffer.
Set the useDefault parameter to TRUE if you want the StartSecureSession
function to use the default user identity (and possibly prevent the user
identity dialog box from appearing). The allowGuest parameter specifies
whether the Guest radio button in the user identity dialog box is active. It is
usually set to the inverse of the authRequired field in the port information
record. For example, if authRequired is TRUE, then allowGuest should be set to
The guestSelected parameter returns TRUE if the user has logged on as a guest.
The prompt parameter of the StartSecureSession function allows you to
specify a line of text that the dialog box can display. Specify NIL or an empty
string for the prompt parameter to enable the PPC Toolbox to use the default
prompt. The PPC Toolbox uses the default string "Link to <port name> on
<object string> as:". The port name is obtained from the name string of the
port name, and the object string is obtained from the object string of the
location name.
Note: Do not call the StartSecureSession function from an application
that is running in the background, since this function requires that several
dialog boxes appear on the user's screen.
Returns: an operating system Error Code.
noErr (0) No error
userCanceledErr (-128) User decided not to conduct a session
notInitErr (-900) PPC Toolbox has not been initialized yet
nameTypeErr (-902) locationKindSelector is not ppcNBPLocation or
ppcNoLocation
noPortErr (-903) Bad port reference number
noGlobalsErr (-904) System unable to allocate memory, critical error
localOnlyErr (-905) Network activity is currently disabled
destPortErr (-906) Port does not exist at destination
sessTableErr (-907) PPC Toolbox is unable to create a session
noResponseErr (-915) Unable to contact application
portClosedErr (-916) The port was closed
badPortNameErr (-919) PPC port record is invalid
noUserRefErr (-924) Unable to create a new user reference number
networkErr (-925) An error has occurred in the network
noInformErr (-926) PPCStart failed because application did not have an
inform pending
badServiceMethodErr (-930) Service method is other than ppcServiceRealTime
guestNotAllowedErr (-932) Destination port requires authentication