Technical information
CHAPTER 3
The PC Interface Driver
Passing Messages 45
Upon return, the parameters are set as follows:
← csParam+0 long Pointer to the previous notification procedure
← csParam+4 long Previous A1Param value
The caller passes a pointer to the user-defined procedure and a parameter to be passed
to that procedure in A1. The control call returns the previous values. Calling
rsSetNotificationProc with a NULL pointer disables the notification procedure.
When the user-defined procedure is called, the D0.w register contains the event and A1
contains the A1Param value. The procedure can use registers D0–D2 and A0–A1.
The events are
rsPrintSpoolErr = problem opening or writing to a print spool file
rsCOM1SpoolErr = problem opening or writing to the COM1 spool file
rsCOM2SpoolErr = problem opening or writing to the COM2 spool file
rsDiskFileErr = problem reading the disk file
rsLastError 3
You can use the rsLastError status call to obtain the last nonzero error code returned
by the driver.
Parameter block
→ ioCompletion long Pointer to the completion routine
← ioResult word
→ ioRefNum word
→ csCode word Equals rsLastError
← csParam+4 long Pointer to the last error routine
Passing Messages 3
Programs on the Mac OS and the PC can send messages to each other by calling the PC
Interface driver. Programs can also install a receive procedure for receiving messages.
When the PC Interface driver receives a message that is intended for your program, the
driver calls your receive procedure. Your procedure decides whether or not to accept the
message’s data and, if so, where to store the data.
Message Conventions 3
Before communications can take place, a program on the Mac OS and a program on the
PC must have the same definitions of the messages they transfer. A message consists of a
16-bit command, two 32-bit parameters, and up to 64 KB of data. The parameters and the
data can consist of any data in any format. The command must be a unique value