Technical information

CHAPTER 3
The PC Interface Driver
46 Passing Messages
recognized by the programs on the Mac OS and the PC that are sending and receiving
messages. The programs on both the PC and the Mac OS must request command
numbers from the PC Interface driver before sending messages.
Macintosh Interface 3
Programs on the Mac OS communicate with the PC Interface driver through driver calls.
Your program should first open the driver using the open call and then use the control
calls defined in the next section to register, send, and receive messages.
PC Interface 3
Programs on the PC communicate with the PC Interface driver through a software
interrupt interface. The program loads registers with appropriate values, including a
function selector in register AH, and calls the PC Interface driver with an INT 5Fh call.
PC programs can determine whether the PC Interface driver interface is available by
calling INT 5Fh with register AH = 0. If the PC Interface driver is installed, it returns
0A5h in register AH and the highest implemented function code (currently 4) in
register AL.
Registering Messages 3
For a program on the Mac OS to send messages to a program on the PC, both programs
must register their messages with the PC Interface driver. This is done by calling the
driver with a 32-bit selector defined in both programs and a count of the number
of messages to be used by the programs. The PC Interface driver allocates a range of
messages for that selector and returns the base command number to the caller. The
PC Interface driver makes sure that both the PC program and the Macintosh program
registering messages under the same selector will receive the same base command
number.
On the Mac OS 3
To register your messages from a Macintosh program, make an rsRegisterMessage
control call with the message selector in csParam+0 and the number of message
commands to allocate in csParam+4.
Parameter block
ioCompletion long Pointer to the completion routine
ioResult word
ioRefNum word
csCode word Equals rsRegisterMessage
csParam+0 long 32-bit message selector
csParam+4 long Number of message commands to allocate
The PC Interface driver returns the base command number in csParam+0. If the PC
Interface driver cannot allocate the messages, an error code is returned in ioResult.