Important: The information in this document is obsolete and should not be used for new development.
XPP Parameter Block for ASP
The ASP functions use the XPP parameter block defined by theXPPParamBlock
data type to pass input and receive output parameters. In addition to the standard XPP parameter block fields, the ASP functions use variant records. TheASPOpenSession
function uses theASPOpenPrm
variant record. TheASPAbortOS
function uses theASPAbortPrm
variant record. TheASPGetParms
function uses theASPSizeBlk
variant record. TheASPUserCommand
andASPUserWrite
functions uses theASPSubPrm
variant record. TheASPUserWrite
,ASPUserCommand
, andASPGetStatus
functions use theASPEndPrm
variant record.This section defines the parameter block fields that are common to all ASP functions. It does not define reserved fields, which are used either internally by the .XPP driver or not at all. The fields that are used by a particular function are defined in the section that describes the function.
XPPPrmBlkType = (...XPPPrmBlk,ASPAbortPrm,ASPSizeBlk...); XPPSubPrmType = (ASPOpenPrm,ASPSubPrm); XPPEndPrmType = (...ASPEndPrm); XPPParamBlock = PACKED RECORD qLink: QElemPtr; {reserved} qType: Integer; {reserved} ioTrap: Integer; {reserved} ioCmdAddr: Ptr; {reserved} ioCompletion: ProcPtr; {completion routine} ioResult: OSErr; {result code} cmdResult: LongInt; {command result (ATP user bytes)} ioVRefNum: Integer; {reserved} ioRefNum: Integer; {driver reference number} csCode: Integer; {call command code} CASE XPPPrmBlkType OF ASPAbortPrm: (abortSCBPtr: Ptr); {SCB pointer for AbortOS} ASPSizeBlk: (aspMaxCmdSize: Integer; {for ASPGetParms} aspQuantumSize: Integer; {for ASPGetParms} numSesss: Integer); {for SPGetParms} XPPPrmBlk: (sessRefnum: Integer; {offset to session refnum} aspTimeout: Byte; {timeout for ATP} aspRetry: Byte; {retry count for ATP} CASE XPPSubPrmType OF ASPOpenPrm: (serverAddr: AddrBlock; {server address block} scbPointer: Ptr; {SCB pointer} attnRoutine: Ptr); {attention routine pointer} ASPSubPrm: (cbSize: Integer; {command block size} cbPtr: Ptr; {command block pointer} rbSize: Integer; {reply buffer size} rbPtr: Ptr; {reply buffer pointer} CASE XPPEndPrmType OF ASPEndPrm: (wdSize: Integer; {write data size} wdPtr: Ptr; {write data pointer} ccbStart: ARRAY[0..295] OF Byte))); {beginning of command control } { block} END; XPPParmBlkPtr = ^XPPParamBlock;
Field Description
ioCompletion
- A pointer to a completion routine that you can provide. When you execute a function asynchronously, AppleTalk calls your completion routine when it completes execution of the function if you specify
a pointer to the routine as the value of this field. SpecifyNIL
for
this field if you do not wish to provide a completion routine.
If you execute a function synchronously, AppleTalk ignores theioCompletion
field. For information about completion routines, see the chapter "Introduction to AppleTalk" in this book.ioResult
- The result of the function. When you execute the function asynchro-
nously, the function sets this field to 1 and returns a function result ofnoErr
as soon as the function begins execution. When the function completes execution, it sets theioResult
field to the actual result code.ioRefNum
- The driver reference number for the .XPP driver. The Device Manager's
OpenDriver
function that you use to open the .XPP driver returns the driver reference number in therefnum
field. You must supply this value. You can call this function to obtain the .XPP driver's reference number even if the .XPP driver is already open. The MPW interface does not fill in this value. For information on opening the .XPP driver, see the chapter "AppleTalk Utilities" in this book. For information on theOpenDriver
function, see the chapter "Device Manager" in Inside Macintosh: Devices.csCode
- The command code of the XPP command to be executed. The MPW interface fills in this field.