Important: The information in this document is obsolete and should not be used for new development.
ASPUserWrite
TheASPUserWrite
function 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
TRUE
for asynchronous execution.
--> ioCompletion ProcPtr A pointer to a completion routine. <-- ioResult
OSErr 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
ioResult
field.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
ASPOpenSession
function.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
TheASPUserWrite
function 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 theASPUserCommand
function to send a command that directs the ASP server to open a file, you can call theASPUserWrite
function to write data to the file.The .XPP driver uses the memory at the end of the XPP parameter block defined as
aCCBStart
array 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
cmdResult
field. All other types of errors
are returned in the function's parameter blockioResult
field. Error reporting for
theASPUserWrite
function 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'sOpenDriver
function.ASSEMBLY-LANGUAGE INFORMATION
To execute theASPUserWrite
function from assembly language, call the_Control
trap macro with a value ofuserWrite
in thecsCode
field of the parameter block. You must also specify the .XPP driver reference number. To execute the_Control
trap asynchronously, include the value,ASYNC
in 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 theASPUserWrite
command to write data, use theASPUserCommand
function, 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 theASPUserCommand
function.