Technical information
CHAPTER 3
The PC Interface Driver
Passing Messages 47
On the PC 3
To register your messages from a PC program, load the 32-bit selector into register EBX
and the message count in register CX; then call INT 5Fh with AH = 4. The PC Interface
driver returns the base command number in register BX. Register AH contains an error
code if the messages could not be allocated.
Sending a Message 3
To send a message, you must pass a message parameter block (MsgPBlk) to the PC
Interface driver. The rsSendMessage routine is always asynchronous; it 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.
After the message has been sent, the msgResult field is set to 0 (no error) or –3
(MsgTimeout). The msgActCount field contains the number of bytes actually sent. If
you have specified a completion routine, it is then called.
On the Mac OS 3
The MsgPBlk data structure for programs on the Mac OS has the following format
MsgPBlk RECORD 0
msgQLink DS.l 1 ; Next queue element
msgQType DS.w 1 ; Queue flags
msgCmd DS.w 1 ; The message type or command
msgParam1 DS.l 1 ; Message parameter 1
msgParam2 DS.l 1 ; Message parameter 2
msgBuffer DS.l 1 ; Pointer to the message data buffer
msgReqCount DS.l 1 ; Requested data length
msgActCount DS.l 1 ; Actual data length
msgCompletion DS.l 1 ; Pointer to completion routine or
NULL
msgResult DS.w 1 ; The result of any message operation
msgFlags DS.w 1 ; Message Flags (Swap, and Shared)
Set to zero!
msgUserData DS.l 1 ; For the callers use
MsgPBlkSize Equ * ; Size of record
ENDR
To send a message, build a MsgPBlk and then pass the pointer to the MsgPBlk to the PC
Interface driver in an rsSendMessage control call.