Specifications

CHAPTER 4
Software Support
Passing Messages 73
calling the driver with a 32-bit selector that is defined in both applications and with a
count of the number of messages to be used by the applications. The interface driver
allocates a range of messages for that selector and returns the base command number to
the caller. The interface driver makes sure that both the PC application and the
Macintosh application registering messages under the same selector will receive the
same base command number.
Registering Messages From the Mac OS 4
To register your messages from a Macintosh application, make an
rsRegisterMessage control call with the message selector in csParam+0 and the
number of message commands to allocate in csParam+4.
The routine that registers message type is rsRegisterMessage = 803.
Parameter block
—> indicates input to the driver
<— indicates output from the driver
<—> indicates bidirectional transfer (input and output)
The interface driver returns the base command number in csParam+0. If the interface
driver cannot allocate the messages, an error code is returned in ioResult.
Registering Messages From the PC System 4
To register your messages from a PC application, load the 32-bit selector into register
EBX and the message count into register CX. Then call INT 5Fh with AH = 4. The
interface driver returns the base command number in register BX. Register AH contains
an error code if the message could not be allocated.
Sending a Message 4
To send a message, you must pass a message parameter block (MsgPBlk) to the interface
driver. The rsSendMessage routine is always asynchronous. The message control code
for sending a message is rsSendMessage = 800. This routine simply queues the
message parameter block and returns to the caller. The msgResult field is set to 1 (busy)
until the message has been sent.
—> ioCompletion long Pointer to the completion routine.
<— ioResult word Device driver’s result code.
—> ioRefNum word Device driver’s reference number.
—> csCode word Equals rsRegisterMessage.
<—> csParam+0 long 32-bit message selector.
—> csParam+4 long Number of message commands to allocate.