Important: The information in this document is obsolete and should not be used for new development.
ASPUserWrite
TheASPUserWritefunction transfers data from the workstation to the server across a specific session.
FUNCTION ASPUserWrite (thePBptr: XPPParmBlkPtr; async: Boolean): OSErr;
thePBptr- A pointer to an XPP parameter block.
async- A Boolean that specifies whether the function should be executed asynchronously or synchronously. Specify
TRUEfor asynchronous execution.
--> ioCompletion ProcPtr A pointer to a completion routine. <-- ioResultOSErr The function result. <-- cmdResult LongInt The ASP command result. --> ioRefNum Integer The .XPP driver reference number. --> csCode Integer Always userWrite for this function. --> sessRefnum Integer The session reference number. --> aspTimeout Byte The retry interval in seconds. --> cbSize Integer The command block size. --> cbPtr Ptr A pointer to command blocks. <-> rbSize Integer The reply buffer size and reply size. --> rbPointer Ptr A pointer to the reply buffer. <-> wdSize Integer The write data size. --> wdPtr Ptr The write data pointer. <-- ccbStart Array The beginning of memory for the CCB.
Field Description
cmdResult- The ASP command result consisting of 4 bytes of data returned by the server. The ASP client application defines the contents of the command result field. For example, AFP defines this field to specify the result of the AFP command. This field is valid if no system-level error is returned in the
ioResultfield.sessRefnum- The reference number of the session that you want to use to transfer data. The session reference number is the unique number that the .XPP driver assigned to this session when you opened the session by calling the
ASPOpenSessionfunction.aspTimeout- The time in seconds after which ASP is to retry to send data across the session.
cbSize- The size in bytes of the command data that ASP is to transfer across the session.
cbPtr- A pointer to the buffer containing the command data to be transferred.
rbSize- On input, the size in bytes of the buffer that you allocated to contain the command reply that you expect to receive from the server. On return, the size in bytes of the reply data that was actually returned.
rbPointer- A pointer to the buffer for the reply data.
wdSize- On input, the size in bytes of the of the write data that the command is to send. On return, the size in bytes of the write data that was actually sent.
wdPtr- A pointer to the buffer containing the data to be written.
ccbStart- The beginning of the memory for the command control block (CCB) that the .XPP driver is to use. The maximum size of this block
is 296 bytes. The CCB is an array that is part of the .XPP
parameter block.DESCRIPTION
TheASPUserWritefunction allows you to transfer a variable-size block of data to the server end of the ASP session and receive a reply. If you have previously called theASPUserCommandfunction to send a command that directs the ASP server to open a file, you can call theASPUserWritefunction to write data to the file.The .XPP driver uses the memory at the end of the XPP parameter block defined as
aCCBStartarray as an internal command control block (CCB). To ensure that the function executes successfully, you can specify the maximum size for this array as indicated in particular for the function that uses it. If you want to limit the amount
of memory used for the CCB, you can specify the minimum amount of memory
required for this array.A command result error is returned in the
cmdResultfield. All other types of errors
are returned in the function's parameter blockioResultfield. Error reporting for
theASPUserWritefunction is the same as for theASPUserCommand.SPECIAL CONSIDERATIONS
Note that you must provide the .XPP driver reference number as an input parameter
to this function. You can obtain the driver reference number by calling the Device Manager'sOpenDriverfunction.ASSEMBLY-LANGUAGE INFORMATION
To execute theASPUserWritefunction from assembly language, call the_Controltrap macro with a value ofuserWritein thecsCodefield of the parameter block. You must also specify the .XPP driver reference number. To execute the_Controltrap asynchronously, include the value,ASYNCin the operand field.RESULT CODES
aspBufTooSmall -1067 The reply data exceeds the size of the reply buffer; the .XPP driver will fill the buffer and truncate
the dataaspParamErr -1070 You specified an invalid session reference number,
or the session has been closedaspSessClosed -1072 The .XPP driver is in the process of closing
the sessionaspSizeErr -1073 The size of the command block exceeds the
maximum size of 296 bytesSEE ALSO
To send a command to the server to direct it to perform a prerequisite action before you use theASPUserWritecommand to write data, use theASPUserCommandfunction, described on page 8-15. To determine the minimum amount of memory required for the CCB or to find out more about the possible types of error conditions for which errors are returned and how these error results are reported, see the description of theASPUserCommandfunction.