Important: The information in this document is obsolete and should not be used for new development.
XPP Parameter Block
TheAFPCommandfunction, which has four formats, requires a pointer to an XPP param-
eter block of typeXPPParamBlock. Because the .XPP driver maps the AFP commands that you specify to ASP commands, the variousAFPCommandfunction formats use some of the XPP parameter block fields defined within variant records for ASP functions.The first four fields of the XPP parameter block,
qLink,qType,ioTrap, andioCmdAddr, which are the same for all four formats of theAFPCommand, are used internally by the Device Manager.You must specify the .XPP driver reference number as the input value of the
ioRefNumfield; AFP does not fill in this value. You can use the Device Manager'sOpenDriverfunction to obtain the .XPP driver reference number.The XPP parameter block that follows is defined as the maximum size required for any format of the
AFPCommandfunction. Various formats use different size parameter blocks. You can abbreviate the parameter block appropriately for anyAFPCommandformat.This section defines the parameter block fields that are common to all AFP 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 format are defined in the section that describes that format.
XPPPrmBlkType = (XPPPrmBlk...); XPPSubPrmType = (ASPOpenPrm,ASPSubPrm); XPPEndPrmType = (AFPLoginPrm,ASPEndPrm); XPPParmBlkPtr = ^XPPParamBlock; 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 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 AFPLoginPrm: (afpAddrBlock: AddrBlock; {address block in AFP login} afPSCBPtr: Ptr; {SCB pointer in AFP login} afpAttnRoutine:Ptr); {attn routine pointer in AFP login} 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, the .XPP driver 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. Specify
NILfor this field if you do not wish to provide a completion routine. If you execute a function synchronously, the .XPP driver ignores theioCompletionfield. 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 ofnoErras soon as the function begins execution. When the function completes execution, it sets theioResultfield to the actual result code.ioRefNum- The driver reference number for the .XPP driver. The Device Manager's
OpenDriverfunction that you use to open the .XPP driver returns the driver reference number in therefnumfield. 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 theOpenDriverfunction, see the chapter "Device Manager" in Inside Macintosh: Devices.csCode- The .XPP driver command code for the function. For the
AFPCommandfunction, the value of this field is alwaysafpCall. The MPW interface fills in this field.