beautypg.com

Apple AppleShare 3.0 File Server Controls User Manual

Page 14

background image

Obtaining status information about users, volumes, and shared items

This section describes the server control calls that you use to obtain

information about file server users, volumes, and shared volumes and folders.

SCGetExpFldr

The following function calls SCGetExpFldr to get information from the call's

return parameters about shared volumes and folders at a specified index

position. The return parameters provide information such as a folder's AFP

short name and directory ID, the number of users who have mounted the volume

or folder, and the index of a volume or folder. (See "SCGetExpFldr" in

Chapter 3 for detailed descriptions of the call's return parameters.) Before

using this function, you must initialize gServerType with the value returned

by the SCServerVersion control call.

FUNCTION MySCGetExpFldr (NamePtr: StringPtr;

VAR VRefNum: Integer;

VAR Logins: Integer;

Index: Integer;

VAR DirID: LongInt): OSErr;

VAR

scPB: SCParamBlockRec;

BEGIN

scPB.standardPB.scCode := SCGetExpFldr;

{ Initialize scVRefNum to 0 so we can tell if }

{ SCGetExpFldr returned something when used with }

{ Macintosh File Sharing }

scPB.standardPB.scVRefNum := 0;

IF Index < 0 THEN

BEGIN

{ File Sharing trashes memory if (scIndex < 0) and }

{ (scNamePtr <> NIL), so we'll prevent that from }

{ happening here. }

scPB.standardPB.scNamePtr := NIL;

{ and we'll return an empty string }

IF NamePtr <> NIL THEN