Specifications

CHAPTER 4
Software Support
Passing Messages 75
Note
Deferred time refers to deferred task time. Hardware and software
interrupts occur all the time. The system processes these interrupts.
After doing so, but before returning control to the interrupt process, the
system looks for any registered deferred tasks and executes them. Refer
to Inside Macintosh: Processes for further information on this subject.
Sending a Message From the PC system 4
To send a message on the PC system, build a MsgPBlk structure and call the interface
driver with AH = 1 (rsSendMessage) and ES:BX = the pointer to the MsgPBlk
structure. When you execute an INT 5Fh, the message is queued, msgResult is set to 1
(busy), and control returns to your application.
Your completion routine is called with a FAR call, and it should return with an RETF.
Your routine may also use registers AX, BX, CX, DX, DI, SI, ES, and DS. When your
completion routine is called, ES:BX is a pointer to the MsgPBlk structure.
The MsgPBlk data structure on the PC system has the following format:
Note
The sizes of some fields are different from the Mac OS equivalent.
Installing a Message Handler 4
Before you can receive messages, you must install a message handler, using the
rsInstallMsgHandler routine. The interface driver calls the message handler when
the driver receives a message with a command value greater than or equal to
recCmdBase and less than recCmdBase+recCmdCount in the MsgRecElem data
MsgPBlk STRUCT
link DWORD ; Link to next queue element
msgCmd WORD ; The message command or type
msgParam1 DWORD ; Param 1
msgParam2 DWORD ; Param 2
msgCompletion DWORD ; Pointer to completion routine or NULL
msgBuffer DWORD ; Pointer to the data buffer
msgReqCount DWORD ; Length of the data
msgActCount DWORD ; # of bytes actually transferred
msgResult BYTE ; The result of message operation
msgFlags BYTE ; Message flags (Shared and Swapped);
set to zero
msgUserData DWORD ; For use by caller
MsgVXD DWORD ; For use by ApplePC VxD
MsgPBlk ENDS