Apple AppleShare 3.0 File Server Controls User Manual

Page 21

Advertising
background image

a file server.

Note Although Macintosh File Sharing implements SCDisconnect, there is no

way to use this call with Macintosh File Sharing because Macintosh File

Sharing does not implement the SCGetUserNameRec call. SCGetUserNameRec

retrieves information -- namely user name record IDs (UNRecID) -- that is

necessary for SCDisconnect to work.

FUNCTION MySCDisconnect (DiscArrayPtr: LongIntPtr;

ArrayCount: Integer;

NumMinutes: Integer;

Flags: Integer;

MessagePtr: StringPtr): OSErr;

VAR

scPB: SCParamBlockRec;

BEGIN

scPB.disconnectPB.scDiscArrayPtr := DiscArrayPtr;

scPB.disconnectPB.scArrayCount := ArrayCount;

scPB.disconnectPB.scCode := SCDisconnect;

scPB.disconnectPB.scNumMinutes := NumMinutes;

scPB.disconnectPB.scFlags := Flags;

scPB.disconnectPB.scMessagePtr := MessagePtr;

MySCDisconnect := SyncServerDispatch(@scPB);

END;

The following procedure delivers a disconnect message to and disconnects the

specified user after ten minutes.

PROCEDURE DisconnectUser (UNRecID: LongInt);

VAR

err: OSErr;

ArrayCount: Integer;

NumMinutes: Integer;

Flags: Integer;

Message: tLoginMsg;

BEGIN

Advertising